From 54fd8c7a18f0faa3489f8a430e06f2f4f98b3936 Mon Sep 17 00:00:00 2001 From: Christopher Johnson Date: Sat, 26 Feb 2022 14:23:03 -0500 Subject: [PATCH] Big Double/Denormalization Update --- plugins/LinuxVST/src/ADClip7/ADClip7.cpp | 4 +- plugins/LinuxVST/src/ADClip7/ADClip7.h | 12 +- plugins/LinuxVST/src/ADClip7/ADClip7Proc.cpp | 130 +- plugins/LinuxVST/src/ADT/ADTProc.cpp | 8 +- .../src/AQuickVoiceClip/AQuickVoiceClip.cpp | 4 +- .../src/AQuickVoiceClip/AQuickVoiceClip.h | 4 +- .../AQuickVoiceClip/AQuickVoiceClipProc.cpp | 118 +- .../src/Acceleration/Acceleration.cpp | 4 +- .../LinuxVST/src/Acceleration/Acceleration.h | 4 +- .../src/Acceleration/AccelerationProc.cpp | 118 +- .../src/Acceleration2/Acceleration2.h | 4 +- .../src/Acceleration2/Acceleration2Proc.cpp | 36 +- plugins/LinuxVST/src/Air/Air.cpp | 4 +- plugins/LinuxVST/src/Air/Air.h | 4 +- plugins/LinuxVST/src/Air/AirProc.cpp | 118 +- plugins/LinuxVST/src/Air2/Air2.h | 2 +- plugins/LinuxVST/src/Air2/Air2Proc.cpp | 44 +- .../src/Apicolypse/ApicolypseProc.cpp | 8 +- .../src/AtmosphereBuss/AtmosphereBuss.h | 82 +- .../src/AtmosphereBuss/AtmosphereBussProc.cpp | 42 +- .../src/AtmosphereChannel/AtmosphereChannel.h | 82 +- .../AtmosphereChannelProc.cpp | 42 +- plugins/LinuxVST/src/Aura/Aura.cpp | 4 +- plugins/LinuxVST/src/Aura/Aura.h | 8 +- plugins/LinuxVST/src/Aura/AuraProc.cpp | 118 +- plugins/LinuxVST/src/AutoPan/AutoPanProc.cpp | 40 +- .../src/AverMatrix/AverMatrixProc.cpp | 24 +- plugins/LinuxVST/src/Average/Average.cpp | 4 +- plugins/LinuxVST/src/Average/Average.h | 4 +- plugins/LinuxVST/src/Average/AverageProc.cpp | 110 +- plugins/LinuxVST/src/BassAmp/BassAmpProc.cpp | 8 +- .../LinuxVST/src/BassDrive/BassDriveProc.cpp | 8 +- plugins/LinuxVST/src/BassKit/BassKit.cpp | 4 +- plugins/LinuxVST/src/BassKit/BassKit.h | 4 +- plugins/LinuxVST/src/BassKit/BassKitProc.cpp | 38 +- plugins/LinuxVST/src/Baxandall/Baxandall.h | 16 +- .../LinuxVST/src/Baxandall/BaxandallProc.cpp | 24 +- plugins/LinuxVST/src/Beam/BeamProc.cpp | 8 +- plugins/LinuxVST/src/Biquad/Biquad.h | 2 +- plugins/LinuxVST/src/Biquad/BiquadProc.cpp | 40 +- plugins/LinuxVST/src/Biquad2/Biquad2.h | 2 +- plugins/LinuxVST/src/Biquad2/Biquad2Proc.cpp | 24 +- .../LinuxVST/src/BiquadDouble/BiquadDouble.h | 4 +- .../src/BiquadDouble/BiquadDoubleProc.cpp | 24 +- .../src/BiquadOneHalf/BiquadOneHalf.h | 8 +- .../src/BiquadOneHalf/BiquadOneHalfProc.cpp | 24 +- plugins/LinuxVST/src/BiquadPlus/BiquadPlus.h | 2 +- .../src/BiquadPlus/BiquadPlusProc.cpp | 40 +- .../LinuxVST/src/BiquadTriple/BiquadTriple.h | 6 +- .../src/BiquadTriple/BiquadTripleProc.cpp | 24 +- .../src/BitGlitter/BitGlitterProc.cpp | 24 +- plugins/LinuxVST/src/Bite/Bite.cpp | 4 +- plugins/LinuxVST/src/Bite/Bite.h | 4 +- plugins/LinuxVST/src/Bite/BiteProc.cpp | 110 +- .../src/BlockParty/BlockPartyProc.cpp | 16 +- .../src/BrassRider/BrassRiderProc.cpp | 28 +- .../src/BrightAmbience/BrightAmbienceProc.cpp | 16 +- .../src/BrightAmbience2/BrightAmbience2.h | 6 +- .../BrightAmbience2/BrightAmbience2Proc.cpp | 24 +- .../src/BrightAmbience3/BrightAmbience3.h | 8 +- .../BrightAmbience3/BrightAmbience3Proc.cpp | 44 +- .../src/BuildATPDF/BuildATPDFProc.cpp | 80 +- .../LinuxVST/src/BussColors4/BussColors4.cpp | 4 +- .../LinuxVST/src/BussColors4/BussColors4.h | 4 +- .../src/BussColors4/BussColors4Proc.cpp | 118 +- .../LinuxVST/src/ButterComp/ButterComp.cpp | 4 +- plugins/LinuxVST/src/ButterComp/ButterComp.h | 4 +- .../src/ButterComp/ButterCompProc.cpp | 126 +- .../LinuxVST/src/ButterComp2/ButterComp2.cpp | 4 +- .../LinuxVST/src/ButterComp2/ButterComp2.h | 32 +- .../src/ButterComp2/ButterComp2Proc.cpp | 102 +- plugins/LinuxVST/src/C5RawBuss/C5RawBuss.cpp | 4 +- plugins/LinuxVST/src/C5RawBuss/C5RawBuss.h | 4 +- .../LinuxVST/src/C5RawBuss/C5RawBussProc.cpp | 122 +- .../src/C5RawChannel/C5RawChannel.cpp | 4 +- .../LinuxVST/src/C5RawChannel/C5RawChannel.h | 4 +- .../src/C5RawChannel/C5RawChannelProc.cpp | 122 +- plugins/LinuxVST/src/CStrip/CStrip.cpp | 4 +- plugins/LinuxVST/src/CStrip/CStrip.h | 4 +- plugins/LinuxVST/src/CStrip/CStripProc.cpp | 126 +- plugins/LinuxVST/src/Calibre/CalibreProc.cpp | 8 +- plugins/LinuxVST/src/Capacitor/Capacitor.cpp | 4 +- plugins/LinuxVST/src/Capacitor/Capacitor.h | 4 +- .../LinuxVST/src/Capacitor/CapacitorProc.cpp | 118 +- .../src/Capacitor2/Capacitor2Proc.cpp | 16 +- plugins/LinuxVST/src/Chamber/ChamberProc.cpp | 24 +- plugins/LinuxVST/src/Channel4/Channel4.h | 8 +- .../LinuxVST/src/Channel4/Channel4Proc.cpp | 92 +- plugins/LinuxVST/src/Channel5/Channel5.cpp | 4 +- plugins/LinuxVST/src/Channel5/Channel5.h | 4 +- .../LinuxVST/src/Channel5/Channel5Proc.cpp | 12 +- .../LinuxVST/src/Channel6/Channel6Proc.cpp | 24 +- .../LinuxVST/src/Channel7/Channel7Proc.cpp | 32 +- .../LinuxVST/src/Channel8/Channel8Proc.cpp | 32 +- plugins/LinuxVST/src/Channel9/Channel9.h | 4 +- .../LinuxVST/src/Channel9/Channel9Proc.cpp | 52 +- plugins/LinuxVST/src/Chorus/Chorus.cpp | 4 +- plugins/LinuxVST/src/Chorus/Chorus.h | 4 +- plugins/LinuxVST/src/Chorus/ChorusProc.cpp | 118 +- .../src/ChorusEnsemble/ChorusEnsemble.cpp | 4 +- .../src/ChorusEnsemble/ChorusEnsemble.h | 4 +- .../src/ChorusEnsemble/ChorusEnsembleProc.cpp | 118 +- .../src/ChromeOxide/ChromeOxideProc.cpp | 8 +- plugins/LinuxVST/src/Cider/CiderProc.cpp | 8 +- plugins/LinuxVST/src/ClipOnly2/ClipOnly2.h | 8 +- plugins/LinuxVST/src/Coils/Coils.h | 4 +- plugins/LinuxVST/src/Coils/CoilsProc.cpp | 24 +- plugins/LinuxVST/src/Coils2/Coils2.h | 8 +- plugins/LinuxVST/src/Coils2/Coils2Proc.cpp | 52 +- plugins/LinuxVST/src/Cojones/Cojones.cpp | 4 +- plugins/LinuxVST/src/Cojones/Cojones.h | 12 +- plugins/LinuxVST/src/Cojones/CojonesProc.cpp | 54 +- .../Compresaturator/CompresaturatorProc.cpp | 24 +- .../src/Console4Buss/Console4Buss.cpp | 4 +- .../src/Console4Buss/Console4BussProc.cpp | 130 +- .../src/Console4Channel/Console4Channel.cpp | 4 +- .../Console4Channel/Console4ChannelProc.cpp | 126 +- .../src/Console5Buss/Console5Buss.cpp | 4 +- .../LinuxVST/src/Console5Buss/Console5Buss.h | 4 +- .../src/Console5Buss/Console5BussProc.cpp | 118 +- .../src/Console5Channel/Console5Channel.cpp | 4 +- .../src/Console5Channel/Console5Channel.h | 4 +- .../Console5Channel/Console5ChannelProc.cpp | 118 +- .../src/Console5DarkCh/Console5DarkCh.cpp | 4 +- .../src/Console5DarkCh/Console5DarkCh.h | 4 +- .../src/Console5DarkCh/Console5DarkChProc.cpp | 118 +- .../src/Console6Buss/Console6BussProc.cpp | 8 +- .../Console6Channel/Console6ChannelProc.cpp | 8 +- .../LinuxVST/src/Console7Buss/Console7Buss.h | 4 +- .../src/Console7Buss/Console7BussProc.cpp | 28 +- .../src/Console7Cascade/Console7Cascade.h | 10 +- .../Console7Cascade/Console7CascadeProc.cpp | 28 +- .../src/Console7Channel/Console7Channel.h | 2 +- .../Console7Channel/Console7ChannelProc.cpp | 28 +- .../src/Console7Crunch/Console7Crunch.h | 10 +- .../src/Console7Crunch/Console7CrunchProc.cpp | 28 +- .../CrunchyGrooveWear/CrunchyGrooveWear.cpp | 4 +- .../src/CrunchyGrooveWear/CrunchyGrooveWear.h | 4 +- .../CrunchyGrooveWearProc.cpp | 118 +- plugins/LinuxVST/src/Crystal/Crystal.cpp | 4 +- plugins/LinuxVST/src/Crystal/Crystal.h | 4 +- plugins/LinuxVST/src/Crystal/CrystalProc.cpp | 38 +- plugins/LinuxVST/src/Dark/DarkProc.cpp | 8 +- .../LinuxVST/src/DarkNoise/DarkNoiseProc.cpp | 40 +- plugins/LinuxVST/src/DeBess/DeBess.h | 4 +- plugins/LinuxVST/src/DeBess/DeBessProc.cpp | 8 +- plugins/LinuxVST/src/DeEss/DeEss.cpp | 4 +- plugins/LinuxVST/src/DeEss/DeEss.h | 4 +- plugins/LinuxVST/src/DeEss/DeEssProc.cpp | 38 +- plugins/LinuxVST/src/DeHiss/DeHissProc.cpp | 16 +- plugins/LinuxVST/src/DeRez/DeRez.cpp | 4 +- plugins/LinuxVST/src/DeRez/DeRez.h | 4 +- plugins/LinuxVST/src/DeRez/DeRezProc.cpp | 138 +- plugins/LinuxVST/src/DeRez2/DeRez2Proc.cpp | 32 +- .../src/Deckwrecka/DeckwreckaProc.cpp | 8 +- plugins/LinuxVST/src/Density/Density.cpp | 4 +- plugins/LinuxVST/src/Density/Density.h | 4 +- plugins/LinuxVST/src/Density/DensityProc.cpp | 126 +- plugins/LinuxVST/src/Density2/Density2.h | 36 +- .../LinuxVST/src/Density2/Density2Proc.cpp | 68 +- plugins/LinuxVST/src/Desk/Desk.cpp | 4 +- plugins/LinuxVST/src/Desk/Desk.h | 12 +- plugins/LinuxVST/src/Desk/DeskProc.cpp | 126 +- plugins/LinuxVST/src/Desk4/Desk4.cpp | 4 +- plugins/LinuxVST/src/Desk4/Desk4.h | 4 +- plugins/LinuxVST/src/Desk4/Desk4Proc.cpp | 118 +- .../src/DigitalBlack/DigitalBlackProc.cpp | 20 +- plugins/LinuxVST/src/Distance/Distance.cpp | 4 +- plugins/LinuxVST/src/Distance/Distance.h | 4 +- .../LinuxVST/src/Distance/DistanceProc.cpp | 126 +- plugins/LinuxVST/src/Distance2/Distance2.cpp | 4 +- plugins/LinuxVST/src/Distance2/Distance2.h | 82 +- .../LinuxVST/src/Distance2/Distance2Proc.cpp | 42 +- plugins/LinuxVST/src/Distortion/Distortion.h | 8 +- .../src/Distortion/DistortionProc.cpp | 32 +- .../src/DitherFloat/DitherFloatProc.cpp | 16 +- .../src/DitherMeDiskers/DitherMeDiskers.h | 4 +- .../src/DitherMeTimbers/DitherMeTimbers.h | 4 +- plugins/LinuxVST/src/Ditherbox/Ditherbox.h | 12 +- .../LinuxVST/src/Ditherbox/DitherboxProc.cpp | 168 +- .../src/DoublePaul/DoublePaulProc.cpp | 88 +- plugins/LinuxVST/src/Drive/Drive.cpp | 4 +- plugins/LinuxVST/src/Drive/Drive.h | 4 +- plugins/LinuxVST/src/Drive/DriveProc.cpp | 126 +- plugins/LinuxVST/src/DrumSlam/DrumSlam.cpp | 4 +- plugins/LinuxVST/src/DrumSlam/DrumSlam.h | 4 +- .../LinuxVST/src/DrumSlam/DrumSlamProc.cpp | 158 +- plugins/LinuxVST/src/DubCenter/DubCenter.cpp | 4 +- plugins/LinuxVST/src/DubCenter/DubCenter.h | 4 +- .../LinuxVST/src/DubCenter/DubCenterProc.cpp | 46 +- plugins/LinuxVST/src/DubSub/DubSub.cpp | 4 +- plugins/LinuxVST/src/DubSub/DubSub.h | 4 +- plugins/LinuxVST/src/DubSub/DubSubProc.cpp | 42 +- .../LinuxVST/src/DustBunny/DustBunnyProc.cpp | 84 +- plugins/LinuxVST/src/Dyno/DynoProc.cpp | 12 +- plugins/LinuxVST/src/EQ/EQ.cpp | 4 +- plugins/LinuxVST/src/EQ/EQ.h | 4 +- plugins/LinuxVST/src/EQ/EQProc.cpp | 118 +- plugins/LinuxVST/src/EdIsDim/EdIsDim.cpp | 4 +- plugins/LinuxVST/src/EdIsDim/EdIsDim.h | 4 +- plugins/LinuxVST/src/EdIsDim/EdIsDimProc.cpp | 100 +- plugins/LinuxVST/src/Elation/ElationProc.cpp | 16 +- .../LinuxVST/src/ElectroHat/ElectroHat.cpp | 4 +- plugins/LinuxVST/src/ElectroHat/ElectroHat.h | 4 +- .../src/ElectroHat/ElectroHatProc.cpp | 38 +- plugins/LinuxVST/src/Energy/Energy.cpp | 4 +- plugins/LinuxVST/src/Energy/Energy.h | 4 +- plugins/LinuxVST/src/Energy/EnergyProc.cpp | 46 +- plugins/LinuxVST/src/Energy2/Energy2Proc.cpp | 40 +- plugins/LinuxVST/src/Ensemble/Ensemble.cpp | 4 +- plugins/LinuxVST/src/Ensemble/Ensemble.h | 4 +- .../LinuxVST/src/Ensemble/EnsembleProc.cpp | 118 +- plugins/LinuxVST/src/EveryTrim/EveryTrim.cpp | 4 +- plugins/LinuxVST/src/EveryTrim/EveryTrim.h | 4 +- .../LinuxVST/src/EveryTrim/EveryTrimProc.cpp | 126 +- plugins/LinuxVST/src/Facet/FacetProc.cpp | 8 +- .../src/FathomFive/FathomFiveProc.cpp | 88 +- plugins/LinuxVST/src/Floor/Floor.cpp | 4 +- plugins/LinuxVST/src/Floor/Floor.h | 4 +- plugins/LinuxVST/src/Floor/FloorProc.cpp | 46 +- plugins/LinuxVST/src/Focus/Focus.h | 4 +- plugins/LinuxVST/src/Focus/FocusProc.cpp | 36 +- plugins/LinuxVST/src/Fracture/Fracture.cpp | 4 +- plugins/LinuxVST/src/Fracture/Fracture.h | 4 +- .../LinuxVST/src/Fracture/FractureProc.cpp | 126 +- plugins/LinuxVST/src/FromTape/FromTape.cpp | 4 +- plugins/LinuxVST/src/FromTape/FromTape.h | 4 +- .../LinuxVST/src/FromTape/FromTapeProc.cpp | 118 +- .../LinuxVST/src/Galactic/GalacticProc.cpp | 24 +- plugins/LinuxVST/src/Gatelope/Gatelope.cpp | 4 +- plugins/LinuxVST/src/Gatelope/Gatelope.h | 4 +- .../LinuxVST/src/Gatelope/GatelopeProc.cpp | 38 +- .../src/GlitchShifter/GlitchShifterProc.cpp | 16 +- plugins/LinuxVST/src/Golem/Golem.cpp | 4 +- plugins/LinuxVST/src/Golem/Golem.h | 4 +- plugins/LinuxVST/src/Golem/GolemProc.cpp | 118 +- plugins/LinuxVST/src/Gringer/Gringer.h | 8 +- plugins/LinuxVST/src/Gringer/GringerProc.cpp | 12 +- .../LinuxVST/src/GrooveWear/GrooveWear.cpp | 4 +- plugins/LinuxVST/src/GrooveWear/GrooveWear.h | 4 +- .../src/GrooveWear/GrooveWearProc.cpp | 118 +- .../GuitarConditioner/GuitarConditioner.cpp | 4 +- .../src/GuitarConditioner/GuitarConditioner.h | 4 +- .../GuitarConditionerProc.cpp | 134 +- .../LinuxVST/src/HardVacuum/HardVacuum.cpp | 4 +- plugins/LinuxVST/src/HardVacuum/HardVacuum.h | 4 +- .../src/HardVacuum/HardVacuumProc.cpp | 118 +- plugins/LinuxVST/src/HermeTrim/HermeTrim.cpp | 4 +- plugins/LinuxVST/src/HermeTrim/HermeTrim.h | 4 +- .../LinuxVST/src/HermeTrim/HermeTrimProc.cpp | 126 +- plugins/LinuxVST/src/Hermepass/Hermepass.cpp | 4 +- plugins/LinuxVST/src/Hermepass/Hermepass.h | 4 +- .../LinuxVST/src/Hermepass/HermepassProc.cpp | 126 +- .../HighGlossDither/HighGlossDitherProc.cpp | 88 +- .../LinuxVST/src/HighImpact/HighImpact.cpp | 4 +- plugins/LinuxVST/src/HighImpact/HighImpact.h | 4 +- .../src/HighImpact/HighImpactProc.cpp | 126 +- plugins/LinuxVST/src/Highpass/Highpass.cpp | 4 +- plugins/LinuxVST/src/Highpass/Highpass.h | 4 +- .../LinuxVST/src/Highpass/HighpassProc.cpp | 110 +- .../LinuxVST/src/Highpass2/Highpass2Proc.cpp | 16 +- plugins/LinuxVST/src/Holt/Holt.h | 32 +- plugins/LinuxVST/src/Holt/HoltProc.cpp | 24 +- plugins/LinuxVST/src/Hombre/Hombre.cpp | 4 +- plugins/LinuxVST/src/Hombre/Hombre.h | 4 +- plugins/LinuxVST/src/Hombre/HombreProc.cpp | 118 +- plugins/LinuxVST/src/Hull/Hull.h | 8 +- plugins/LinuxVST/src/Hull/HullProc.cpp | 68 +- .../LinuxVST/src/HypersonX/HypersonXProc.cpp | 2 +- .../src/Hypersonic/HypersonicProc.cpp | 2 +- plugins/LinuxVST/src/Infinity/Infinity.h | 6 +- .../LinuxVST/src/Infinity/InfinityProc.cpp | 72 +- plugins/LinuxVST/src/Infinity2/Infinity2.h | 6 +- .../LinuxVST/src/Infinity2/Infinity2Proc.cpp | 72 +- plugins/LinuxVST/src/Infrasonic/Infrasonic.h | 10 +- .../src/Infrasonic/InfrasonicProc.cpp | 16 +- plugins/LinuxVST/src/Interstage/Interstage.h | 4 +- .../src/Interstage/InterstageProc.cpp | 16 +- .../LinuxVST/src/IronOxide5/IronOxide5.cpp | 4 +- plugins/LinuxVST/src/IronOxide5/IronOxide5.h | 4 +- .../src/IronOxide5/IronOxide5Proc.cpp | 118 +- .../src/IronOxideClassic/IronOxideClassic.cpp | 4 +- .../src/IronOxideClassic/IronOxideClassic.h | 4 +- .../IronOxideClassic/IronOxideClassicProc.cpp | 118 +- .../src/IronOxideClassic2/IronOxideClassic2.h | 4 +- .../IronOxideClassic2Proc.cpp | 40 +- plugins/LinuxVST/src/Isolator/Isolator.h | 6 +- .../LinuxVST/src/Isolator/IsolatorProc.cpp | 24 +- plugins/LinuxVST/src/Logical4/Logical4.cpp | 4 +- .../LinuxVST/src/Logical4/Logical4Proc.cpp | 118 +- plugins/LinuxVST/src/Loud/LoudProc.cpp | 8 +- plugins/LinuxVST/src/Lowpass/Lowpass.cpp | 4 +- plugins/LinuxVST/src/Lowpass/Lowpass.h | 4 +- plugins/LinuxVST/src/Lowpass/LowpassProc.cpp | 110 +- .../LinuxVST/src/Lowpass2/Lowpass2Proc.cpp | 16 +- plugins/LinuxVST/src/Luxor/LuxorProc.cpp | 8 +- plugins/LinuxVST/src/MV/MVProc.cpp | 8 +- plugins/LinuxVST/src/MackEQ/MackEQ.h | 32 +- plugins/LinuxVST/src/MackEQ/MackEQProc.cpp | 64 +- plugins/LinuxVST/src/Mackity/Mackity.h | 12 +- plugins/LinuxVST/src/Mackity/MackityProc.cpp | 32 +- plugins/LinuxVST/src/MatrixVerb/MatrixVerb.h | 6 +- .../src/MatrixVerb/MatrixVerbProc.cpp | 72 +- plugins/LinuxVST/src/Melt/Melt.cpp | 4 +- plugins/LinuxVST/src/Melt/Melt.h | 4 +- plugins/LinuxVST/src/Melt/MeltProc.cpp | 126 +- plugins/LinuxVST/src/MidSide/MidSide.cpp | 4 +- plugins/LinuxVST/src/MidSide/MidSide.h | 4 +- plugins/LinuxVST/src/MidSide/MidSideProc.cpp | 100 +- plugins/LinuxVST/src/MoNoam/MoNoamProc.cpp | 16 +- plugins/LinuxVST/src/Mojo/MojoProc.cpp | 12 +- plugins/LinuxVST/src/Monitoring/Monitoring.h | 8 +- .../src/Monitoring/MonitoringProc.cpp | 72 +- .../LinuxVST/src/Monitoring2/Monitoring2.h | 2 +- .../src/Monitoring2/Monitoring2Proc.cpp | 48 +- .../MultiBandDistortionProc.cpp | 24 +- .../LinuxVST/src/NCSeventeen/NCSeventeen.cpp | 4 +- .../LinuxVST/src/NCSeventeen/NCSeventeen.h | 4 +- .../src/NCSeventeen/NCSeventeenProc.cpp | 118 +- .../NaturalizeDither/NaturalizeDitherProc.cpp | 88 +- .../LinuxVST/src/Neverland/NeverlandProc.cpp | 8 +- plugins/LinuxVST/src/Nikola/NikolaProc.cpp | 16 +- .../src/NodeDither/NodeDitherProc.cpp | 88 +- plugins/LinuxVST/src/Noise/Noise.cpp | 4 +- plugins/LinuxVST/src/Noise/Noise.h | 4 +- plugins/LinuxVST/src/Noise/NoiseProc.cpp | 118 +- .../src/NonlinearSpace/NonlinearSpace.cpp | 4 +- .../src/NonlinearSpace/NonlinearSpace.h | 4 +- .../src/NonlinearSpace/NonlinearSpaceProc.cpp | 126 +- .../src/NotJustAnotherCD/NotJustAnotherCD.h | 4 +- .../NotJustAnotherCD/NotJustAnotherCDProc.cpp | 88 +- .../NotJustAnotherDither.h | 4 +- .../NotJustAnotherDitherProc.cpp | 34 +- .../src/OneCornerClip/OneCornerClip.cpp | 4 +- .../src/OneCornerClip/OneCornerClip.h | 4 +- .../src/OneCornerClip/OneCornerClipProc.cpp | 118 +- plugins/LinuxVST/src/PDBuss/PDBuss.cpp | 4 +- plugins/LinuxVST/src/PDBuss/PDBuss.h | 4 +- plugins/LinuxVST/src/PDBuss/PDBussProc.cpp | 118 +- plugins/LinuxVST/src/PDChannel/PDChannel.cpp | 4 +- plugins/LinuxVST/src/PDChannel/PDChannel.h | 4 +- .../LinuxVST/src/PDChannel/PDChannelProc.cpp | 118 +- plugins/LinuxVST/src/Pafnuty/Pafnuty.cpp | 4 +- plugins/LinuxVST/src/Pafnuty/Pafnuty.h | 4 +- plugins/LinuxVST/src/Pafnuty/PafnutyProc.cpp | 146 +- .../src/PaulDither/PaulDitherProc.cpp | 8 +- .../LinuxVST/src/PaulWide/PaulWideProc.cpp | 20 +- .../LinuxVST/src/PeaksOnly/PeaksOnlyProc.cpp | 8 +- .../LinuxVST/src/PhaseNudge/PhaseNudge.cpp | 4 +- plugins/LinuxVST/src/PhaseNudge/PhaseNudge.h | 4 +- .../src/PhaseNudge/PhaseNudgeProc.cpp | 126 +- plugins/LinuxVST/src/PitchDelay/PitchDelay.h | 8 +- .../src/PitchDelay/PitchDelayProc.cpp | 36 +- .../src/PocketVerbs/PocketVerbsProc.cpp | 16 +- plugins/LinuxVST/src/Podcast/PodcastProc.cpp | 16 +- .../src/PodcastDeluxe/PodcastDeluxeProc.cpp | 8 +- plugins/LinuxVST/src/Point/Point.cpp | 4 +- plugins/LinuxVST/src/Point/Point.h | 4 +- plugins/LinuxVST/src/Point/PointProc.cpp | 118 +- plugins/LinuxVST/src/Pop/Pop.h | 24 +- plugins/LinuxVST/src/Pop/PopProc.cpp | 36 +- plugins/LinuxVST/src/PowerSag/PowerSag.cpp | 4 +- plugins/LinuxVST/src/PowerSag/PowerSag.h | 4 +- .../LinuxVST/src/PowerSag/PowerSagProc.cpp | 118 +- .../LinuxVST/src/PowerSag2/PowerSag2Proc.cpp | 16 +- .../LinuxVST/src/Precious/PreciousProc.cpp | 8 +- .../LinuxVST/src/Preponderant/Preponderant.h | 34 +- .../src/Preponderant/PreponderantProc.cpp | 64 +- plugins/LinuxVST/src/Pressure4/Pressure4.cpp | 4 +- plugins/LinuxVST/src/Pressure4/Pressure4.h | 4 +- .../LinuxVST/src/Pressure4/Pressure4Proc.cpp | 122 +- plugins/LinuxVST/src/Pressure5/Pressure5.h | 12 +- .../LinuxVST/src/Pressure5/Pressure5Proc.cpp | 32 +- plugins/LinuxVST/src/PurestAir/PurestAir.h | 24 +- .../LinuxVST/src/PurestAir/PurestAirProc.cpp | 16 +- .../PurestConsole2Buss/PurestConsole2Buss.h | 2 +- .../PurestConsole2BussProc.cpp | 28 +- .../PurestConsole2Channel.h | 2 +- .../PurestConsole2ChannelProc.cpp | 28 +- .../PurestConsoleBuss/PurestConsoleBuss.cpp | 4 +- .../src/PurestConsoleBuss/PurestConsoleBuss.h | 4 +- .../PurestConsoleBussProc.cpp | 118 +- .../PurestConsoleChannel.cpp | 4 +- .../PurestConsoleChannel.h | 4 +- .../PurestConsoleChannelProc.cpp | 118 +- .../LinuxVST/src/PurestDrive/PurestDrive.cpp | 4 +- .../LinuxVST/src/PurestDrive/PurestDrive.h | 4 +- .../src/PurestDrive/PurestDriveProc.cpp | 118 +- .../LinuxVST/src/PurestEcho/PurestEcho.cpp | 4 +- plugins/LinuxVST/src/PurestEcho/PurestEcho.h | 4 +- .../src/PurestEcho/PurestEchoProc.cpp | 118 +- .../src/PurestFade/PurestFadeProc.cpp | 24 +- .../LinuxVST/src/PurestGain/PurestGain.cpp | 4 +- plugins/LinuxVST/src/PurestGain/PurestGain.h | 4 +- .../src/PurestGain/PurestGainProc.cpp | 92 +- .../src/PurestSquish/PurestSquishProc.cpp | 32 +- .../LinuxVST/src/PurestWarm/PurestWarm.cpp | 4 +- plugins/LinuxVST/src/PurestWarm/PurestWarm.h | 4 +- .../src/PurestWarm/PurestWarmProc.cpp | 104 +- plugins/LinuxVST/src/Pyewacket/Pyewacket.cpp | 4 +- plugins/LinuxVST/src/Pyewacket/Pyewacket.h | 4 +- .../LinuxVST/src/Pyewacket/PyewacketProc.cpp | 134 +- .../src/RawGlitters/RawGlittersProc.cpp | 8 +- .../src/RawTimbers/RawTimbersProc.cpp | 8 +- plugins/LinuxVST/src/Recurve/Recurve.h | 2 +- plugins/LinuxVST/src/Recurve/RecurveProc.cpp | 8 +- plugins/LinuxVST/src/Remap/RemapProc.cpp | 32 +- plugins/LinuxVST/src/ResEQ/ResEQProc.cpp | 16 +- plugins/LinuxVST/src/Reverb/Reverb.h | 6 +- plugins/LinuxVST/src/Reverb/ReverbProc.cpp | 72 +- .../LinuxVST/src/Righteous4/Righteous4.cpp | 4 +- plugins/LinuxVST/src/Righteous4/Righteous4.h | 8 +- .../src/Righteous4/Righteous4Proc.cpp | 130 +- plugins/LinuxVST/src/SideDull/SideDull.cpp | 4 +- plugins/LinuxVST/src/SideDull/SideDull.h | 4 +- .../LinuxVST/src/SideDull/SideDullProc.cpp | 122 +- plugins/LinuxVST/src/Sidepass/Sidepass.cpp | 4 +- plugins/LinuxVST/src/Sidepass/Sidepass.h | 4 +- .../LinuxVST/src/Sidepass/SidepassProc.cpp | 122 +- .../SingleEndedTriode/SingleEndedTriode.cpp | 4 +- .../src/SingleEndedTriode/SingleEndedTriode.h | 4 +- .../SingleEndedTriodeProc.cpp | 130 +- plugins/LinuxVST/src/Slew/SlewProc.cpp | 80 +- plugins/LinuxVST/src/Slew2/Slew2Proc.cpp | 80 +- plugins/LinuxVST/src/Slew3/Slew3Proc.cpp | 8 +- .../LinuxVST/src/SlewOnly/SlewOnlyProc.cpp | 96 +- plugins/LinuxVST/src/Smooth/SmoothProc.cpp | 16 +- .../LinuxVST/src/SoftGate/SoftGateProc.cpp | 8 +- .../SpatializeDither/SpatializeDitherProc.cpp | 8 +- plugins/LinuxVST/src/Spiral/SpiralProc.cpp | 8 +- plugins/LinuxVST/src/Spiral2/Spiral2.h | 12 +- plugins/LinuxVST/src/Spiral2/Spiral2Proc.cpp | 24 +- plugins/LinuxVST/src/Srsly/Srsly.h | 18 +- plugins/LinuxVST/src/Srsly/SrslyProc.cpp | 112 +- plugins/LinuxVST/src/Srsly2/Srsly2.h | 18 +- plugins/LinuxVST/src/Srsly2/Srsly2Proc.cpp | 112 +- plugins/LinuxVST/src/StarChild/StarChild.cpp | 4 +- plugins/LinuxVST/src/StarChild/StarChild.h | 4 +- .../LinuxVST/src/StarChild/StarChildProc.cpp | 110 +- plugins/LinuxVST/src/StereoFX/StereoFX.cpp | 4 +- plugins/LinuxVST/src/StereoFX/StereoFX.h | 4 +- .../LinuxVST/src/StereoFX/StereoFXProc.cpp | 126 +- plugins/LinuxVST/src/StudioTan/StudioTan.h | 16 +- .../LinuxVST/src/StudioTan/StudioTanProc.cpp | 44 +- .../LinuxVST/src/SubsOnly/SubsOnlyProc.cpp | 88 +- plugins/LinuxVST/src/Surge/Surge.cpp | 4 +- plugins/LinuxVST/src/Surge/Surge.h | 14 +- plugins/LinuxVST/src/Surge/SurgeProc.cpp | 126 +- plugins/LinuxVST/src/SurgeTide/SurgeTide.cpp | 4 +- plugins/LinuxVST/src/SurgeTide/SurgeTide.h | 10 +- .../LinuxVST/src/SurgeTide/SurgeTideProc.cpp | 126 +- plugins/LinuxVST/src/Swell/Swell.cpp | 4 +- plugins/LinuxVST/src/Swell/Swell.h | 8 +- plugins/LinuxVST/src/Swell/SwellProc.cpp | 126 +- .../src/TPDFDither/TPDFDitherProc.cpp | 8 +- .../LinuxVST/src/TPDFWide/TPDFWideProc.cpp | 16 +- plugins/LinuxVST/src/Tape/Tape.h | 20 +- plugins/LinuxVST/src/Tape/TapeProc.cpp | 48 +- plugins/LinuxVST/src/TapeDelay/TapeDelay.cpp | 4 +- plugins/LinuxVST/src/TapeDelay/TapeDelay.h | 4 +- .../LinuxVST/src/TapeDelay/TapeDelayProc.cpp | 38 +- plugins/LinuxVST/src/TapeDelay2/TapeDelay2.h | 8 +- .../src/TapeDelay2/TapeDelay2Proc.cpp | 36 +- .../src/TapeDither/TapeDitherProc.cpp | 8 +- plugins/LinuxVST/src/TapeDust/TapeDust.cpp | 4 +- plugins/LinuxVST/src/TapeDust/TapeDust.h | 4 +- .../LinuxVST/src/TapeDust/TapeDustProc.cpp | 118 +- plugins/LinuxVST/src/TapeFat/TapeFat.cpp | 4 +- plugins/LinuxVST/src/TapeFat/TapeFat.h | 4 +- plugins/LinuxVST/src/TapeFat/TapeFatProc.cpp | 38 +- plugins/LinuxVST/src/Thunder/Thunder.cpp | 4 +- plugins/LinuxVST/src/Thunder/Thunder.h | 4 +- plugins/LinuxVST/src/Thunder/ThunderProc.cpp | 118 +- plugins/LinuxVST/src/ToTape5/ToTape5.cpp | 4 +- plugins/LinuxVST/src/ToTape5/ToTape5.h | 4 +- plugins/LinuxVST/src/ToTape5/ToTape5Proc.cpp | 122 +- plugins/LinuxVST/src/ToTape6/ToTape6.h | 20 +- plugins/LinuxVST/src/ToTape6/ToTape6Proc.cpp | 64 +- plugins/LinuxVST/src/ToVinyl4/ToVinyl4.cpp | 4 +- plugins/LinuxVST/src/ToVinyl4/ToVinyl4.h | 4 +- .../LinuxVST/src/ToVinyl4/ToVinyl4Proc.cpp | 110 +- plugins/LinuxVST/src/ToneSlant/ToneSlant.cpp | 4 +- plugins/LinuxVST/src/ToneSlant/ToneSlant.h | 4 +- .../LinuxVST/src/ToneSlant/ToneSlantProc.cpp | 110 +- plugins/LinuxVST/src/TransDesk/TransDesk.cpp | 4 +- plugins/LinuxVST/src/TransDesk/TransDesk.h | 12 +- .../LinuxVST/src/TransDesk/TransDeskProc.cpp | 126 +- .../src/TremoSquare/TremoSquareProc.cpp | 16 +- plugins/LinuxVST/src/Tremolo/Tremolo.cpp | 4 +- plugins/LinuxVST/src/Tremolo/Tremolo.h | 4 +- plugins/LinuxVST/src/Tremolo/TremoloProc.cpp | 126 +- .../src/TripleSpread/TripleSpreadProc.cpp | 24 +- plugins/LinuxVST/src/Tube/Tube.h | 8 +- plugins/LinuxVST/src/Tube/TubeProc.cpp | 32 +- plugins/LinuxVST/src/Tube2/Tube2.h | 12 +- plugins/LinuxVST/src/Tube2/Tube2Proc.cpp | 48 +- plugins/LinuxVST/src/TubeDesk/TubeDesk.cpp | 4 +- plugins/LinuxVST/src/TubeDesk/TubeDesk.h | 12 +- .../LinuxVST/src/TubeDesk/TubeDeskProc.cpp | 126 +- plugins/LinuxVST/src/UltrasonX/UltrasonX.h | 2 +- .../LinuxVST/src/UltrasonX/UltrasonXProc.cpp | 28 +- plugins/LinuxVST/src/Ultrasonic/Ultrasonic.h | 10 +- .../src/Ultrasonic/UltrasonicProc.cpp | 16 +- .../src/UltrasonicLite/UltrasonicLite.h | 2 +- .../src/UltrasonicLite/UltrasonicLiteProc.cpp | 16 +- .../src/UltrasonicMed/UltrasonicMed.h | 4 +- .../src/UltrasonicMed/UltrasonicMedProc.cpp | 16 +- plugins/LinuxVST/src/UnBox/UnBox.h | 24 +- plugins/LinuxVST/src/UnBox/UnBoxProc.cpp | 24 +- plugins/LinuxVST/src/VariMu/VariMu.cpp | 4 +- plugins/LinuxVST/src/VariMu/VariMu.h | 4 +- plugins/LinuxVST/src/VariMu/VariMuProc.cpp | 54 +- plugins/LinuxVST/src/Verbity/VerbityProc.cpp | 32 +- plugins/LinuxVST/src/Vibrato/VibratoProc.cpp | 8 +- .../src/VinylDither/VinylDitherProc.cpp | 8 +- .../VoiceOfTheStarship/VoiceOfTheStarship.cpp | 4 +- .../VoiceOfTheStarship/VoiceOfTheStarship.h | 4 +- .../VoiceOfTheStarshipProc.cpp | 30 +- .../src/VoiceTrick/VoiceTrickProc.cpp | 12 +- plugins/LinuxVST/src/Wider/Wider.cpp | 4 +- plugins/LinuxVST/src/Wider/Wider.h | 4 +- plugins/LinuxVST/src/Wider/WiderProc.cpp | 126 +- plugins/LinuxVST/src/XBandpass/XBandpass.h | 10 +- .../LinuxVST/src/XBandpass/XBandpassProc.cpp | 44 +- plugins/LinuxVST/src/XHighpass/XHighpass.h | 10 +- .../LinuxVST/src/XHighpass/XHighpassProc.cpp | 44 +- plugins/LinuxVST/src/XLowpass/XLowpass.h | 10 +- .../LinuxVST/src/XLowpass/XLowpassProc.cpp | 44 +- plugins/LinuxVST/src/XNotch/XNotch.h | 10 +- plugins/LinuxVST/src/XNotch/XNotchProc.cpp | 44 +- plugins/LinuxVST/src/XRegion/XRegion.h | 10 +- plugins/LinuxVST/src/XRegion/XRegionProc.cpp | 44 +- plugins/LinuxVST/src/YBandpass/YBandpass.h | 18 +- .../LinuxVST/src/YBandpass/YBandpassProc.cpp | 40 +- plugins/LinuxVST/src/YHighpass/YHighpass.h | 18 +- .../LinuxVST/src/YHighpass/YHighpassProc.cpp | 40 +- plugins/LinuxVST/src/YLowpass/YLowpass.h | 18 +- .../LinuxVST/src/YLowpass/YLowpassProc.cpp | 40 +- plugins/LinuxVST/src/YNotch/YNotch.h | 18 +- plugins/LinuxVST/src/YNotch/YNotchProc.cpp | 40 +- plugins/LinuxVST/src/ZBandpass/ZBandpass.h | 16 +- .../LinuxVST/src/ZBandpass/ZBandpassProc.cpp | 44 +- plugins/LinuxVST/src/ZBandpass2/ZBandpass2.h | 28 +- .../src/ZBandpass2/ZBandpass2Proc.cpp | 64 +- plugins/LinuxVST/src/ZHighpass/ZHighpass.h | 16 +- .../LinuxVST/src/ZHighpass/ZHighpassProc.cpp | 44 +- plugins/LinuxVST/src/ZHighpass2/ZHighpass2.h | 28 +- .../src/ZHighpass2/ZHighpass2Proc.cpp | 64 +- plugins/LinuxVST/src/ZLowpass/ZLowpass.h | 16 +- .../LinuxVST/src/ZLowpass/ZLowpassProc.cpp | 44 +- plugins/LinuxVST/src/ZLowpass2/ZLowpass2.h | 28 +- .../LinuxVST/src/ZLowpass2/ZLowpass2Proc.cpp | 64 +- plugins/LinuxVST/src/ZNotch/ZNotch.h | 16 +- plugins/LinuxVST/src/ZNotch/ZNotchProc.cpp | 44 +- plugins/LinuxVST/src/ZNotch2/ZNotch2.h | 28 +- plugins/LinuxVST/src/ZNotch2/ZNotch2Proc.cpp | 64 +- plugins/LinuxVST/src/curve/curve.h | 2 +- plugins/LinuxVST/src/curve/curveProc.cpp | 8 +- .../LinuxVST/src/uLawDecode/uLawDecode.cpp | 4 +- plugins/LinuxVST/src/uLawDecode/uLawDecode.h | 4 +- .../src/uLawDecode/uLawDecodeProc.cpp | 38 +- .../LinuxVST/src/uLawEncode/uLawEncode.cpp | 4 +- plugins/LinuxVST/src/uLawEncode/uLawEncode.h | 4 +- .../src/uLawEncode/uLawEncodeProc.cpp | 38 +- plugins/MacAU/ADClip7/ADClip7.cpp | 41 +- plugins/MacAU/ADClip7/ADClip7.h | 6 +- plugins/MacAU/ADT/ADT.cpp | 4 +- .../MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp | 37 +- plugins/MacAU/Acceleration/Acceleration.cpp | 42 +- plugins/MacAU/Acceleration/Acceleration.h | 2 +- plugins/MacAU/Acceleration2/Acceleration2.cpp | 8 +- plugins/MacAU/Acceleration2/Acceleration2.h | 4 +- plugins/MacAU/Air/Air.cpp | 31 +- plugins/MacAU/Air/Air.h | 2 +- plugins/MacAU/Air2/Air2.cpp | 10 +- plugins/MacAU/Air2/Air2.h | 2 +- plugins/MacAU/Apicolypse/Apicolypse.cpp | 4 +- .../MacAU/AtmosphereBuss/AtmosphereBuss.cpp | 37 +- plugins/MacAU/AtmosphereBuss/AtmosphereBuss.h | 54 +- .../AtmosphereChannel/AtmosphereChannel.cpp | 38 +- .../AtmosphereChannel/AtmosphereChannel.h | 54 +- plugins/MacAU/Aura/Aura.cpp | 39 +- plugins/MacAU/Aura/Aura.h | 4 +- plugins/MacAU/AutoPan/AutoPan.cpp | 14 +- plugins/MacAU/AverMatrix/AverMatrix.cpp | 8 +- plugins/MacAU/Average/Average.cpp | 37 +- plugins/MacAU/BassAmp/BassAmp.cpp | 6 +- plugins/MacAU/BassDrive/BassDrive.cpp | 4 +- plugins/MacAU/BassKit/BassKit.cpp | 12 +- plugins/MacAU/BassKit/BassKit.h | 4 +- plugins/MacAU/Baxandall/Baxandall.cpp | 8 +- plugins/MacAU/Baxandall/Baxandall.h | 8 +- plugins/MacAU/Beam/Beam.cpp | 4 +- plugins/MacAU/Biquad/Biquad.cpp | 10 +- plugins/MacAU/Biquad/Biquad.h | 2 +- plugins/MacAU/Biquad2/Biquad2.cpp | 8 +- plugins/MacAU/Biquad2/Biquad2.h | 2 +- plugins/MacAU/BiquadDouble/BiquadDouble.cpp | 10 +- plugins/MacAU/BiquadDouble/BiquadDouble.h | 4 +- plugins/MacAU/BiquadOneHalf/BiquadOneHalf.cpp | 10 +- plugins/MacAU/BiquadOneHalf/BiquadOneHalf.h | 4 +- plugins/MacAU/BiquadPlus/BiquadPlus.cpp | 12 +- plugins/MacAU/BiquadPlus/BiquadPlus.h | 2 +- plugins/MacAU/BiquadStereo/BiquadStereo.cpp | 22 +- plugins/MacAU/BiquadStereo/BiquadStereo.h | 2 +- plugins/MacAU/BiquadTriple/BiquadTriple.cpp | 10 +- plugins/MacAU/BiquadTriple/BiquadTriple.h | 6 +- plugins/MacAU/BitGlitter/BitGlitter.cpp | 6 +- plugins/MacAU/Bite/Bite.cpp | 31 +- plugins/MacAU/BlockParty/BlockParty.cpp | 26 +- plugins/MacAU/BrassRider/BrassRider.cpp | 54 +- .../MacAU/BrightAmbience/BrightAmbience.cpp | 4 +- .../MacAU/BrightAmbience2/BrightAmbience2.cpp | 12 +- .../MacAU/BrightAmbience2/BrightAmbience2.h | 6 +- .../MacAU/BrightAmbience3/BrightAmbience3.cpp | 20 +- .../MacAU/BrightAmbience3/BrightAmbience3.h | 8 +- plugins/MacAU/BuildATPDF/BuildATPDF.cpp | 25 +- plugins/MacAU/BussColors4/BussColors4.cpp | 41 +- plugins/MacAU/BussColors4/BussColors4.h | 2 +- plugins/MacAU/ButterComp/ButterComp.cpp | 41 +- plugins/MacAU/ButterComp/ButterComp.h | 2 +- plugins/MacAU/ButterComp2/ButterComp2.cpp | 52 +- plugins/MacAU/ButterComp2/ButterComp2.h | 16 +- plugins/MacAU/C5RawBuss/C5RawBuss.cpp | 41 +- plugins/MacAU/C5RawBuss/C5RawBuss.h | 2 +- plugins/MacAU/C5RawChannel/C5RawChannel.cpp | 41 +- plugins/MacAU/C5RawChannel/C5RawChannel.h | 2 +- plugins/MacAU/CStrip/CStrip.cpp | 41 +- plugins/MacAU/Calibre/Calibre.cpp | 4 +- plugins/MacAU/Capacitor/Capacitor.cpp | 39 +- plugins/MacAU/Capacitor/Capacitor.h | 2 +- plugins/MacAU/Capacitor2/Capacitor2.cpp | 6 +- plugins/MacAU/Chamber/Chamber.cpp | 4 +- plugins/MacAU/Chamber/Chamber.h | 2 +- plugins/MacAU/Channel4/Channel4.cpp | 29 +- plugins/MacAU/Channel5/Channel5.cpp | 26 +- plugins/MacAU/Channel6/Channel6.cpp | 8 +- plugins/MacAU/Channel6/Channel6.h | 6 +- plugins/MacAU/Channel7/Channel7.cpp | 10 +- plugins/MacAU/Channel7/Channel7.h | 6 +- plugins/MacAU/Channel8/Channel8.cpp | 10 +- plugins/MacAU/Channel8/Channel8.h | 10 +- plugins/MacAU/Channel9/Channel9.cpp | 14 +- plugins/MacAU/Channel9/Channel9.h | 14 +- plugins/MacAU/Chorus/Chorus.cpp | 39 +- plugins/MacAU/Chorus/Chorus.h | 2 +- .../MacAU/ChorusEnsemble/ChorusEnsemble.cpp | 39 +- plugins/MacAU/ChorusEnsemble/ChorusEnsemble.h | 2 +- plugins/MacAU/ChromeOxide/ChromeOxide.cpp | 4 +- plugins/MacAU/Cider/Cider.cpp | 4 +- plugins/MacAU/ClipOnly2/ClipOnly2.cpp | 2 +- plugins/MacAU/Coils/Coils.cpp | 10 +- plugins/MacAU/Coils/Coils.h | 2 +- plugins/MacAU/Coils2/Coils2.cpp | 16 +- plugins/MacAU/Coils2/Coils2.h | 6 +- plugins/MacAU/Cojones/Cojones.cpp | 44 +- plugins/MacAU/Cojones/Cojones.h | 6 +- .../MacAU/Compresaturator/Compresaturator.cpp | 28 +- plugins/MacAU/Console4Buss/Console4Buss.cpp | 43 +- plugins/MacAU/Console4Buss/Console4Buss.h | 2 +- .../MacAU/Console4Channel/Console4Channel.cpp | 43 +- .../MacAU/Console4Channel/Console4Channel.h | 2 +- plugins/MacAU/Console5Buss/Console5Buss.cpp | 41 +- plugins/MacAU/Console5Buss/Console5Buss.h | 2 +- .../MacAU/Console5Channel/Console5Channel.cpp | 41 +- .../MacAU/Console5Channel/Console5Channel.h | 2 +- .../MacAU/Console5DarkCh/Console5DarkCh.cpp | 41 +- plugins/MacAU/Console5DarkCh/Console5DarkCh.h | 2 +- plugins/MacAU/Console6Buss/Console6Buss.cpp | 4 +- .../MacAU/Console6Channel/Console6Channel.cpp | 4 +- plugins/MacAU/Console7Buss/Console7Buss.cpp | 6 +- plugins/MacAU/Console7Buss/Console7Buss.h | 4 +- .../MacAU/Console7Cascade/Console7Cascade.cpp | 6 +- .../MacAU/Console7Cascade/Console7Cascade.h | 10 +- .../MacAU/Console7Channel/Console7Channel.cpp | 6 +- .../MacAU/Console7Channel/Console7Channel.h | 2 +- .../MacAU/Console7Crunch/Console7Crunch.cpp | 6 +- plugins/MacAU/Console7Crunch/Console7Crunch.h | 10 +- .../CrunchyGrooveWear/CrunchyGrooveWear.cpp | 39 +- .../CrunchyGrooveWear/CrunchyGrooveWear.h | 2 +- plugins/MacAU/Crystal/Crystal.cpp | 34 +- plugins/MacAU/Crystal/Crystal.h | 2 +- plugins/MacAU/Dark/Dark.cpp | 4 +- plugins/MacAU/DarkNoise/DarkNoise.cpp | 6 +- plugins/MacAU/DeBess/DeBess.cpp | 4 +- plugins/MacAU/DeBess/DeBess.h | 2 +- plugins/MacAU/DeEss/DeEss.cpp | 39 +- plugins/MacAU/DeEss/DeEss.h | 2 +- plugins/MacAU/DeHiss/DeHiss.cpp | 6 +- plugins/MacAU/DeRez/DeRez.cpp | 45 +- plugins/MacAU/DeRez/DeRez.h | 2 +- plugins/MacAU/DeRez2/DeRez2.cpp | 10 +- plugins/MacAU/Deckwrecka/Deckwrecka.cpp | 2 +- plugins/MacAU/Density/Density.cpp | 37 +- plugins/MacAU/Density/Density.h | 2 +- plugins/MacAU/Density2/Density2.cpp | 18 +- plugins/MacAU/Density2/Density2.h | 18 +- plugins/MacAU/Desk/Desk.cpp | 41 +- plugins/MacAU/Desk/Desk.h | 6 +- plugins/MacAU/Desk4/Desk4.cpp | 41 +- plugins/MacAU/Desk4/Desk4.h | 2 +- plugins/MacAU/DigitalBlack/DigitalBlack.cpp | 10 +- plugins/MacAU/Distance/Distance.cpp | 37 +- plugins/MacAU/Distance/Distance.h | 2 +- plugins/MacAU/Distance2/Distance2.cpp | 36 +- plugins/MacAU/Distance2/Distance2.h | 54 +- .../MacAU/Distance2/Ditherbox/Ditherbox.cpp | 65 +- plugins/MacAU/Distance2/Ditherbox/Ditherbox.h | 70 +- plugins/MacAU/Distortion/Distortion.cpp | 14 +- plugins/MacAU/Distortion/Distortion.h | 4 +- plugins/MacAU/DitherFloat/DitherFloat.cpp | 8 +- .../MacAU/DitherMeDiskers/DitherMeDiskers.h | 2 +- .../MacAU/DitherMeTimbers/DitherMeTimbers.h | 6 +- plugins/MacAU/Ditherbox/Ditherbox.cpp | 65 +- plugins/MacAU/Ditherbox/Ditherbox.h | 70 +- plugins/MacAU/DoublePaul/DoublePaul.cpp | 25 +- plugins/MacAU/Drive/Drive.cpp | 37 +- plugins/MacAU/Drive/Drive.h | 2 +- plugins/MacAU/DrumSlam/DrumSlam.cpp | 51 +- plugins/MacAU/DrumSlam/DrumSlam.h | 2 +- plugins/MacAU/DubCenter/DubCenter.cpp | 16 +- plugins/MacAU/DubCenter/DubCenter.h | 4 +- plugins/MacAU/DubSub/DubSub.cpp | 36 +- plugins/MacAU/DubSub/DubSub.h | 2 +- plugins/MacAU/DustBunny/DustBunny.cpp | 37 +- plugins/MacAU/DustBunny/DustBunny.h | 2 +- plugins/MacAU/Dyno/Dyno.cpp | 8 +- plugins/MacAU/EQ/EQ.cpp | 37 +- plugins/MacAU/EQ/EQ.h | 2 +- plugins/MacAU/EdIsDim/EdIsDim.cpp | 54 +- plugins/MacAU/EdIsDim/EdIsDim.h | 4 +- plugins/MacAU/Elation/Elation.cpp | 4 +- plugins/MacAU/ElectroHat/ElectroHat.cpp | 14 +- plugins/MacAU/Energy/Energy.cpp | 36 +- plugins/MacAU/Energy/Energy.h | 2 +- plugins/MacAU/Energy2/Energy2.cpp | 10 +- plugins/MacAU/Energy2/Energy2.h | 2 +- plugins/MacAU/Ensemble/Ensemble.cpp | 39 +- plugins/MacAU/Ensemble/Ensemble.h | 2 +- plugins/MacAU/EveryTrim/EveryTrim.cpp | 54 +- plugins/MacAU/EveryTrim/EveryTrim.h | 4 +- plugins/MacAU/Facet/Facet.cpp | 4 +- plugins/MacAU/FathomFive/FathomFive.cpp | 29 +- plugins/MacAU/FathomFive/FathomFive.h | 2 +- plugins/MacAU/Floor/Floor.cpp | 36 +- plugins/MacAU/Floor/Floor.h | 2 +- plugins/MacAU/Focus/Focus.cpp | 14 +- plugins/MacAU/Focus/Focus.h | 2 +- plugins/MacAU/Fracture/Fracture.cpp | 37 +- plugins/MacAU/Fracture/Fracture.h | 2 +- plugins/MacAU/FromTape/FromTape.cpp | 40 +- plugins/MacAU/FromTape/FromTape.h | 2 +- plugins/MacAU/Galactic/Galactic.cpp | 4 +- plugins/MacAU/Gatelinked/Gatelinked.cpp | 12 +- plugins/MacAU/Gatelinked/Gatelinked.h | 4 +- plugins/MacAU/Gatelope/Gatelope.cpp | 36 +- plugins/MacAU/Gatelope/Gatelope.h | 2 +- plugins/MacAU/GlitchShifter/GlitchShifter.cpp | 4 +- plugins/MacAU/Golem/Golem.cpp | 50 +- plugins/MacAU/Golem/Golem.h | 4 +- plugins/MacAU/Gringer/Gringer.cpp | 8 +- plugins/MacAU/Gringer/Gringer.h | 4 +- plugins/MacAU/GrooveWear/GrooveWear.cpp | 39 +- plugins/MacAU/GrooveWear/GrooveWear.h | 2 +- .../GuitarConditioner/GuitarConditioner.cpp | 45 +- .../GuitarConditioner/GuitarConditioner.h | 2 +- plugins/MacAU/HardVacuum/HardVacuum.cpp | 39 +- plugins/MacAU/HardVacuum/HardVacuum.h | 2 +- plugins/MacAU/HermeTrim/HermeTrim.cpp | 54 +- plugins/MacAU/HermeTrim/HermeTrim.h | 4 +- plugins/MacAU/Hermepass/Hermepass.cpp | 45 +- plugins/MacAU/Hermepass/Hermepass.h | 2 +- .../MacAU/HighGlossDither/HighGlossDither.cpp | 27 +- plugins/MacAU/HighImpact/HighImpact.cpp | 37 +- plugins/MacAU/Highpass/Highpass.cpp | 37 +- plugins/MacAU/Highpass/Highpass.h | 2 +- plugins/MacAU/Highpass2/Highpass2.cpp | 24 +- plugins/MacAU/Holt/Holt.cpp | 10 +- plugins/MacAU/Holt/Holt.h | 16 +- plugins/MacAU/Hombre/Hombre.cpp | 39 +- plugins/MacAU/Hombre/Hombre.h | 2 +- plugins/MacAU/Hull/Hull.cpp | 20 +- plugins/MacAU/Hull/Hull.h | 4 +- plugins/MacAU/Infinity/Infinity.cpp | 14 +- plugins/MacAU/Infinity/Infinity.h | 6 +- plugins/MacAU/Infinity2/Infinity2.cpp | 14 +- plugins/MacAU/Infinity2/Infinity2.h | 6 +- plugins/MacAU/Infrasonic/Infrasonic.cpp | 6 +- plugins/MacAU/Infrasonic/Infrasonic.h | 10 +- plugins/MacAU/Interstage/Interstage.cpp | 8 +- plugins/MacAU/Interstage/Interstage.h | 2 +- plugins/MacAU/IronOxide5/IronOxide5.cpp | 39 +- plugins/MacAU/IronOxide5/IronOxide5.h | 2 +- .../IronOxideClassic/IronOxideClassic.cpp | 39 +- .../MacAU/IronOxideClassic/IronOxideClassic.h | 2 +- .../IronOxideClassic2/IronOxideClassic2.cpp | 14 +- .../IronOxideClassic2/IronOxideClassic2.h | 4 +- plugins/MacAU/Isolator/Isolator.cpp | 10 +- plugins/MacAU/Isolator/Isolator.h | 6 +- plugins/MacAU/Isolator2/Isolator2.cpp | 2 +- plugins/MacAU/Logical4/Logical4.cpp | 54 +- plugins/MacAU/Logical4/Logical4.h | 4 +- plugins/MacAU/Loud/Loud.cpp | 4 +- plugins/MacAU/Lowpass/Lowpass.cpp | 37 +- plugins/MacAU/Lowpass/Lowpass.h | 2 +- plugins/MacAU/Lowpass2/Lowpass2.cpp | 24 +- plugins/MacAU/Luxor/Luxor.cpp | 4 +- plugins/MacAU/MV/MV.cpp | 22 +- plugins/MacAU/MackEQ/MackEQ.cpp | 14 +- plugins/MacAU/MackEQ/MackEQ.h | 20 +- plugins/MacAU/Mackity/Mackity.cpp | 8 +- plugins/MacAU/Mackity/Mackity.h | 8 +- plugins/MacAU/MatrixVerb/MatrixVerb.cpp | 16 +- plugins/MacAU/MatrixVerb/MatrixVerb.h | 6 +- plugins/MacAU/Melt/Melt.cpp | 41 +- plugins/MacAU/Melt/Melt.h | 2 +- plugins/MacAU/MidSide/MidSide.cpp | 54 +- plugins/MacAU/MidSide/MidSide.h | 4 +- plugins/MacAU/MoNoam/MoNoam.cpp | 10 +- plugins/MacAU/Mojo/Mojo.cpp | 8 +- plugins/MacAU/Monitoring/Monitoring.cpp | 38 +- plugins/MacAU/Monitoring/Monitoring.h | 6 +- plugins/MacAU/Monitoring2/Monitoring2.cpp | 26 +- plugins/MacAU/Monitoring2/Monitoring2.h | 2 +- plugins/MacAU/NCSeventeen/NCSeventeen.cpp | 37 +- plugins/MacAU/NCSeventeen/NCSeventeen.h | 2 +- .../NaturalizeDither/NaturalizeDither.cpp | 27 +- plugins/MacAU/Neverland/Neverland.cpp | 4 +- plugins/MacAU/Nikola/Nikola.cpp | 6 +- plugins/MacAU/NodeDither/NodeDither.cpp | 27 +- plugins/MacAU/Noise/Noise.cpp | 39 +- plugins/MacAU/Noise/Noise.h | 2 +- .../MacAU/NonlinearSpace/NonlinearSpace.cpp | 58 +- .../NotJustAnotherCD/NotJustAnotherCD.cpp | 27 +- .../MacAU/NotJustAnotherCD/NotJustAnotherCD.h | 2 +- .../NotJustAnotherDither.cpp | 14 +- .../NotJustAnotherDither.h | 2 +- plugins/MacAU/OneCornerClip/OneCornerClip.cpp | 41 +- plugins/MacAU/OneCornerClip/OneCornerClip.h | 2 +- plugins/MacAU/PDBuss/PDBuss.cpp | 39 +- plugins/MacAU/PDBuss/PDBuss.h | 2 +- plugins/MacAU/PDChannel/PDChannel.cpp | 41 +- plugins/MacAU/PDChannel/PDChannel.h | 2 +- plugins/MacAU/Pafnuty/Pafnuty.cpp | 88 +- plugins/MacAU/Pafnuty/Pafnuty.h | 2 +- plugins/MacAU/PaulDither/PaulDither.cpp | 4 +- plugins/MacAU/PaulWide/PaulWide.cpp | 10 +- plugins/MacAU/PeaksOnly/PeaksOnly.cpp | 6 +- plugins/MacAU/PhaseNudge/PhaseNudge.cpp | 41 +- plugins/MacAU/PhaseNudge/PhaseNudge.h | 2 +- plugins/MacAU/PitchDelay/PitchDelay.cpp | 8 +- plugins/MacAU/PitchDelay/PitchDelay.h | 4 +- plugins/MacAU/PocketVerbs/PocketVerbs.cpp | 6 +- plugins/MacAU/Podcast/Podcast.cpp | 8 +- plugins/MacAU/PodcastDeluxe/PodcastDeluxe.cpp | 6 +- plugins/MacAU/Point/Poynt.cpp | 39 +- plugins/MacAU/Pop/Pop.cpp | 12 +- plugins/MacAU/Pop/Pop.h | 26 +- plugins/MacAU/PowerSag/PowerSag.cpp | 39 +- plugins/MacAU/PowerSag/PowerSag.h | 2 +- plugins/MacAU/PowerSag2/PowerSag2.cpp | 4 +- plugins/MacAU/Precious/Precious.cpp | 4 +- plugins/MacAU/Preponderant/Preponderant.cpp | 16 +- plugins/MacAU/Preponderant/Preponderant.h | 20 +- plugins/MacAU/Pressure4/Pressure4.cpp | 52 +- plugins/MacAU/Pressure4/Pressure4.h | 4 +- plugins/MacAU/Pressure4Mono/Pressure4Mono.cpp | 41 +- plugins/MacAU/Pressure4Mono/Pressure4Mono.h | 2 +- plugins/MacAU/Pressure5/Pressure5.cpp | 14 +- plugins/MacAU/Pressure5/Pressure5.h | 12 +- plugins/MacAU/PurestAir/PurestAir.cpp | 4 +- plugins/MacAU/PurestAir/PurestAir.h | 12 +- .../PurestConsole2Buss/PurestConsole2Buss.cpp | 6 +- .../PurestConsole2Buss/PurestConsole2Buss.h | 2 +- .../PurestConsole2Channel.cpp | 6 +- .../PurestConsole2Channel.h | 2 +- .../PurestConsoleBuss/PurestConsoleBuss.cpp | 39 +- .../PurestConsoleBuss/PurestConsoleBuss.h | 2 +- .../PurestConsoleChannel.cpp | 39 +- .../PurestConsoleChannel.h | 2 +- plugins/MacAU/PurestDrive/PurestDrive.cpp | 41 +- plugins/MacAU/PurestDrive/PurestDrive.h | 2 +- plugins/MacAU/PurestEcho/PurestEcho.cpp | 39 +- plugins/MacAU/PurestEcho/PurestEcho.h | 2 +- plugins/MacAU/PurestFade/PurestFade.cpp | 12 +- plugins/MacAU/PurestGain/PurestGain.cpp | 31 +- plugins/MacAU/PurestSquish/PurestSquish.cpp | 30 +- plugins/MacAU/PurestWarm/PurestWarm.cpp | 33 +- plugins/MacAU/Pyewacket/Pyewacket.cpp | 58 +- plugins/MacAU/Pyewacket/Pyewacket.h | 4 +- plugins/MacAU/PyewacketMono/PyewacketMono.cpp | 45 +- plugins/MacAU/PyewacketMono/PyewacketMono.h | 2 +- plugins/MacAU/RawGlitters/RawGlitters.cpp | 2 +- plugins/MacAU/RawTimbers/RawTimbers.cpp | 2 +- plugins/MacAU/Recurve/Recurve.cpp | 4 +- plugins/MacAU/Recurve/Recurve.h | 2 +- plugins/MacAU/Remap/Remap.cpp | 10 +- plugins/MacAU/ResEQ/ResEQ.cpp | 6 +- plugins/MacAU/Reverb/Reverb.cpp | 14 +- plugins/MacAU/Reverb/Reverb.h | 6 +- plugins/MacAU/Righteous4/Righteous4.cpp | 37 +- plugins/MacAU/Righteous4/Righteous4.h | 4 +- plugins/MacAU/SideDull/SideDull.cpp | 48 +- plugins/MacAU/SideDull/SideDull.h | 4 +- plugins/MacAU/Sidepass/Sidepass.cpp | 52 +- plugins/MacAU/Sidepass/Sidepass.h | 4 +- .../SingleEndedTriode/SingleEndedTriode.cpp | 40 +- .../SingleEndedTriode/SingleEndedTriode.h | 2 +- plugins/MacAU/Slew/Slew.cpp | 29 +- plugins/MacAU/Slew/Slew.h | 2 +- plugins/MacAU/Slew2/Slew2.cpp | 37 +- plugins/MacAU/Slew2/Slew2.h | 2 +- plugins/MacAU/Slew3/Slew3.cpp | 4 +- plugins/MacAU/SlewOnly/SlewOnly.cpp | 29 +- plugins/MacAU/SlewOnly/SlewOnly.h | 2 +- plugins/MacAU/Smooth/Smooth.cpp | 24 +- plugins/MacAU/SoftGate/SoftGate.cpp | 6 +- plugins/MacAU/SoftGateMono/SoftGateMono.cpp | 6 +- .../SpatializeDither/SpatializeDither.cpp | 4 +- plugins/MacAU/Spiral/Spiral.cpp | 4 +- plugins/MacAU/Spiral2/Spiral2.cpp | 8 +- plugins/MacAU/Spiral2/Spiral2.h | 6 +- plugins/MacAU/Srsly/Srsly.cpp | 48 +- plugins/MacAU/Srsly/Srsly.h | 18 +- plugins/MacAU/Srsly2/Srsly2.cpp | 48 +- plugins/MacAU/Srsly2/Srsly2.h | 18 +- plugins/MacAU/StarChild/StarChild.cpp | 46 +- plugins/MacAU/StarChild/StarChild.h | 4 +- plugins/MacAU/StereoFX/StereoFX.cpp | 54 +- plugins/MacAU/StereoFX/StereoFX.h | 4 +- plugins/MacAU/StudioTan/StudioTan.cpp | 14 +- plugins/MacAU/StudioTan/StudioTan.h | 8 +- plugins/MacAU/SubsOnly/SubsOnly.cpp | 37 +- plugins/MacAU/SubsOnly/SubsOnly.h | 2 +- plugins/MacAU/Surge/Surge.cpp | 54 +- plugins/MacAU/Surge/Surge.h | 14 +- plugins/MacAU/SurgeMono/SurgeMono.cpp | 43 +- plugins/MacAU/SurgeMono/SurgeMono.h | 12 +- plugins/MacAU/SurgeTide/SurgeTide.cpp | 54 +- plugins/MacAU/SurgeTide/SurgeTide.h | 10 +- plugins/MacAU/SurgeTideMono/SurgeTideMono.cpp | 43 +- plugins/MacAU/SurgeTideMono/SurgeTideMono.h | 8 +- plugins/MacAU/Swell/Swell.cpp | 43 +- plugins/MacAU/Swell/Swell.h | 4 +- plugins/MacAU/TPDFDither/TPDFDither.cpp | 4 +- plugins/MacAU/TPDFWide/TPDFWide.cpp | 8 +- plugins/MacAU/Tape/Tape.cpp | 18 +- plugins/MacAU/Tape/Tape.h | 10 +- plugins/MacAU/TapeDelay/TapeDelay.cpp | 34 +- plugins/MacAU/TapeDelay/TapeDelay.h | 2 +- plugins/MacAU/TapeDelay2/TapeDelay2.cpp | 8 +- plugins/MacAU/TapeDelay2/TapeDelay2.h | 4 +- plugins/MacAU/TapeDither/TapeDither.cpp | 4 +- plugins/MacAU/TapeDust/TapeDust.cpp | 39 +- plugins/MacAU/TapeDust/TapeDust.h | 2 +- plugins/MacAU/TapeFat/TapeFat.cpp | 34 +- plugins/MacAU/TapeFat/TapeFat.h | 2 +- plugins/MacAU/Thunder/Thunder.cpp | 50 +- plugins/MacAU/Thunder/Thunder.h | 4 +- plugins/MacAU/ToTape5/ToTape5.cpp | 41 +- plugins/MacAU/ToTape5/ToTape5.h | 2 +- plugins/MacAU/ToTape6/ToTape6.cpp | 24 +- plugins/MacAU/ToTape6/ToTape6.h | 10 +- plugins/MacAU/ToVinyl4/ToVinyl4.cpp | 46 +- plugins/MacAU/ToneSlant/ToneSlant.cpp | 37 +- plugins/MacAU/ToneSlant/ToneSlant.h | 2 +- plugins/MacAU/TransDesk/TransDesk.cpp | 33 +- plugins/MacAU/TransDesk/TransDesk.h | 4 +- plugins/MacAU/TremoSquare/TremoSquare.cpp | 6 +- plugins/MacAU/Tremolo/Tremolo.cpp | 41 +- plugins/MacAU/TripleSpread/TripleSpread.cpp | 12 +- plugins/MacAU/Tube/Tube.cpp | 10 +- plugins/MacAU/Tube/Tube.h | 4 +- plugins/MacAU/Tube2/Tube2.cpp | 16 +- plugins/MacAU/Tube2/Tube2.h | 6 +- plugins/MacAU/TubeDesk/TubeDesk.cpp | 33 +- plugins/MacAU/TubeDesk/TubeDesk.h | 4 +- plugins/MacAU/UltrasonX/UltrasonX.cpp | 8 +- plugins/MacAU/UltrasonX/UltrasonX.h | 2 +- plugins/MacAU/Ultrasonic/Ultrasonic.cpp | 6 +- plugins/MacAU/Ultrasonic/Ultrasonic.h | 10 +- .../MacAU/UltrasonicLite/UltrasonicLite.cpp | 6 +- plugins/MacAU/UltrasonicLite/UltrasonicLite.h | 2 +- plugins/MacAU/UltrasonicMed/UltrasonicMed.cpp | 6 +- plugins/MacAU/UltrasonicMed/UltrasonicMed.h | 4 +- plugins/MacAU/UnBox/UnBox.cpp | 10 +- plugins/MacAU/UnBox/UnBox.h | 14 +- plugins/MacAU/VariMu/VariMu.cpp | 38 +- plugins/MacAU/VariMu/VariMu.h | 2 +- plugins/MacAU/Verbity/Verbity.cpp | 6 +- plugins/MacAU/Vibrato/Vibrato.cpp | 4 +- plugins/MacAU/VinylDither/VinylDither.cpp | 4 +- .../VoiceOfTheStarship/VoiceOfTheStarship.cpp | 12 +- plugins/MacAU/VoiceTrick/VoiceTrick.cpp | 6 +- plugins/MacAU/Wider/Wider.cpp | 54 +- plugins/MacAU/Wider/Wider.h | 4 +- plugins/MacAU/XBandpass/XBandpass.cpp | 10 +- plugins/MacAU/XBandpass/XBandpass.h | 10 +- plugins/MacAU/XHighpass/XHighpass.cpp | 10 +- plugins/MacAU/XHighpass/XHighpass.h | 10 +- plugins/MacAU/XLowpass/XLowpass.cpp | 10 +- plugins/MacAU/XLowpass/XLowpass.h | 10 +- plugins/MacAU/XNotch/XNotch.cpp | 10 +- plugins/MacAU/XNotch/XNotch.h | 10 +- plugins/MacAU/XRegion/XRegion.cpp | 10 +- plugins/MacAU/XRegion/XRegion.h | 10 +- plugins/MacAU/YBandpass/YBandpass.cpp | 14 +- plugins/MacAU/YBandpass/YBandpass.h | 22 +- plugins/MacAU/YHighpass/YHighpass.cpp | 14 +- plugins/MacAU/YHighpass/YHighpass.h | 18 +- plugins/MacAU/YLowpass/YLowpass.cpp | 14 +- plugins/MacAU/YLowpass/YLowpass.h | 22 +- plugins/MacAU/YNotch/YNotch.cpp | 14 +- plugins/MacAU/YNotch/YNotch.h | 18 +- plugins/MacAU/ZBandpass/ZBandpass.cpp | 10 +- plugins/MacAU/ZBandpass/ZBandpass.h | 14 +- plugins/MacAU/ZBandpass2/ZBandpass2.cpp | 26 +- plugins/MacAU/ZBandpass2/ZBandpass2.h | 26 +- plugins/MacAU/ZHighpass/ZHighpass.cpp | 12 +- plugins/MacAU/ZHighpass/ZHighpass.h | 14 +- plugins/MacAU/ZHighpass2/ZHighpass2.cpp | 26 +- plugins/MacAU/ZHighpass2/ZHighpass2.h | 26 +- plugins/MacAU/ZLowpass/ZLowpass.cpp | 10 +- plugins/MacAU/ZLowpass/ZLowpass.h | 14 +- plugins/MacAU/ZLowpass2/ZLowpass2.cpp | 26 +- plugins/MacAU/ZLowpass2/ZLowpass2.h | 26 +- plugins/MacAU/ZNotch/ZNotch.cpp | 10 +- plugins/MacAU/ZNotch/ZNotch.h | 14 +- plugins/MacAU/ZNotch2/ZNotch2.cpp | 26 +- plugins/MacAU/ZNotch2/ZNotch2.h | 26 +- plugins/MacAU/curve/curve.cpp | 4 +- plugins/MacAU/curve/curve.h | 2 +- plugins/MacAU/curvemono/curvemono.cpp | 4 +- plugins/MacAU/curvemono/curvemono.h | 2 +- plugins/MacAU/uLawDecode/uLawDecode.cpp | 36 +- plugins/MacAU/uLawDecode/uLawDecode.h | 2 +- plugins/MacAU/uLawEncode/uLawEncode.cpp | 36 +- plugins/MacAU/uLawEncode/uLawEncode.h | 2 +- plugins/MacSignedAU/ADClip7/ADClip7.cpp | 41 +- plugins/MacSignedAU/ADClip7/ADClip7.h | 6 +- plugins/MacSignedAU/ADT/ADT.cpp | 4 +- .../AQuickVoiceClip/AQuickVoiceClip.cpp | 37 +- .../MacSignedAU/Acceleration/Acceleration.cpp | 42 +- .../MacSignedAU/Acceleration/Acceleration.h | 2 +- .../Acceleration2/Acceleration2.cpp | 8 +- .../MacSignedAU/Acceleration2/Acceleration2.h | 4 +- plugins/MacSignedAU/Air/Air.cpp | 31 +- plugins/MacSignedAU/Air/Air.h | 2 +- plugins/MacSignedAU/Air2/Air2.cpp | 10 +- plugins/MacSignedAU/Air2/Air2.h | 2 +- plugins/MacSignedAU/Apicolypse/Apicolypse.cpp | 4 +- .../AtmosphereBuss/AtmosphereBuss.cpp | 37 +- .../AtmosphereBuss/AtmosphereBuss.h | 54 +- .../AtmosphereChannel/AtmosphereChannel.cpp | 38 +- .../AtmosphereChannel/AtmosphereChannel.h | 54 +- plugins/MacSignedAU/Aura/Aura.cpp | 39 +- plugins/MacSignedAU/Aura/Aura.h | 4 +- plugins/MacSignedAU/AutoPan/AutoPan.cpp | 14 +- plugins/MacSignedAU/AverMatrix/AverMatrix.cpp | 8 +- plugins/MacSignedAU/Average/Average.cpp | 37 +- plugins/MacSignedAU/BassAmp/BassAmp.cpp | 6 +- plugins/MacSignedAU/BassDrive/BassDrive.cpp | 4 +- plugins/MacSignedAU/BassKit/BassKit.cpp | 12 +- plugins/MacSignedAU/BassKit/BassKit.h | 4 +- plugins/MacSignedAU/Baxandall/Baxandall.cpp | 8 +- plugins/MacSignedAU/Baxandall/Baxandall.h | 8 +- plugins/MacSignedAU/Beam/Beam.cpp | 4 +- plugins/MacSignedAU/Biquad/Biquad.cpp | 10 +- plugins/MacSignedAU/Biquad/Biquad.h | 2 +- plugins/MacSignedAU/Biquad2/Biquad2.cpp | 8 +- plugins/MacSignedAU/Biquad2/Biquad2.h | 2 +- .../MacSignedAU/BiquadDouble/BiquadDouble.cpp | 10 +- .../MacSignedAU/BiquadDouble/BiquadDouble.h | 4 +- .../BiquadOneHalf/BiquadOneHalf.cpp | 10 +- .../MacSignedAU/BiquadOneHalf/BiquadOneHalf.h | 4 +- plugins/MacSignedAU/BiquadPlus/BiquadPlus.cpp | 12 +- plugins/MacSignedAU/BiquadPlus/BiquadPlus.h | 2 +- .../MacSignedAU/BiquadStereo/BiquadStereo.cpp | 22 +- .../MacSignedAU/BiquadStereo/BiquadStereo.h | 2 +- .../MacSignedAU/BiquadTriple/BiquadTriple.cpp | 10 +- .../MacSignedAU/BiquadTriple/BiquadTriple.h | 6 +- plugins/MacSignedAU/BitGlitter/BitGlitter.cpp | 6 +- plugins/MacSignedAU/Bite/Bite.cpp | 31 +- plugins/MacSignedAU/BlockParty/BlockParty.cpp | 26 +- plugins/MacSignedAU/BrassRider/BrassRider.cpp | 54 +- .../BrightAmbience/BrightAmbience.cpp | 4 +- .../BrightAmbience2/BrightAmbience2.cpp | 12 +- .../BrightAmbience2/BrightAmbience2.h | 6 +- .../BrightAmbience3/BrightAmbience3.cpp | 20 +- .../BrightAmbience3/BrightAmbience3.h | 8 +- plugins/MacSignedAU/BuildATPDF/BuildATPDF.cpp | 25 +- .../MacSignedAU/BussColors4/BussColors4.cpp | 41 +- plugins/MacSignedAU/BussColors4/BussColors4.h | 2 +- plugins/MacSignedAU/ButterComp/ButterComp.cpp | 41 +- plugins/MacSignedAU/ButterComp/ButterComp.h | 2 +- .../MacSignedAU/ButterComp2/ButterComp2.cpp | 52 +- plugins/MacSignedAU/ButterComp2/ButterComp2.h | 16 +- plugins/MacSignedAU/C5RawBuss/C5RawBuss.cpp | 41 +- plugins/MacSignedAU/C5RawBuss/C5RawBuss.h | 2 +- .../MacSignedAU/C5RawChannel/C5RawChannel.cpp | 41 +- .../MacSignedAU/C5RawChannel/C5RawChannel.h | 2 +- plugins/MacSignedAU/CStrip/CStrip.cpp | 41 +- plugins/MacSignedAU/Cabs/Cabs.cpp | 1010 ++++++ plugins/MacSignedAU/Cabs/Cabs.exp | 1 + plugins/MacSignedAU/Cabs/Cabs.h | 203 ++ plugins/MacSignedAU/Cabs/Cabs.r | 61 + .../Cabs.xcodeproj/christopherjohnson.mode1v3 | 1367 ++++++++ .../Cabs.xcodeproj/christopherjohnson.pbxuser | 137 + .../christopherjohnson.perspectivev3 | 1505 +++++++++ .../Cabs/Cabs.xcodeproj/project.pbxproj | 490 +++ plugins/MacSignedAU/Cabs/CabsVersion.h | 68 + plugins/MacSignedAU/Cabs/Cabs_Prefix.pch | 5 + .../Cabs/English.lproj/InfoPlist.strings | Bin 0 -> 360 bytes plugins/MacSignedAU/Cabs/Info.plist | 28 + plugins/MacSignedAU/Cabs/version.plist | 16 + plugins/MacSignedAU/Calibre/Calibre.cpp | 4 +- plugins/MacSignedAU/Capacitor/Capacitor.cpp | 39 +- plugins/MacSignedAU/Capacitor/Capacitor.h | 2 +- plugins/MacSignedAU/Capacitor2/Capacitor2.cpp | 6 +- plugins/MacSignedAU/Chamber/Chamber.cpp | 4 +- plugins/MacSignedAU/Chamber/Chamber.h | 2 +- plugins/MacSignedAU/Channel4/Channel4.cpp | 29 +- plugins/MacSignedAU/Channel5/Channel5.cpp | 26 +- plugins/MacSignedAU/Channel6/Channel6.cpp | 8 +- plugins/MacSignedAU/Channel6/Channel6.h | 6 +- plugins/MacSignedAU/Channel7/Channel7.cpp | 10 +- plugins/MacSignedAU/Channel7/Channel7.h | 6 +- plugins/MacSignedAU/Channel8/Channel8.cpp | 10 +- plugins/MacSignedAU/Channel8/Channel8.h | 10 +- plugins/MacSignedAU/Channel9/Channel9.cpp | 14 +- plugins/MacSignedAU/Channel9/Channel9.h | 14 +- plugins/MacSignedAU/Chorus/Chorus.cpp | 39 +- plugins/MacSignedAU/Chorus/Chorus.h | 2 +- .../ChorusEnsemble/ChorusEnsemble.cpp | 39 +- .../ChorusEnsemble/ChorusEnsemble.h | 2 +- .../MacSignedAU/ChromeOxide/ChromeOxide.cpp | 4 +- plugins/MacSignedAU/Cider/Cider.cpp | 4 +- plugins/MacSignedAU/ClipOnly2/ClipOnly2.cpp | 2 +- plugins/MacSignedAU/Coils/Coils.cpp | 10 +- plugins/MacSignedAU/Coils/Coils.h | 2 +- plugins/MacSignedAU/Coils2/Coils2.cpp | 16 +- plugins/MacSignedAU/Coils2/Coils2.h | 6 +- plugins/MacSignedAU/Cojones/Cojones.cpp | 44 +- plugins/MacSignedAU/Cojones/Cojones.h | 6 +- .../Compresaturator/Compresaturator.cpp | 28 +- .../MacSignedAU/Console4Buss/Console4Buss.cpp | 43 +- .../MacSignedAU/Console4Buss/Console4Buss.h | 2 +- .../Console4Channel/Console4Channel.cpp | 43 +- .../Console4Channel/Console4Channel.h | 2 +- .../MacSignedAU/Console5Buss/Console5Buss.cpp | 41 +- .../MacSignedAU/Console5Buss/Console5Buss.h | 2 +- .../Console5Channel/Console5Channel.cpp | 41 +- .../Console5Channel/Console5Channel.h | 2 +- .../Console5DarkCh/Console5DarkCh.cpp | 41 +- .../Console5DarkCh/Console5DarkCh.h | 2 +- .../MacSignedAU/Console6Buss/Console6Buss.cpp | 4 +- .../Console6Channel/Console6Channel.cpp | 4 +- .../MacSignedAU/Console7Buss/Console7Buss.cpp | 6 +- .../MacSignedAU/Console7Buss/Console7Buss.h | 4 +- .../Console7Cascade/Console7Cascade.cpp | 6 +- .../Console7Cascade/Console7Cascade.h | 10 +- .../Console7Channel/Console7Channel.cpp | 6 +- .../Console7Channel/Console7Channel.h | 2 +- .../Console7Crunch/Console7Crunch.cpp | 6 +- .../Console7Crunch/Console7Crunch.h | 10 +- .../CrunchyGrooveWear/CrunchyGrooveWear.cpp | 39 +- .../CrunchyGrooveWear/CrunchyGrooveWear.h | 2 +- plugins/MacSignedAU/Crystal/Crystal.cpp | 34 +- plugins/MacSignedAU/Crystal/Crystal.h | 2 +- plugins/MacSignedAU/Dark/Dark.cpp | 4 +- plugins/MacSignedAU/DarkNoise/DarkNoise.cpp | 6 +- plugins/MacSignedAU/DeBess/DeBess.cpp | 4 +- plugins/MacSignedAU/DeBess/DeBess.h | 2 +- plugins/MacSignedAU/DeEss/DeEss.cpp | 39 +- plugins/MacSignedAU/DeEss/DeEss.h | 2 +- plugins/MacSignedAU/DeHiss/DeHiss.cpp | 6 +- plugins/MacSignedAU/DeRez/DeRez.cpp | 45 +- plugins/MacSignedAU/DeRez/DeRez.h | 2 +- plugins/MacSignedAU/DeRez2/DeRez2.cpp | 10 +- plugins/MacSignedAU/Deckwrecka/Deckwrecka.cpp | 2 +- plugins/MacSignedAU/Density/Density.cpp | 37 +- plugins/MacSignedAU/Density/Density.h | 2 +- plugins/MacSignedAU/Density2/Density2.cpp | 18 +- plugins/MacSignedAU/Density2/Density2.h | 18 +- plugins/MacSignedAU/Desk/Desk.cpp | 41 +- plugins/MacSignedAU/Desk/Desk.h | 6 +- plugins/MacSignedAU/Desk4/Desk4.cpp | 41 +- plugins/MacSignedAU/Desk4/Desk4.h | 2 +- .../MacSignedAU/DigitalBlack/DigitalBlack.cpp | 10 +- plugins/MacSignedAU/Distance/Distance.cpp | 37 +- plugins/MacSignedAU/Distance/Distance.h | 2 +- plugins/MacSignedAU/Distance2/Distance2.cpp | 36 +- plugins/MacSignedAU/Distance2/Distance2.h | 54 +- .../Distance2/Ditherbox/Ditherbox.cpp | 65 +- .../Distance2/Ditherbox/Ditherbox.h | 70 +- plugins/MacSignedAU/Distortion/Distortion.cpp | 14 +- plugins/MacSignedAU/Distortion/Distortion.h | 4 +- .../MacSignedAU/DitherFloat/DitherFloat.cpp | 8 +- .../DitherMeDiskers/DitherMeDiskers.h | 2 +- .../DitherMeTimbers/DitherMeTimbers.h | 6 +- plugins/MacSignedAU/Ditherbox/Ditherbox.cpp | 65 +- plugins/MacSignedAU/Ditherbox/Ditherbox.h | 70 +- plugins/MacSignedAU/DoublePaul/DoublePaul.cpp | 25 +- plugins/MacSignedAU/Drive/Drive.cpp | 37 +- plugins/MacSignedAU/Drive/Drive.h | 2 +- plugins/MacSignedAU/DrumSlam/DrumSlam.cpp | 51 +- plugins/MacSignedAU/DrumSlam/DrumSlam.h | 2 +- plugins/MacSignedAU/DubCenter/DubCenter.cpp | 16 +- plugins/MacSignedAU/DubCenter/DubCenter.h | 4 +- plugins/MacSignedAU/DubSub/DubSub.cpp | 36 +- plugins/MacSignedAU/DubSub/DubSub.h | 2 +- plugins/MacSignedAU/DustBunny/DustBunny.cpp | 37 +- plugins/MacSignedAU/DustBunny/DustBunny.h | 2 +- plugins/MacSignedAU/Dyno/Dyno.cpp | 8 +- plugins/MacSignedAU/EQ/EQ.cpp | 37 +- plugins/MacSignedAU/EQ/EQ.h | 2 +- plugins/MacSignedAU/EdIsDim/EdIsDim.cpp | 54 +- plugins/MacSignedAU/EdIsDim/EdIsDim.h | 4 +- plugins/MacSignedAU/Elation/Elation.cpp | 4 +- plugins/MacSignedAU/ElectroHat/ElectroHat.cpp | 14 +- plugins/MacSignedAU/Energy/Energy.cpp | 36 +- plugins/MacSignedAU/Energy/Energy.h | 2 +- plugins/MacSignedAU/Energy2/Energy2.cpp | 10 +- plugins/MacSignedAU/Energy2/Energy2.h | 2 +- plugins/MacSignedAU/Ensemble/Ensemble.cpp | 39 +- plugins/MacSignedAU/Ensemble/Ensemble.h | 2 +- plugins/MacSignedAU/EveryTrim/EveryTrim.cpp | 54 +- plugins/MacSignedAU/EveryTrim/EveryTrim.h | 4 +- plugins/MacSignedAU/Facet/Facet.cpp | 4 +- plugins/MacSignedAU/FathomFive/FathomFive.cpp | 29 +- plugins/MacSignedAU/FathomFive/FathomFive.h | 2 +- plugins/MacSignedAU/Floor/Floor.cpp | 36 +- plugins/MacSignedAU/Floor/Floor.h | 2 +- plugins/MacSignedAU/Focus/Focus.cpp | 14 +- plugins/MacSignedAU/Focus/Focus.h | 2 +- plugins/MacSignedAU/Fracture/Fracture.cpp | 37 +- plugins/MacSignedAU/Fracture/Fracture.h | 2 +- plugins/MacSignedAU/FromTape/FromTape.cpp | 40 +- plugins/MacSignedAU/FromTape/FromTape.h | 2 +- plugins/MacSignedAU/Galactic/Galactic.cpp | 4 +- plugins/MacSignedAU/Gatelinked/Gatelinked.cpp | 12 +- plugins/MacSignedAU/Gatelinked/Gatelinked.h | 4 +- plugins/MacSignedAU/Gatelope/Gatelope.cpp | 36 +- plugins/MacSignedAU/Gatelope/Gatelope.h | 2 +- .../GlitchShifter/GlitchShifter.cpp | 4 +- plugins/MacSignedAU/Golem/Golem.cpp | 50 +- plugins/MacSignedAU/Golem/Golem.h | 4 +- plugins/MacSignedAU/Gringer/Gringer.cpp | 8 +- plugins/MacSignedAU/Gringer/Gringer.h | 4 +- plugins/MacSignedAU/GrooveWear/GrooveWear.cpp | 39 +- plugins/MacSignedAU/GrooveWear/GrooveWear.h | 2 +- .../GuitarConditioner/GuitarConditioner.cpp | 45 +- .../GuitarConditioner/GuitarConditioner.h | 2 +- plugins/MacSignedAU/HardVacuum/HardVacuum.cpp | 39 +- plugins/MacSignedAU/HardVacuum/HardVacuum.h | 2 +- plugins/MacSignedAU/HermeTrim/HermeTrim.cpp | 54 +- plugins/MacSignedAU/HermeTrim/HermeTrim.h | 4 +- plugins/MacSignedAU/Hermepass/Hermepass.cpp | 45 +- plugins/MacSignedAU/Hermepass/Hermepass.h | 2 +- .../HighGlossDither/HighGlossDither.cpp | 27 +- plugins/MacSignedAU/HighImpact/HighImpact.cpp | 37 +- plugins/MacSignedAU/Highpass/Highpass.cpp | 37 +- plugins/MacSignedAU/Highpass/Highpass.h | 2 +- plugins/MacSignedAU/Highpass2/Highpass2.cpp | 24 +- plugins/MacSignedAU/Holt/Holt.cpp | 10 +- plugins/MacSignedAU/Holt/Holt.h | 16 +- plugins/MacSignedAU/Hombre/Hombre.cpp | 39 +- plugins/MacSignedAU/Hombre/Hombre.h | 2 +- plugins/MacSignedAU/Hull/Hull.cpp | 20 +- plugins/MacSignedAU/Hull/Hull.h | 4 +- plugins/MacSignedAU/Infinity/Infinity.cpp | 14 +- plugins/MacSignedAU/Infinity/Infinity.h | 6 +- plugins/MacSignedAU/Infinity2/Infinity2.cpp | 14 +- plugins/MacSignedAU/Infinity2/Infinity2.h | 6 +- plugins/MacSignedAU/Infrasonic/Infrasonic.cpp | 6 +- plugins/MacSignedAU/Infrasonic/Infrasonic.h | 10 +- plugins/MacSignedAU/Interstage/Interstage.cpp | 8 +- plugins/MacSignedAU/Interstage/Interstage.h | 2 +- plugins/MacSignedAU/IronOxide5/IronOxide5.cpp | 39 +- plugins/MacSignedAU/IronOxide5/IronOxide5.h | 2 +- .../IronOxideClassic/IronOxideClassic.cpp | 39 +- .../IronOxideClassic/IronOxideClassic.h | 2 +- .../IronOxideClassic2/IronOxideClassic2.cpp | 14 +- .../IronOxideClassic2/IronOxideClassic2.h | 4 +- plugins/MacSignedAU/Isolator/Isolator.cpp | 10 +- plugins/MacSignedAU/Isolator/Isolator.h | 6 +- .../Isolator2/English.lproj/InfoPlist.strings | Bin 0 -> 380 bytes plugins/MacSignedAU/Isolator2/Info.plist | 28 + plugins/MacSignedAU/Isolator2/Isolator2.cpp | 441 +++ plugins/MacSignedAU/Isolator2/Isolator2.exp | 1 + plugins/MacSignedAU/Isolator2/Isolator2.h | 179 ++ plugins/MacSignedAU/Isolator2/Isolator2.r | 61 + .../christopherjohnson.mode1v3 | 1358 ++++++++ .../christopherjohnson.pbxuser | 131 + .../christopherjohnson.perspectivev3 | 1506 +++++++++ .../Isolator2.xcodeproj/project.pbxproj | 490 +++ .../MacSignedAU/Isolator2/Isolator2Version.h | 58 + plugins/MacSignedAU/Isolator2/version.plist | 16 + plugins/MacSignedAU/Logical4/Logical4.cpp | 54 +- plugins/MacSignedAU/Logical4/Logical4.h | 4 +- plugins/MacSignedAU/Loud/Loud.cpp | 4 +- plugins/MacSignedAU/Lowpass/Lowpass.cpp | 37 +- plugins/MacSignedAU/Lowpass/Lowpass.h | 2 +- plugins/MacSignedAU/Lowpass2/Lowpass2.cpp | 24 +- plugins/MacSignedAU/Luxor/Luxor.cpp | 4 +- plugins/MacSignedAU/MV/MV.cpp | 22 +- plugins/MacSignedAU/MackEQ/MackEQ.cpp | 14 +- plugins/MacSignedAU/MackEQ/MackEQ.h | 20 +- plugins/MacSignedAU/Mackity/Mackity.cpp | 8 +- plugins/MacSignedAU/Mackity/Mackity.h | 8 +- plugins/MacSignedAU/MatrixVerb/MatrixVerb.cpp | 16 +- plugins/MacSignedAU/MatrixVerb/MatrixVerb.h | 6 +- plugins/MacSignedAU/Melt/Melt.cpp | 41 +- plugins/MacSignedAU/Melt/Melt.h | 2 +- plugins/MacSignedAU/MidSide/MidSide.cpp | 54 +- plugins/MacSignedAU/MidSide/MidSide.h | 4 +- plugins/MacSignedAU/MoNoam/MoNoam.cpp | 10 +- plugins/MacSignedAU/Mojo/Mojo.cpp | 8 +- plugins/MacSignedAU/Monitoring/Monitoring.cpp | 38 +- plugins/MacSignedAU/Monitoring/Monitoring.h | 6 +- .../MacSignedAU/Monitoring2/Monitoring2.cpp | 26 +- plugins/MacSignedAU/Monitoring2/Monitoring2.h | 2 +- .../MacSignedAU/NCSeventeen/NCSeventeen.cpp | 37 +- plugins/MacSignedAU/NCSeventeen/NCSeventeen.h | 2 +- .../NaturalizeDither/NaturalizeDither.cpp | 27 +- plugins/MacSignedAU/Neverland/Neverland.cpp | 4 +- plugins/MacSignedAU/Nikola/Nikola.cpp | 6 +- plugins/MacSignedAU/NodeDither/NodeDither.cpp | 27 +- plugins/MacSignedAU/Noise/Noise.cpp | 39 +- plugins/MacSignedAU/Noise/Noise.h | 2 +- .../NonlinearSpace/NonlinearSpace.cpp | 58 +- .../NotJustAnotherCD/NotJustAnotherCD.cpp | 27 +- .../NotJustAnotherCD/NotJustAnotherCD.h | 2 +- .../NotJustAnotherDither.cpp | 14 +- .../NotJustAnotherDither.h | 2 +- .../OneCornerClip/OneCornerClip.cpp | 41 +- .../MacSignedAU/OneCornerClip/OneCornerClip.h | 2 +- plugins/MacSignedAU/PDBuss/PDBuss.cpp | 39 +- plugins/MacSignedAU/PDBuss/PDBuss.h | 2 +- plugins/MacSignedAU/PDChannel/PDChannel.cpp | 41 +- plugins/MacSignedAU/PDChannel/PDChannel.h | 2 +- plugins/MacSignedAU/Pafnuty/Pafnuty.cpp | 88 +- plugins/MacSignedAU/Pafnuty/Pafnuty.h | 2 +- plugins/MacSignedAU/PaulDither/PaulDither.cpp | 4 +- plugins/MacSignedAU/PaulWide/PaulWide.cpp | 10 +- plugins/MacSignedAU/PeaksOnly/PeaksOnly.cpp | 6 +- plugins/MacSignedAU/PhaseNudge/PhaseNudge.cpp | 41 +- plugins/MacSignedAU/PhaseNudge/PhaseNudge.h | 2 +- plugins/MacSignedAU/PitchDelay/PitchDelay.cpp | 8 +- plugins/MacSignedAU/PitchDelay/PitchDelay.h | 4 +- .../MacSignedAU/PocketVerbs/PocketVerbs.cpp | 6 +- plugins/MacSignedAU/Podcast/Podcast.cpp | 8 +- .../PodcastDeluxe/PodcastDeluxe.cpp | 6 +- plugins/MacSignedAU/Point/Poynt.cpp | 39 +- plugins/MacSignedAU/Pop/Pop.cpp | 12 +- plugins/MacSignedAU/Pop/Pop.h | 26 +- plugins/MacSignedAU/PowerSag/PowerSag.cpp | 39 +- plugins/MacSignedAU/PowerSag/PowerSag.h | 2 +- plugins/MacSignedAU/PowerSag2/PowerSag2.cpp | 4 +- plugins/MacSignedAU/Precious/Precious.cpp | 4 +- .../MacSignedAU/Preponderant/Preponderant.cpp | 16 +- .../MacSignedAU/Preponderant/Preponderant.h | 20 +- plugins/MacSignedAU/Pressure4/Pressure4.cpp | 52 +- plugins/MacSignedAU/Pressure4/Pressure4.h | 4 +- .../Pressure4Mono/Pressure4Mono.cpp | 41 +- .../MacSignedAU/Pressure4Mono/Pressure4Mono.h | 2 +- plugins/MacSignedAU/Pressure5/Pressure5.cpp | 14 +- plugins/MacSignedAU/Pressure5/Pressure5.h | 12 +- plugins/MacSignedAU/PurestAir/PurestAir.cpp | 4 +- plugins/MacSignedAU/PurestAir/PurestAir.h | 12 +- .../PurestConsole2Buss/PurestConsole2Buss.cpp | 6 +- .../PurestConsole2Buss/PurestConsole2Buss.h | 2 +- .../PurestConsole2Channel.cpp | 6 +- .../PurestConsole2Channel.h | 2 +- .../PurestConsoleBuss/PurestConsoleBuss.cpp | 39 +- .../PurestConsoleBuss/PurestConsoleBuss.h | 2 +- .../PurestConsoleChannel.cpp | 39 +- .../PurestConsoleChannel.h | 2 +- .../MacSignedAU/PurestDrive/PurestDrive.cpp | 41 +- plugins/MacSignedAU/PurestDrive/PurestDrive.h | 2 +- plugins/MacSignedAU/PurestEcho/PurestEcho.cpp | 39 +- plugins/MacSignedAU/PurestEcho/PurestEcho.h | 2 +- plugins/MacSignedAU/PurestFade/PurestFade.cpp | 12 +- plugins/MacSignedAU/PurestGain/PurestGain.cpp | 31 +- .../MacSignedAU/PurestSquish/PurestSquish.cpp | 30 +- plugins/MacSignedAU/PurestWarm/PurestWarm.cpp | 33 +- plugins/MacSignedAU/Pyewacket/Pyewacket.cpp | 58 +- plugins/MacSignedAU/Pyewacket/Pyewacket.h | 4 +- .../PyewacketMono/PyewacketMono.cpp | 45 +- .../MacSignedAU/PyewacketMono/PyewacketMono.h | 2 +- .../MacSignedAU/RawGlitters/RawGlitters.cpp | 2 +- plugins/MacSignedAU/RawTimbers/RawTimbers.cpp | 2 +- plugins/MacSignedAU/Recurve/Recurve.cpp | 4 +- plugins/MacSignedAU/Recurve/Recurve.h | 2 +- plugins/MacSignedAU/Remap/Remap.cpp | 10 +- plugins/MacSignedAU/ResEQ/ResEQ.cpp | 6 +- plugins/MacSignedAU/Reverb/Reverb.cpp | 14 +- plugins/MacSignedAU/Reverb/Reverb.h | 6 +- plugins/MacSignedAU/Righteous4/Righteous4.cpp | 37 +- plugins/MacSignedAU/Righteous4/Righteous4.h | 4 +- plugins/MacSignedAU/SideDull/SideDull.cpp | 48 +- plugins/MacSignedAU/SideDull/SideDull.h | 4 +- plugins/MacSignedAU/Sidepass/Sidepass.cpp | 52 +- plugins/MacSignedAU/Sidepass/Sidepass.h | 4 +- .../SingleEndedTriode/SingleEndedTriode.cpp | 40 +- .../SingleEndedTriode/SingleEndedTriode.h | 2 +- plugins/MacSignedAU/Slew/Slew.cpp | 29 +- plugins/MacSignedAU/Slew/Slew.h | 2 +- plugins/MacSignedAU/Slew2/Slew2.cpp | 37 +- plugins/MacSignedAU/Slew2/Slew2.h | 2 +- plugins/MacSignedAU/Slew3/Slew3.cpp | 4 +- plugins/MacSignedAU/SlewOnly/SlewOnly.cpp | 29 +- plugins/MacSignedAU/SlewOnly/SlewOnly.h | 2 +- plugins/MacSignedAU/Smooth/Smooth.cpp | 24 +- plugins/MacSignedAU/SoftGate/SoftGate.cpp | 6 +- .../MacSignedAU/SoftGateMono/SoftGateMono.cpp | 6 +- .../SpatializeDither/SpatializeDither.cpp | 4 +- plugins/MacSignedAU/Spiral/Spiral.cpp | 4 +- plugins/MacSignedAU/Spiral2/Spiral2.cpp | 8 +- plugins/MacSignedAU/Spiral2/Spiral2.h | 6 +- plugins/MacSignedAU/Srsly/Srsly.cpp | 52 +- plugins/MacSignedAU/Srsly/Srsly.h | 18 +- plugins/MacSignedAU/Srsly2/Srsly2.cpp | 48 +- plugins/MacSignedAU/Srsly2/Srsly2.h | 18 +- plugins/MacSignedAU/StarChild/StarChild.cpp | 46 +- plugins/MacSignedAU/StarChild/StarChild.h | 4 +- plugins/MacSignedAU/StereoFX/StereoFX.cpp | 54 +- plugins/MacSignedAU/StereoFX/StereoFX.h | 4 +- plugins/MacSignedAU/StudioTan/StudioTan.cpp | 14 +- plugins/MacSignedAU/StudioTan/StudioTan.h | 8 +- plugins/MacSignedAU/SubsOnly/SubsOnly.cpp | 37 +- plugins/MacSignedAU/SubsOnly/SubsOnly.h | 2 +- plugins/MacSignedAU/Surge/Surge.cpp | 54 +- plugins/MacSignedAU/Surge/Surge.h | 14 +- plugins/MacSignedAU/SurgeMono/SurgeMono.cpp | 43 +- plugins/MacSignedAU/SurgeMono/SurgeMono.h | 12 +- plugins/MacSignedAU/SurgeTide/SurgeTide.cpp | 54 +- plugins/MacSignedAU/SurgeTide/SurgeTide.h | 10 +- .../SurgeTideMono/SurgeTideMono.cpp | 43 +- .../MacSignedAU/SurgeTideMono/SurgeTideMono.h | 8 +- plugins/MacSignedAU/Swell/Swell.cpp | 43 +- plugins/MacSignedAU/Swell/Swell.h | 4 +- plugins/MacSignedAU/TPDFDither/TPDFDither.cpp | 4 +- plugins/MacSignedAU/TPDFWide/TPDFWide.cpp | 8 +- plugins/MacSignedAU/Tape/Tape.cpp | 18 +- plugins/MacSignedAU/Tape/Tape.h | 10 +- plugins/MacSignedAU/TapeDelay/TapeDelay.cpp | 34 +- plugins/MacSignedAU/TapeDelay/TapeDelay.h | 2 +- plugins/MacSignedAU/TapeDelay2/TapeDelay2.cpp | 8 +- plugins/MacSignedAU/TapeDelay2/TapeDelay2.h | 4 +- plugins/MacSignedAU/TapeDither/TapeDither.cpp | 4 +- plugins/MacSignedAU/TapeDust/TapeDust.cpp | 39 +- plugins/MacSignedAU/TapeDust/TapeDust.h | 2 +- plugins/MacSignedAU/TapeFat/TapeFat.cpp | 34 +- plugins/MacSignedAU/TapeFat/TapeFat.h | 2 +- plugins/MacSignedAU/Thunder/Thunder.cpp | 50 +- plugins/MacSignedAU/Thunder/Thunder.h | 4 +- plugins/MacSignedAU/ToTape5/ToTape5.cpp | 41 +- plugins/MacSignedAU/ToTape5/ToTape5.h | 2 +- plugins/MacSignedAU/ToTape6/ToTape6.cpp | 24 +- plugins/MacSignedAU/ToTape6/ToTape6.h | 10 +- plugins/MacSignedAU/ToVinyl4/ToVinyl4.cpp | 46 +- plugins/MacSignedAU/ToneSlant/ToneSlant.cpp | 37 +- plugins/MacSignedAU/ToneSlant/ToneSlant.h | 2 +- plugins/MacSignedAU/TransDesk/TransDesk.cpp | 33 +- plugins/MacSignedAU/TransDesk/TransDesk.h | 4 +- .../MacSignedAU/TremoSquare/TremoSquare.cpp | 6 +- plugins/MacSignedAU/Tremolo/Tremolo.cpp | 41 +- .../MacSignedAU/TripleSpread/TripleSpread.cpp | 12 +- plugins/MacSignedAU/Tube/Tube.cpp | 10 +- plugins/MacSignedAU/Tube/Tube.h | 4 +- plugins/MacSignedAU/Tube2/Tube2.cpp | 16 +- plugins/MacSignedAU/Tube2/Tube2.h | 6 +- plugins/MacSignedAU/TubeDesk/TubeDesk.cpp | 33 +- plugins/MacSignedAU/TubeDesk/TubeDesk.h | 4 +- plugins/MacSignedAU/UltrasonX/UltrasonX.cpp | 8 +- plugins/MacSignedAU/UltrasonX/UltrasonX.h | 2 +- plugins/MacSignedAU/Ultrasonic/Ultrasonic.cpp | 6 +- plugins/MacSignedAU/Ultrasonic/Ultrasonic.h | 10 +- .../UltrasonicLite/UltrasonicLite.cpp | 6 +- .../UltrasonicLite/UltrasonicLite.h | 2 +- .../UltrasonicMed/UltrasonicMed.cpp | 6 +- .../MacSignedAU/UltrasonicMed/UltrasonicMed.h | 4 +- plugins/MacSignedAU/UnBox/UnBox.cpp | 10 +- plugins/MacSignedAU/UnBox/UnBox.h | 14 +- plugins/MacSignedAU/VariMu/VariMu.cpp | 38 +- plugins/MacSignedAU/VariMu/VariMu.h | 2 +- plugins/MacSignedAU/Verbity/Verbity.cpp | 6 +- plugins/MacSignedAU/Vibrato/Vibrato.cpp | 4 +- .../MacSignedAU/VinylDither/VinylDither.cpp | 4 +- .../VoiceOfTheStarship/VoiceOfTheStarship.cpp | 12 +- plugins/MacSignedAU/VoiceTrick/VoiceTrick.cpp | 6 +- plugins/MacSignedAU/Wider/Wider.cpp | 54 +- plugins/MacSignedAU/Wider/Wider.h | 4 +- plugins/MacSignedAU/XBandpass/XBandpass.cpp | 10 +- plugins/MacSignedAU/XBandpass/XBandpass.h | 10 +- plugins/MacSignedAU/XHighpass/XHighpass.cpp | 10 +- plugins/MacSignedAU/XHighpass/XHighpass.h | 10 +- plugins/MacSignedAU/XLowpass/XLowpass.cpp | 10 +- plugins/MacSignedAU/XLowpass/XLowpass.h | 10 +- plugins/MacSignedAU/XNotch/XNotch.cpp | 10 +- plugins/MacSignedAU/XNotch/XNotch.h | 10 +- plugins/MacSignedAU/XRegion/XRegion.cpp | 10 +- plugins/MacSignedAU/XRegion/XRegion.h | 10 +- plugins/MacSignedAU/YBandpass/YBandpass.cpp | 14 +- plugins/MacSignedAU/YBandpass/YBandpass.h | 22 +- plugins/MacSignedAU/YHighpass/YHighpass.cpp | 14 +- plugins/MacSignedAU/YHighpass/YHighpass.h | 18 +- plugins/MacSignedAU/YLowpass/YLowpass.cpp | 14 +- plugins/MacSignedAU/YLowpass/YLowpass.h | 22 +- plugins/MacSignedAU/YNotch/YNotch.cpp | 14 +- plugins/MacSignedAU/YNotch/YNotch.h | 18 +- plugins/MacSignedAU/ZBandpass/ZBandpass.cpp | 10 +- plugins/MacSignedAU/ZBandpass/ZBandpass.h | 14 +- plugins/MacSignedAU/ZBandpass2/ZBandpass2.cpp | 26 +- plugins/MacSignedAU/ZBandpass2/ZBandpass2.h | 26 +- plugins/MacSignedAU/ZHighpass/ZHighpass.cpp | 12 +- plugins/MacSignedAU/ZHighpass/ZHighpass.h | 14 +- plugins/MacSignedAU/ZHighpass2/ZHighpass2.cpp | 26 +- plugins/MacSignedAU/ZHighpass2/ZHighpass2.h | 26 +- plugins/MacSignedAU/ZLowpass/ZLowpass.cpp | 10 +- plugins/MacSignedAU/ZLowpass/ZLowpass.h | 14 +- plugins/MacSignedAU/ZLowpass2/ZLowpass2.cpp | 26 +- plugins/MacSignedAU/ZLowpass2/ZLowpass2.h | 26 +- plugins/MacSignedAU/ZNotch/ZNotch.cpp | 10 +- plugins/MacSignedAU/ZNotch/ZNotch.h | 14 +- plugins/MacSignedAU/ZNotch2/ZNotch2.cpp | 26 +- plugins/MacSignedAU/ZNotch2/ZNotch2.h | 26 +- plugins/MacSignedAU/curve/curve.cpp | 4 +- plugins/MacSignedAU/curve/curve.h | 2 +- plugins/MacSignedAU/curvemono/curvemono.cpp | 4 +- plugins/MacSignedAU/curvemono/curvemono.h | 2 +- plugins/MacSignedAU/uLawDecode/uLawDecode.cpp | 36 +- plugins/MacSignedAU/uLawDecode/uLawDecode.h | 2 +- plugins/MacSignedAU/uLawEncode/uLawEncode.cpp | 36 +- plugins/MacSignedAU/uLawEncode/uLawEncode.h | 2 +- .../MacSignedVST/ADClip7/source/ADClip7.cpp | 4 +- plugins/MacSignedVST/ADClip7/source/ADClip7.h | 12 +- .../ADClip7/source/ADClip7Proc.cpp | 130 +- plugins/MacSignedVST/ADT/source/ADTProc.cpp | 8 +- .../source/AQuickVoiceClip.cpp | 4 +- .../AQuickVoiceClip/source/AQuickVoiceClip.h | 4 +- .../source/AQuickVoiceClipProc.cpp | 118 +- .../Acceleration/source/Acceleration.cpp | 4 +- .../Acceleration/source/Acceleration.h | 4 +- .../Acceleration/source/AccelerationProc.cpp | 118 +- .../Acceleration2/source/Acceleration2.h | 4 +- .../source/Acceleration2Proc.cpp | 36 +- plugins/MacSignedVST/Air/source/Air.cpp | 4 +- plugins/MacSignedVST/Air/source/Air.h | 4 +- plugins/MacSignedVST/Air/source/AirProc.cpp | 118 +- plugins/MacSignedVST/Air2/source/Air2.h | 2 +- plugins/MacSignedVST/Air2/source/Air2Proc.cpp | 44 +- .../Apicolypse/source/ApicolypseProc.cpp | 8 +- .../AtmosphereBuss/source/AtmosphereBuss.h | 82 +- .../source/AtmosphereBussProc.cpp | 42 +- .../source/AtmosphereChannel.h | 82 +- .../source/AtmosphereChannelProc.cpp | 42 +- plugins/MacSignedVST/Aura/source/Aura.cpp | 4 +- plugins/MacSignedVST/Aura/source/Aura.h | 8 +- plugins/MacSignedVST/Aura/source/AuraProc.cpp | 118 +- .../AutoPan/source/AutoPanProc.cpp | 40 +- .../AverMatrix/source/AverMatrixProc.cpp | 24 +- .../MacSignedVST/Average/source/Average.cpp | 4 +- plugins/MacSignedVST/Average/source/Average.h | 4 +- .../Average/source/AverageProc.cpp | 110 +- .../BassAmp/source/BassAmpProc.cpp | 8 +- .../BassDrive/source/BassDriveProc.cpp | 8 +- .../MacSignedVST/BassKit/source/BassKit.cpp | 4 +- plugins/MacSignedVST/BassKit/source/BassKit.h | 4 +- .../BassKit/source/BassKitProc.cpp | 38 +- .../MacSignedVST/Baxandall/source/Baxandall.h | 16 +- .../Baxandall/source/BaxandallProc.cpp | 24 +- plugins/MacSignedVST/Beam/source/BeamProc.cpp | 8 +- plugins/MacSignedVST/Biquad/source/Biquad.h | 2 +- .../MacSignedVST/Biquad/source/BiquadProc.cpp | 40 +- plugins/MacSignedVST/Biquad2/source/Biquad2.h | 2 +- .../Biquad2/source/Biquad2Proc.cpp | 24 +- .../BiquadDouble/source/BiquadDouble.h | 4 +- .../BiquadDouble/source/BiquadDoubleProc.cpp | 24 +- .../BiquadOneHalf/source/BiquadOneHalf.h | 8 +- .../source/BiquadOneHalfProc.cpp | 24 +- .../BiquadPlus/source/BiquadPlus.h | 2 +- .../BiquadPlus/source/BiquadPlusProc.cpp | 40 +- .../BiquadTriple/source/BiquadTriple.h | 6 +- .../BiquadTriple/source/BiquadTripleProc.cpp | 24 +- .../BitGlitter/source/BitGlitterProc.cpp | 24 +- plugins/MacSignedVST/Bite/source/Bite.cpp | 4 +- plugins/MacSignedVST/Bite/source/Bite.h | 4 +- plugins/MacSignedVST/Bite/source/BiteProc.cpp | 110 +- .../BlockParty/source/BlockPartyProc.cpp | 16 +- .../BrassRider/source/BrassRiderProc.cpp | 28 +- .../source/BrightAmbienceProc.cpp | 16 +- .../BrightAmbience2/source/BrightAmbience2.h | 6 +- .../source/BrightAmbience2Proc.cpp | 24 +- .../BrightAmbience3/source/BrightAmbience3.h | 8 +- .../source/BrightAmbience3Proc.cpp | 44 +- .../BuildATPDF/source/BuildATPDFProc.cpp | 80 +- .../BussColors4/source/BussColors4.cpp | 4 +- .../BussColors4/source/BussColors4.h | 4 +- .../BussColors4/source/BussColors4Proc.cpp | 118 +- .../ButterComp/source/ButterComp.cpp | 4 +- .../ButterComp/source/ButterComp.h | 4 +- .../ButterComp/source/ButterCompProc.cpp | 126 +- .../ButterComp2/source/ButterComp2.cpp | 4 +- .../ButterComp2/source/ButterComp2.h | 32 +- .../ButterComp2/source/ButterComp2Proc.cpp | 102 +- .../C5RawBuss/source/C5RawBuss.cpp | 4 +- .../MacSignedVST/C5RawBuss/source/C5RawBuss.h | 4 +- .../C5RawBuss/source/C5RawBussProc.cpp | 122 +- .../C5RawChannel/source/C5RawChannel.cpp | 4 +- .../C5RawChannel/source/C5RawChannel.h | 4 +- .../C5RawChannel/source/C5RawChannelProc.cpp | 122 +- plugins/MacSignedVST/CStrip/source/CStrip.cpp | 4 +- plugins/MacSignedVST/CStrip/source/CStrip.h | 4 +- .../MacSignedVST/CStrip/source/CStripProc.cpp | 126 +- .../Cabs.xcodeproj/christopherjohnson.pbxuser | 132 + .../christopherjohnson.perspectivev3 | 1510 +++++++++ .../Cabs/Cabs.xcodeproj/project.pbxproj | 2201 +++++++++++++ .../contents.xcworkspacedata | 7 + .../UserInterfaceState.xcuserstate | Bin 0 -> 12075 bytes .../UserInterfaceState.xcuserstate | Bin 0 -> 10373 bytes .../Cabs/Cabs.xcodeproj/spiadmin.mode1v3 | 1372 ++++++++ .../Cabs/Cabs.xcodeproj/spiadmin.pbxuser | 143 + .../xcschemes/Gain.xcscheme | 80 + .../xcschemes/xcschememanagement.plist | 22 + .../xcschemes/xcschememanagement.plist | 22 + .../xcschemes/«PROJECTNAME».xcscheme | 57 + plugins/MacSignedVST/Cabs/mac/Info.plist | 24 + plugins/MacSignedVST/Cabs/mac/PkgInfo | 1 + .../MacSignedVST/Cabs/mac/xcode_vst_prefix.h | 17 + plugins/MacSignedVST/Cabs/source/Cabs.cpp | 208 ++ plugins/MacSignedVST/Cabs/source/Cabs.h | 129 + plugins/MacSignedVST/Cabs/source/CabsProc.cpp | 2786 +++++++++++++++++ .../Calibre/source/CalibreProc.cpp | 8 +- .../Capacitor/source/Capacitor.cpp | 4 +- .../MacSignedVST/Capacitor/source/Capacitor.h | 4 +- .../Capacitor/source/CapacitorProc.cpp | 118 +- .../Capacitor2/source/Capacitor2Proc.cpp | 16 +- .../Chamber/source/ChamberProc.cpp | 24 +- .../MacSignedVST/Channel4/source/Channel4.h | 8 +- .../Channel4/source/Channel4Proc.cpp | 92 +- .../MacSignedVST/Channel5/source/Channel5.cpp | 4 +- .../MacSignedVST/Channel5/source/Channel5.h | 4 +- .../Channel5/source/Channel5Proc.cpp | 12 +- .../Channel6/source/Channel6Proc.cpp | 24 +- .../Channel7/source/Channel7Proc.cpp | 32 +- .../Channel8/source/Channel8Proc.cpp | 32 +- .../MacSignedVST/Channel9/source/Channel9.h | 4 +- .../Channel9/source/Channel9Proc.cpp | 52 +- plugins/MacSignedVST/Chorus/source/Chorus.cpp | 4 +- plugins/MacSignedVST/Chorus/source/Chorus.h | 4 +- .../MacSignedVST/Chorus/source/ChorusProc.cpp | 118 +- .../ChorusEnsemble/source/ChorusEnsemble.cpp | 4 +- .../ChorusEnsemble/source/ChorusEnsemble.h | 4 +- .../source/ChorusEnsembleProc.cpp | 118 +- .../ChromeOxide/source/ChromeOxideProc.cpp | 8 +- .../MacSignedVST/Cider/source/CiderProc.cpp | 8 +- .../MacSignedVST/ClipOnly2/source/ClipOnly2.h | 8 +- plugins/MacSignedVST/Coils/source/Coils.h | 4 +- .../MacSignedVST/Coils/source/CoilsProc.cpp | 24 +- plugins/MacSignedVST/Coils2/source/Coils2.h | 8 +- .../MacSignedVST/Coils2/source/Coils2Proc.cpp | 52 +- .../MacSignedVST/Cojones/source/Cojones.cpp | 4 +- plugins/MacSignedVST/Cojones/source/Cojones.h | 12 +- .../Cojones/source/CojonesProc.cpp | 54 +- .../source/CompresaturatorProc.cpp | 24 +- .../Console4Buss/source/Console4Buss.cpp | 4 +- .../Console4Buss/source/Console4BussProc.cpp | 130 +- .../source/Console4Channel.cpp | 4 +- .../source/Console4ChannelProc.cpp | 126 +- .../Console5Buss/source/Console5Buss.cpp | 4 +- .../Console5Buss/source/Console5Buss.h | 4 +- .../Console5Buss/source/Console5BussProc.cpp | 118 +- .../source/Console5Channel.cpp | 4 +- .../Console5Channel/source/Console5Channel.h | 4 +- .../source/Console5ChannelProc.cpp | 118 +- .../Console5DarkCh/source/Console5DarkCh.cpp | 4 +- .../Console5DarkCh/source/Console5DarkCh.h | 4 +- .../source/Console5DarkChProc.cpp | 118 +- .../Console6Buss/source/Console6BussProc.cpp | 8 +- .../source/Console6ChannelProc.cpp | 8 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcschemes/Console7Buss.xcscheme | 0 .../Console7Buss/source/Console7Buss.h | 4 +- .../Console7Buss/source/Console7BussProc.cpp | 28 +- .../Console7Cascade/source/Console7Cascade.h | 10 +- .../source/Console7CascadeProc.cpp | 28 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcschemes/Console7Channel.xcscheme | 0 .../Console7Channel/source/Console7Channel.h | 2 +- .../source/Console7ChannelProc.cpp | 28 +- .../Console7Crunch/source/Console7Crunch.h | 10 +- .../source/Console7CrunchProc.cpp | 28 +- .../source/CrunchyGrooveWear.cpp | 4 +- .../source/CrunchyGrooveWear.h | 4 +- .../source/CrunchyGrooveWearProc.cpp | 118 +- .../MacSignedVST/Crystal/source/Crystal.cpp | 4 +- plugins/MacSignedVST/Crystal/source/Crystal.h | 4 +- .../Crystal/source/CrystalProc.cpp | 38 +- plugins/MacSignedVST/Dark/source/DarkProc.cpp | 8 +- .../DarkNoise/source/DarkNoiseProc.cpp | 40 +- plugins/MacSignedVST/DeBess/source/DeBess.h | 4 +- .../MacSignedVST/DeBess/source/DeBessProc.cpp | 8 +- plugins/MacSignedVST/DeEss/source/DeEss.cpp | 4 +- plugins/MacSignedVST/DeEss/source/DeEss.h | 4 +- .../MacSignedVST/DeEss/source/DeEssProc.cpp | 38 +- .../MacSignedVST/DeHiss/source/DeHissProc.cpp | 16 +- plugins/MacSignedVST/DeRez/source/DeRez.cpp | 4 +- plugins/MacSignedVST/DeRez/source/DeRez.h | 4 +- .../MacSignedVST/DeRez/source/DeRezProc.cpp | 138 +- .../MacSignedVST/DeRez2/source/DeRez2Proc.cpp | 32 +- .../Deckwrecka/source/DeckwreckaProc.cpp | 8 +- .../MacSignedVST/Density/source/Density.cpp | 4 +- plugins/MacSignedVST/Density/source/Density.h | 4 +- .../Density/source/DensityProc.cpp | 126 +- .../MacSignedVST/Density2/source/Density2.h | 36 +- .../Density2/source/Density2Proc.cpp | 68 +- plugins/MacSignedVST/Desk/source/Desk.cpp | 4 +- plugins/MacSignedVST/Desk/source/Desk.h | 12 +- plugins/MacSignedVST/Desk/source/DeskProc.cpp | 126 +- plugins/MacSignedVST/Desk4/source/Desk4.cpp | 4 +- plugins/MacSignedVST/Desk4/source/Desk4.h | 4 +- .../MacSignedVST/Desk4/source/Desk4Proc.cpp | 118 +- .../DigitalBlack/source/DigitalBlackProc.cpp | 20 +- .../MacSignedVST/Distance/source/Distance.cpp | 4 +- .../MacSignedVST/Distance/source/Distance.h | 4 +- .../Distance/source/DistanceProc.cpp | 126 +- .../Distance2/source/Distance2.cpp | 4 +- .../MacSignedVST/Distance2/source/Distance2.h | 82 +- .../Distance2/source/Distance2Proc.cpp | 42 +- .../Distortion/source/Distortion.h | 8 +- .../Distortion/source/DistortionProc.cpp | 32 +- .../DitherFloat/source/DitherFloatProc.cpp | 16 +- .../DitherMeDiskers/source/DitherMeDiskers.h | 4 +- .../DitherMeTimbers/source/DitherMeTimbers.h | 4 +- .../MacSignedVST/Ditherbox/source/Ditherbox.h | 12 +- .../Ditherbox/source/DitherboxProc.cpp | 168 +- .../DoublePaul/source/DoublePaulProc.cpp | 88 +- plugins/MacSignedVST/Drive/source/Drive.cpp | 4 +- plugins/MacSignedVST/Drive/source/Drive.h | 4 +- .../MacSignedVST/Drive/source/DriveProc.cpp | 126 +- .../MacSignedVST/DrumSlam/source/DrumSlam.cpp | 4 +- .../MacSignedVST/DrumSlam/source/DrumSlam.h | 4 +- .../DrumSlam/source/DrumSlamProc.cpp | 158 +- .../DubCenter/source/DubCenter.cpp | 4 +- .../MacSignedVST/DubCenter/source/DubCenter.h | 4 +- .../DubCenter/source/DubCenterProc.cpp | 46 +- plugins/MacSignedVST/DubSub/source/DubSub.cpp | 4 +- plugins/MacSignedVST/DubSub/source/DubSub.h | 4 +- .../MacSignedVST/DubSub/source/DubSubProc.cpp | 42 +- .../DustBunny/source/DustBunnyProc.cpp | 84 +- plugins/MacSignedVST/Dyno/source/DynoProc.cpp | 12 +- plugins/MacSignedVST/EQ/source/EQ.cpp | 4 +- plugins/MacSignedVST/EQ/source/EQ.h | 4 +- plugins/MacSignedVST/EQ/source/EQProc.cpp | 118 +- .../MacSignedVST/EdIsDim/source/EdIsDim.cpp | 4 +- plugins/MacSignedVST/EdIsDim/source/EdIsDim.h | 4 +- .../EdIsDim/source/EdIsDimProc.cpp | 100 +- .../Elation/source/ElationProc.cpp | 16 +- .../ElectroHat/source/ElectroHat.cpp | 4 +- .../ElectroHat/source/ElectroHat.h | 4 +- .../ElectroHat/source/ElectroHatProc.cpp | 38 +- plugins/MacSignedVST/Energy/source/Energy.cpp | 4 +- plugins/MacSignedVST/Energy/source/Energy.h | 4 +- .../MacSignedVST/Energy/source/EnergyProc.cpp | 46 +- .../Energy2/source/Energy2Proc.cpp | 40 +- .../MacSignedVST/Ensemble/source/Ensemble.cpp | 4 +- .../MacSignedVST/Ensemble/source/Ensemble.h | 4 +- .../Ensemble/source/EnsembleProc.cpp | 118 +- .../EveryTrim/source/EveryTrim.cpp | 4 +- .../MacSignedVST/EveryTrim/source/EveryTrim.h | 4 +- .../EveryTrim/source/EveryTrimProc.cpp | 126 +- .../MacSignedVST/Facet/source/FacetProc.cpp | 8 +- .../FathomFive/source/FathomFiveProc.cpp | 88 +- plugins/MacSignedVST/Floor/source/Floor.cpp | 4 +- plugins/MacSignedVST/Floor/source/Floor.h | 4 +- .../MacSignedVST/Floor/source/FloorProc.cpp | 46 +- plugins/MacSignedVST/Focus/source/Focus.h | 4 +- .../MacSignedVST/Focus/source/FocusProc.cpp | 36 +- .../MacSignedVST/Fracture/source/Fracture.cpp | 4 +- .../MacSignedVST/Fracture/source/Fracture.h | 4 +- .../Fracture/source/FractureProc.cpp | 126 +- .../MacSignedVST/FromTape/source/FromTape.cpp | 4 +- .../MacSignedVST/FromTape/source/FromTape.h | 4 +- .../FromTape/source/FromTapeProc.cpp | 118 +- .../christopherjohnson.pbxuser | 0 .../christopherjohnson.perspectivev3 | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../UserInterfaceState.xcuserstate | Bin .../UserInterfaceState.xcuserstate | Bin .../Galactic.xcodeproj/spiadmin.mode1v3 | 0 .../Galactic.xcodeproj/spiadmin.pbxuser | 0 .../xcshareddata/xcschemes/Galactic.xcscheme | 0 .../xcschemes/xcschememanagement.plist | 0 .../xcschemes/xcschememanagement.plist | 0 .../xcschemes/«PROJECTNAME».xcscheme | 0 .../Galactic/source/GalacticProc.cpp | 24 +- .../MacSignedVST/Gatelope/source/Gatelope.cpp | 4 +- .../MacSignedVST/Gatelope/source/Gatelope.h | 4 +- .../Gatelope/source/GatelopeProc.cpp | 38 +- .../source/GlitchShifterProc.cpp | 16 +- plugins/MacSignedVST/Golem/source/Golem.cpp | 4 +- plugins/MacSignedVST/Golem/source/Golem.h | 4 +- .../MacSignedVST/Golem/source/GolemProc.cpp | 118 +- plugins/MacSignedVST/Gringer/source/Gringer.h | 8 +- .../Gringer/source/GringerProc.cpp | 12 +- .../GrooveWear/source/GrooveWear.cpp | 4 +- .../GrooveWear/source/GrooveWear.h | 4 +- .../GrooveWear/source/GrooveWearProc.cpp | 118 +- .../source/GuitarConditioner.cpp | 4 +- .../source/GuitarConditioner.h | 4 +- .../source/GuitarConditionerProc.cpp | 134 +- .../HardVacuum/source/HardVacuum.cpp | 4 +- .../HardVacuum/source/HardVacuum.h | 4 +- .../HardVacuum/source/HardVacuumProc.cpp | 118 +- .../HermeTrim/source/HermeTrim.cpp | 4 +- .../MacSignedVST/HermeTrim/source/HermeTrim.h | 4 +- .../HermeTrim/source/HermeTrimProc.cpp | 126 +- .../Hermepass/source/Hermepass.cpp | 4 +- .../MacSignedVST/Hermepass/source/Hermepass.h | 4 +- .../Hermepass/source/HermepassProc.cpp | 126 +- .../source/HighGlossDitherProc.cpp | 88 +- .../HighImpact/source/HighImpact.cpp | 4 +- .../HighImpact/source/HighImpact.h | 4 +- .../HighImpact/source/HighImpactProc.cpp | 126 +- .../MacSignedVST/Highpass/source/Highpass.cpp | 4 +- .../MacSignedVST/Highpass/source/Highpass.h | 4 +- .../Highpass/source/HighpassProc.cpp | 110 +- .../Highpass2/source/Highpass2Proc.cpp | 16 +- plugins/MacSignedVST/Holt/source/Holt.h | 32 +- plugins/MacSignedVST/Holt/source/HoltProc.cpp | 24 +- plugins/MacSignedVST/Hombre/source/Hombre.cpp | 4 +- plugins/MacSignedVST/Hombre/source/Hombre.h | 4 +- .../MacSignedVST/Hombre/source/HombreProc.cpp | 118 +- plugins/MacSignedVST/Hull/source/Hull.h | 8 +- plugins/MacSignedVST/Hull/source/HullProc.cpp | 68 +- .../HypersonX/source/HypersonXProc.cpp | 2 +- .../Hypersonic/source/HypersonicProc.cpp | 2 +- .../MacSignedVST/Infinity/source/Infinity.h | 6 +- .../Infinity/source/InfinityProc.cpp | 72 +- .../MacSignedVST/Infinity2/source/Infinity2.h | 6 +- .../Infinity2/source/Infinity2Proc.cpp | 72 +- .../Infrasonic/source/Infrasonic.h | 10 +- .../Infrasonic/source/InfrasonicProc.cpp | 16 +- .../Interstage/source/Interstage.h | 4 +- .../Interstage/source/InterstageProc.cpp | 16 +- .../IronOxide5/source/IronOxide5.cpp | 4 +- .../IronOxide5/source/IronOxide5.h | 4 +- .../IronOxide5/source/IronOxide5Proc.cpp | 118 +- .../source/IronOxideClassic.cpp | 4 +- .../source/IronOxideClassic.h | 4 +- .../source/IronOxideClassicProc.cpp | 118 +- .../source/IronOxideClassic2.h | 4 +- .../source/IronOxideClassic2Proc.cpp | 40 +- .../MacSignedVST/Isolator/source/Isolator.h | 6 +- .../Isolator/source/IsolatorProc.cpp | 24 +- .../christopherjohnson.pbxuser | 108 + .../christopherjohnson.perspectivev3 | 1500 +++++++++ .../Isolator2.xcodeproj/project.pbxproj | 2201 +++++++++++++ .../contents.xcworkspacedata | 7 + .../UserInterfaceState.xcuserstate | Bin 0 -> 12075 bytes .../UserInterfaceState.xcuserstate | Bin 0 -> 10373 bytes .../Isolator2.xcodeproj/spiadmin.mode1v3 | 1372 ++++++++ .../Isolator2.xcodeproj/spiadmin.pbxuser | 143 + .../xcschemes/Gain.xcscheme | 80 + .../xcschemes/xcschememanagement.plist | 22 + .../xcschemes/xcschememanagement.plist | 22 + .../xcschemes/«PROJECTNAME».xcscheme | 57 + plugins/MacSignedVST/Isolator2/mac/Info.plist | 24 + plugins/MacSignedVST/Isolator2/mac/PkgInfo | 1 + .../Isolator2/mac/xcode_vst_prefix.h | 17 + .../Isolator2/source/Isolator2.cpp | 154 + .../MacSignedVST/Isolator2/source/Isolator2.h | 104 + .../Isolator2/source/Isolator2Proc.cpp | 574 ++++ .../MacSignedVST/Logical4/source/Logical4.cpp | 4 +- .../Logical4/source/Logical4Proc.cpp | 118 +- plugins/MacSignedVST/Loud/source/LoudProc.cpp | 8 +- .../MacSignedVST/Lowpass/source/Lowpass.cpp | 4 +- plugins/MacSignedVST/Lowpass/source/Lowpass.h | 4 +- .../Lowpass/source/LowpassProc.cpp | 110 +- .../Lowpass2/source/Lowpass2Proc.cpp | 16 +- .../MacSignedVST/Luxor/source/LuxorProc.cpp | 8 +- plugins/MacSignedVST/MV/source/MVProc.cpp | 8 +- plugins/MacSignedVST/MackEQ/source/MackEQ.h | 32 +- .../MacSignedVST/MackEQ/source/MackEQProc.cpp | 64 +- plugins/MacSignedVST/Mackity/source/Mackity.h | 12 +- .../Mackity/source/MackityProc.cpp | 32 +- .../MatrixVerb/source/MatrixVerb.h | 6 +- .../MatrixVerb/source/MatrixVerbProc.cpp | 72 +- plugins/MacSignedVST/Melt/source/Melt.cpp | 4 +- plugins/MacSignedVST/Melt/source/Melt.h | 4 +- plugins/MacSignedVST/Melt/source/MeltProc.cpp | 126 +- .../MacSignedVST/MidSide/source/MidSide.cpp | 4 +- plugins/MacSignedVST/MidSide/source/MidSide.h | 4 +- .../MidSide/source/MidSideProc.cpp | 100 +- .../MacSignedVST/MoNoam/source/MoNoamProc.cpp | 16 +- plugins/MacSignedVST/Mojo/source/MojoProc.cpp | 12 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcschemes/Monitoring.xcscheme | 0 .../Monitoring/source/Monitoring.h | 8 +- .../Monitoring/source/MonitoringProc.cpp | 72 +- .../Monitoring2/source/Monitoring2.h | 2 +- .../Monitoring2/source/Monitoring2Proc.cpp | 48 +- .../source/MultiBandDistortionProc.cpp | 24 +- .../NCSeventeen/source/NCSeventeen.cpp | 4 +- .../NCSeventeen/source/NCSeventeen.h | 4 +- .../NCSeventeen/source/NCSeventeenProc.cpp | 118 +- .../source/NaturalizeDitherProc.cpp | 88 +- .../Neverland/source/NeverlandProc.cpp | 8 +- .../MacSignedVST/Nikola/source/NikolaProc.cpp | 16 +- .../NodeDither/source/NodeDitherProc.cpp | 88 +- plugins/MacSignedVST/Noise/source/Noise.cpp | 4 +- plugins/MacSignedVST/Noise/source/Noise.h | 4 +- .../MacSignedVST/Noise/source/NoiseProc.cpp | 118 +- .../NonlinearSpace/source/NonlinearSpace.cpp | 4 +- .../NonlinearSpace/source/NonlinearSpace.h | 4 +- .../source/NonlinearSpaceProc.cpp | 126 +- .../source/NotJustAnotherCD.h | 4 +- .../source/NotJustAnotherCDProc.cpp | 88 +- .../source/NotJustAnotherDither.h | 4 +- .../source/NotJustAnotherDitherProc.cpp | 34 +- .../OneCornerClip/source/OneCornerClip.cpp | 4 +- .../OneCornerClip/source/OneCornerClip.h | 4 +- .../source/OneCornerClipProc.cpp | 118 +- plugins/MacSignedVST/PDBuss/source/PDBuss.cpp | 4 +- plugins/MacSignedVST/PDBuss/source/PDBuss.h | 4 +- .../MacSignedVST/PDBuss/source/PDBussProc.cpp | 118 +- .../PDChannel/source/PDChannel.cpp | 4 +- .../MacSignedVST/PDChannel/source/PDChannel.h | 4 +- .../PDChannel/source/PDChannelProc.cpp | 118 +- .../MacSignedVST/Pafnuty/source/Pafnuty.cpp | 4 +- plugins/MacSignedVST/Pafnuty/source/Pafnuty.h | 4 +- .../Pafnuty/source/PafnutyProc.cpp | 146 +- .../PaulDither/source/PaulDitherProc.cpp | 8 +- .../PaulWide/source/PaulWideProc.cpp | 20 +- .../PeaksOnly/source/PeaksOnlyProc.cpp | 8 +- .../PhaseNudge/source/PhaseNudge.cpp | 4 +- .../PhaseNudge/source/PhaseNudge.h | 4 +- .../PhaseNudge/source/PhaseNudgeProc.cpp | 126 +- .../PitchDelay/source/PitchDelay.h | 8 +- .../PitchDelay/source/PitchDelayProc.cpp | 36 +- .../PocketVerbs/source/PocketVerbsProc.cpp | 16 +- .../Podcast/source/PodcastProc.cpp | 16 +- .../source/PodcastDeluxeProc.cpp | 8 +- plugins/MacSignedVST/Point/source/Point.cpp | 4 +- plugins/MacSignedVST/Point/source/Point.h | 4 +- .../MacSignedVST/Point/source/PointProc.cpp | 118 +- plugins/MacSignedVST/Pop/source/Pop.h | 24 +- plugins/MacSignedVST/Pop/source/PopProc.cpp | 36 +- .../MacSignedVST/PowerSag/source/PowerSag.cpp | 4 +- .../MacSignedVST/PowerSag/source/PowerSag.h | 4 +- .../PowerSag/source/PowerSagProc.cpp | 118 +- .../PowerSag2/source/PowerSag2Proc.cpp | 16 +- .../Precious/source/PreciousProc.cpp | 8 +- .../Preponderant/source/Preponderant.h | 34 +- .../Preponderant/source/PreponderantProc.cpp | 64 +- .../Pressure4/source/Pressure4.cpp | 4 +- .../MacSignedVST/Pressure4/source/Pressure4.h | 4 +- .../Pressure4/source/Pressure4Proc.cpp | 122 +- .../christopherjohnson.pbxuser | 0 .../christopherjohnson.perspectivev3 | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../UserInterfaceState.xcuserstate | Bin .../UserInterfaceState.xcuserstate | Bin .../Pressure5.xcodeproj/spiadmin.mode1v3 | 0 .../Pressure5.xcodeproj/spiadmin.pbxuser | 0 .../xcshareddata/xcschemes/Pressure5.xcscheme | 0 .../xcschemes/xcschememanagement.plist | 0 .../xcschemes/xcschememanagement.plist | 0 .../xcschemes/«PROJECTNAME».xcscheme | 0 .../MacSignedVST/Pressure5/source/Pressure5.h | 12 +- .../Pressure5/source/Pressure5Proc.cpp | 32 +- .../MacSignedVST/PurestAir/source/PurestAir.h | 24 +- .../PurestAir/source/PurestAirProc.cpp | 16 +- .../source/PurestConsole2Buss.h | 2 +- .../source/PurestConsole2BussProc.cpp | 28 +- .../source/PurestConsole2Channel.h | 2 +- .../source/PurestConsole2ChannelProc.cpp | 28 +- .../source/PurestConsoleBuss.cpp | 4 +- .../source/PurestConsoleBuss.h | 4 +- .../source/PurestConsoleBussProc.cpp | 118 +- .../source/PurestConsoleChannel.cpp | 4 +- .../source/PurestConsoleChannel.h | 4 +- .../source/PurestConsoleChannelProc.cpp | 118 +- .../PurestDrive/source/PurestDrive.cpp | 4 +- .../PurestDrive/source/PurestDrive.h | 4 +- .../PurestDrive/source/PurestDriveProc.cpp | 118 +- .../PurestEcho/source/PurestEcho.cpp | 4 +- .../PurestEcho/source/PurestEcho.h | 4 +- .../PurestEcho/source/PurestEchoProc.cpp | 118 +- .../PurestFade/source/PurestFadeProc.cpp | 24 +- .../PurestGain/source/PurestGain.cpp | 4 +- .../PurestGain/source/PurestGain.h | 4 +- .../PurestGain/source/PurestGainProc.cpp | 92 +- .../PurestSquish/source/PurestSquishProc.cpp | 32 +- .../PurestWarm/source/PurestWarm.cpp | 4 +- .../PurestWarm/source/PurestWarm.h | 4 +- .../PurestWarm/source/PurestWarmProc.cpp | 104 +- .../Pyewacket/source/Pyewacket.cpp | 4 +- .../MacSignedVST/Pyewacket/source/Pyewacket.h | 4 +- .../Pyewacket/source/PyewacketProc.cpp | 134 +- .../RawGlitters/source/RawGlittersProc.cpp | 8 +- .../RawTimbers/source/RawTimbersProc.cpp | 8 +- plugins/MacSignedVST/Recurve/source/Recurve.h | 2 +- .../Recurve/source/RecurveProc.cpp | 8 +- .../MacSignedVST/Remap/source/RemapProc.cpp | 32 +- .../MacSignedVST/ResEQ/source/ResEQProc.cpp | 16 +- plugins/MacSignedVST/Reverb/source/Reverb.h | 6 +- .../MacSignedVST/Reverb/source/ReverbProc.cpp | 72 +- .../Righteous4/source/Righteous4.cpp | 4 +- .../Righteous4/source/Righteous4.h | 8 +- .../Righteous4/source/Righteous4Proc.cpp | 130 +- .../MacSignedVST/SideDull/source/SideDull.cpp | 4 +- .../MacSignedVST/SideDull/source/SideDull.h | 4 +- .../SideDull/source/SideDullProc.cpp | 122 +- .../MacSignedVST/Sidepass/source/Sidepass.cpp | 4 +- .../MacSignedVST/Sidepass/source/Sidepass.h | 4 +- .../Sidepass/source/SidepassProc.cpp | 122 +- .../source/SingleEndedTriode.cpp | 4 +- .../source/SingleEndedTriode.h | 4 +- .../source/SingleEndedTriodeProc.cpp | 130 +- plugins/MacSignedVST/Slew/source/SlewProc.cpp | 80 +- .../MacSignedVST/Slew2/source/Slew2Proc.cpp | 80 +- .../MacSignedVST/Slew3/source/Slew3Proc.cpp | 8 +- .../SlewOnly/source/SlewOnlyProc.cpp | 96 +- .../MacSignedVST/Smooth/source/SmoothProc.cpp | 16 +- .../SoftGate/source/SoftGateProc.cpp | 8 +- .../source/SpatializeDitherProc.cpp | 8 +- .../MacSignedVST/Spiral/source/SpiralProc.cpp | 8 +- plugins/MacSignedVST/Spiral2/source/Spiral2.h | 12 +- .../Spiral2/source/Spiral2Proc.cpp | 24 +- plugins/MacSignedVST/Srsly/source/Srsly.h | 18 +- .../MacSignedVST/Srsly/source/SrslyProc.cpp | 104 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/xcschemes/Srsly2.xcscheme | 0 plugins/MacSignedVST/Srsly2/source/Srsly2.h | 18 +- .../MacSignedVST/Srsly2/source/Srsly2Proc.cpp | 112 +- .../StarChild/source/StarChild.cpp | 4 +- .../MacSignedVST/StarChild/source/StarChild.h | 4 +- .../StarChild/source/StarChildProc.cpp | 110 +- .../MacSignedVST/StereoFX/source/StereoFX.cpp | 4 +- .../MacSignedVST/StereoFX/source/StereoFX.h | 4 +- .../StereoFX/source/StereoFXProc.cpp | 126 +- .../MacSignedVST/StudioTan/source/StudioTan.h | 16 +- .../StudioTan/source/StudioTanProc.cpp | 44 +- .../SubsOnly/source/SubsOnlyProc.cpp | 88 +- plugins/MacSignedVST/Surge/source/Surge.cpp | 4 +- plugins/MacSignedVST/Surge/source/Surge.h | 14 +- .../MacSignedVST/Surge/source/SurgeProc.cpp | 126 +- .../SurgeTide/source/SurgeTide.cpp | 4 +- .../MacSignedVST/SurgeTide/source/SurgeTide.h | 10 +- .../SurgeTide/source/SurgeTideProc.cpp | 126 +- plugins/MacSignedVST/Swell/source/Swell.cpp | 4 +- plugins/MacSignedVST/Swell/source/Swell.h | 8 +- .../MacSignedVST/Swell/source/SwellProc.cpp | 126 +- .../TPDFDither/source/TPDFDitherProc.cpp | 8 +- .../TPDFWide/source/TPDFWideProc.cpp | 16 +- plugins/MacSignedVST/Tape/source/Tape.h | 20 +- plugins/MacSignedVST/Tape/source/TapeProc.cpp | 48 +- .../TapeDelay/source/TapeDelay.cpp | 4 +- .../MacSignedVST/TapeDelay/source/TapeDelay.h | 4 +- .../TapeDelay/source/TapeDelayProc.cpp | 38 +- .../TapeDelay2/source/TapeDelay2.h | 8 +- .../TapeDelay2/source/TapeDelay2Proc.cpp | 36 +- .../TapeDither/source/TapeDitherProc.cpp | 8 +- .../MacSignedVST/TapeDust/source/TapeDust.cpp | 4 +- .../MacSignedVST/TapeDust/source/TapeDust.h | 4 +- .../TapeDust/source/TapeDustProc.cpp | 118 +- .../MacSignedVST/TapeFat/source/TapeFat.cpp | 4 +- plugins/MacSignedVST/TapeFat/source/TapeFat.h | 4 +- .../TapeFat/source/TapeFatProc.cpp | 38 +- .../MacSignedVST/Thunder/source/Thunder.cpp | 4 +- plugins/MacSignedVST/Thunder/source/Thunder.h | 4 +- .../Thunder/source/ThunderProc.cpp | 118 +- .../MacSignedVST/ToTape5/source/ToTape5.cpp | 4 +- plugins/MacSignedVST/ToTape5/source/ToTape5.h | 4 +- .../ToTape5/source/ToTape5Proc.cpp | 122 +- plugins/MacSignedVST/ToTape6/source/ToTape6.h | 20 +- .../ToTape6/source/ToTape6Proc.cpp | 64 +- .../MacSignedVST/ToVinyl4/source/ToVinyl4.cpp | 4 +- .../MacSignedVST/ToVinyl4/source/ToVinyl4.h | 4 +- .../ToVinyl4/source/ToVinyl4Proc.cpp | 110 +- .../ToneSlant/source/ToneSlant.cpp | 4 +- .../MacSignedVST/ToneSlant/source/ToneSlant.h | 4 +- .../ToneSlant/source/ToneSlantProc.cpp | 110 +- .../TransDesk/source/TransDesk.cpp | 4 +- .../MacSignedVST/TransDesk/source/TransDesk.h | 12 +- .../TransDesk/source/TransDeskProc.cpp | 126 +- .../TremoSquare/source/TremoSquareProc.cpp | 16 +- .../MacSignedVST/Tremolo/source/Tremolo.cpp | 4 +- plugins/MacSignedVST/Tremolo/source/Tremolo.h | 4 +- .../Tremolo/source/TremoloProc.cpp | 126 +- .../TripleSpread/source/TripleSpreadProc.cpp | 24 +- plugins/MacSignedVST/Tube/source/Tube.h | 8 +- plugins/MacSignedVST/Tube/source/TubeProc.cpp | 32 +- plugins/MacSignedVST/Tube2/source/Tube2.h | 12 +- .../MacSignedVST/Tube2/source/Tube2Proc.cpp | 48 +- .../MacSignedVST/TubeDesk/source/TubeDesk.cpp | 4 +- .../MacSignedVST/TubeDesk/source/TubeDesk.h | 12 +- .../TubeDesk/source/TubeDeskProc.cpp | 126 +- .../MacSignedVST/UltrasonX/source/UltrasonX.h | 2 +- .../UltrasonX/source/UltrasonXProc.cpp | 28 +- .../Ultrasonic/source/Ultrasonic.h | 10 +- .../Ultrasonic/source/UltrasonicProc.cpp | 16 +- .../UltrasonicLite/source/UltrasonicLite.h | 2 +- .../source/UltrasonicLiteProc.cpp | 16 +- .../UltrasonicMed/source/UltrasonicMed.h | 4 +- .../source/UltrasonicMedProc.cpp | 16 +- plugins/MacSignedVST/UnBox/source/UnBox.h | 24 +- .../MacSignedVST/UnBox/source/UnBoxProc.cpp | 24 +- plugins/MacSignedVST/VariMu/source/VariMu.cpp | 4 +- plugins/MacSignedVST/VariMu/source/VariMu.h | 4 +- .../MacSignedVST/VariMu/source/VariMuProc.cpp | 54 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/xcschemes/Verbity.xcscheme | 0 .../Verbity/source/VerbityProc.cpp | 32 +- .../Vibrato/source/VibratoProc.cpp | 8 +- .../VinylDither/source/VinylDitherProc.cpp | 8 +- .../source/VoiceOfTheStarship.cpp | 4 +- .../source/VoiceOfTheStarship.h | 4 +- .../source/VoiceOfTheStarshipProc.cpp | 30 +- .../VoiceTrick/source/VoiceTrickProc.cpp | 12 +- plugins/MacSignedVST/Wider/source/Wider.cpp | 4 +- plugins/MacSignedVST/Wider/source/Wider.h | 4 +- .../MacSignedVST/Wider/source/WiderProc.cpp | 126 +- .../MacSignedVST/XBandpass/source/XBandpass.h | 10 +- .../XBandpass/source/XBandpassProc.cpp | 44 +- .../MacSignedVST/XHighpass/source/XHighpass.h | 10 +- .../XHighpass/source/XHighpassProc.cpp | 44 +- .../MacSignedVST/XLowpass/source/XLowpass.h | 10 +- .../XLowpass/source/XLowpassProc.cpp | 44 +- plugins/MacSignedVST/XNotch/source/XNotch.h | 10 +- .../MacSignedVST/XNotch/source/XNotchProc.cpp | 44 +- plugins/MacSignedVST/XRegion/source/XRegion.h | 10 +- .../XRegion/source/XRegionProc.cpp | 44 +- .../MacSignedVST/YBandpass/source/YBandpass.h | 18 +- .../YBandpass/source/YBandpassProc.cpp | 40 +- .../MacSignedVST/YHighpass/source/YHighpass.h | 18 +- .../YHighpass/source/YHighpassProc.cpp | 40 +- .../MacSignedVST/YLowpass/source/YLowpass.h | 22 +- .../YLowpass/source/YLowpassProc.cpp | 40 +- plugins/MacSignedVST/YNotch/source/YNotch.h | 18 +- .../MacSignedVST/YNotch/source/YNotchProc.cpp | 40 +- .../MacSignedVST/ZBandpass/source/ZBandpass.h | 16 +- .../ZBandpass/source/ZBandpassProc.cpp | 44 +- .../ZBandpass2/source/ZBandpass2.h | 28 +- .../ZBandpass2/source/ZBandpass2Proc.cpp | 64 +- .../MacSignedVST/ZHighpass/source/ZHighpass.h | 16 +- .../ZHighpass/source/ZHighpassProc.cpp | 44 +- .../ZHighpass2/source/ZHighpass2.h | 28 +- .../ZHighpass2/source/ZHighpass2Proc.cpp | 64 +- .../MacSignedVST/ZLowpass/source/ZLowpass.h | 16 +- .../ZLowpass/source/ZLowpassProc.cpp | 44 +- .../MacSignedVST/ZLowpass2/source/ZLowpass2.h | 28 +- .../ZLowpass2/source/ZLowpass2Proc.cpp | 64 +- plugins/MacSignedVST/ZNotch/source/ZNotch.h | 16 +- .../MacSignedVST/ZNotch/source/ZNotchProc.cpp | 44 +- plugins/MacSignedVST/ZNotch2/source/ZNotch2.h | 28 +- .../ZNotch2/source/ZNotch2Proc.cpp | 64 +- plugins/MacSignedVST/curve/source/curve.h | 2 +- .../MacSignedVST/curve/source/curveProc.cpp | 8 +- .../uLawDecode/source/uLawDecode.cpp | 4 +- .../uLawDecode/source/uLawDecode.h | 4 +- .../uLawDecode/source/uLawDecodeProc.cpp | 38 +- .../uLawEncode/source/uLawEncode.cpp | 4 +- .../uLawEncode/source/uLawEncode.h | 4 +- .../uLawEncode/source/uLawEncodeProc.cpp | 38 +- plugins/MacVST/ADClip7/source/ADClip7.cpp | 4 +- plugins/MacVST/ADClip7/source/ADClip7.h | 12 +- plugins/MacVST/ADClip7/source/ADClip7Proc.cpp | 130 +- plugins/MacVST/ADT/source/ADTProc.cpp | 8 +- .../source/AQuickVoiceClip.cpp | 4 +- .../AQuickVoiceClip/source/AQuickVoiceClip.h | 4 +- .../source/AQuickVoiceClipProc.cpp | 118 +- .../Acceleration/source/Acceleration.cpp | 4 +- .../MacVST/Acceleration/source/Acceleration.h | 4 +- .../Acceleration/source/AccelerationProc.cpp | 118 +- .../Acceleration2/source/Acceleration2.h | 4 +- .../source/Acceleration2Proc.cpp | 36 +- plugins/MacVST/Air/source/Air.cpp | 4 +- plugins/MacVST/Air/source/Air.h | 4 +- plugins/MacVST/Air/source/AirProc.cpp | 118 +- plugins/MacVST/Air2/source/Air2.h | 2 +- plugins/MacVST/Air2/source/Air2Proc.cpp | 44 +- .../Apicolypse/source/ApicolypseProc.cpp | 8 +- .../AtmosphereBuss/source/AtmosphereBuss.h | 82 +- .../source/AtmosphereBussProc.cpp | 42 +- .../source/AtmosphereChannel.h | 82 +- .../source/AtmosphereChannelProc.cpp | 42 +- plugins/MacVST/Aura/source/Aura.cpp | 4 +- plugins/MacVST/Aura/source/Aura.h | 8 +- plugins/MacVST/Aura/source/AuraProc.cpp | 118 +- plugins/MacVST/AutoPan/source/AutoPanProc.cpp | 40 +- .../AverMatrix/source/AverMatrixProc.cpp | 24 +- plugins/MacVST/Average/source/Average.cpp | 4 +- plugins/MacVST/Average/source/Average.h | 4 +- plugins/MacVST/Average/source/AverageProc.cpp | 110 +- plugins/MacVST/BassAmp/source/BassAmpProc.cpp | 8 +- .../MacVST/BassDrive/source/BassDriveProc.cpp | 8 +- plugins/MacVST/BassKit/source/BassKit.cpp | 4 +- plugins/MacVST/BassKit/source/BassKit.h | 4 +- plugins/MacVST/BassKit/source/BassKitProc.cpp | 38 +- plugins/MacVST/Baxandall/source/Baxandall.h | 16 +- .../MacVST/Baxandall/source/BaxandallProc.cpp | 24 +- plugins/MacVST/Beam/source/BeamProc.cpp | 8 +- plugins/MacVST/Biquad/source/Biquad.h | 2 +- plugins/MacVST/Biquad/source/BiquadProc.cpp | 40 +- plugins/MacVST/Biquad2/source/Biquad2.h | 2 +- plugins/MacVST/Biquad2/source/Biquad2Proc.cpp | 24 +- .../MacVST/BiquadDouble/source/BiquadDouble.h | 4 +- .../BiquadDouble/source/BiquadDoubleProc.cpp | 24 +- .../BiquadOneHalf/source/BiquadOneHalf.h | 8 +- .../source/BiquadOneHalfProc.cpp | 24 +- plugins/MacVST/BiquadPlus/source/BiquadPlus.h | 2 +- .../BiquadPlus/source/BiquadPlusProc.cpp | 40 +- .../MacVST/BiquadTriple/source/BiquadTriple.h | 6 +- .../BiquadTriple/source/BiquadTripleProc.cpp | 24 +- .../BitGlitter/source/BitGlitterProc.cpp | 24 +- plugins/MacVST/Bite/source/Bite.cpp | 4 +- plugins/MacVST/Bite/source/Bite.h | 4 +- plugins/MacVST/Bite/source/BiteProc.cpp | 110 +- .../BlockParty/source/BlockPartyProc.cpp | 16 +- .../BrassRider/source/BrassRiderProc.cpp | 28 +- .../source/BrightAmbienceProc.cpp | 16 +- .../BrightAmbience2/source/BrightAmbience2.h | 6 +- .../source/BrightAmbience2Proc.cpp | 24 +- .../BrightAmbience3/source/BrightAmbience3.h | 8 +- .../source/BrightAmbience3Proc.cpp | 44 +- .../BuildATPDF/source/BuildATPDFProc.cpp | 80 +- .../MacVST/BussColors4/source/BussColors4.cpp | 4 +- .../MacVST/BussColors4/source/BussColors4.h | 4 +- .../BussColors4/source/BussColors4Proc.cpp | 118 +- .../MacVST/ButterComp/source/ButterComp.cpp | 4 +- plugins/MacVST/ButterComp/source/ButterComp.h | 4 +- .../ButterComp/source/ButterCompProc.cpp | 126 +- .../MacVST/ButterComp2/source/ButterComp2.cpp | 4 +- .../MacVST/ButterComp2/source/ButterComp2.h | 32 +- .../ButterComp2/source/ButterComp2Proc.cpp | 102 +- plugins/MacVST/C5RawBuss/source/C5RawBuss.cpp | 4 +- plugins/MacVST/C5RawBuss/source/C5RawBuss.h | 4 +- .../MacVST/C5RawBuss/source/C5RawBussProc.cpp | 122 +- .../C5RawChannel/source/C5RawChannel.cpp | 4 +- .../MacVST/C5RawChannel/source/C5RawChannel.h | 4 +- .../C5RawChannel/source/C5RawChannelProc.cpp | 122 +- plugins/MacVST/CStrip/source/CStrip.cpp | 4 +- plugins/MacVST/CStrip/source/CStrip.h | 4 +- plugins/MacVST/CStrip/source/CStripProc.cpp | 126 +- plugins/MacVST/Calibre/source/CalibreProc.cpp | 8 +- plugins/MacVST/Capacitor/source/Capacitor.cpp | 4 +- plugins/MacVST/Capacitor/source/Capacitor.h | 4 +- .../MacVST/Capacitor/source/CapacitorProc.cpp | 118 +- .../Capacitor2/source/Capacitor2Proc.cpp | 16 +- plugins/MacVST/Chamber/source/ChamberProc.cpp | 24 +- plugins/MacVST/Channel4/source/Channel4.h | 8 +- .../MacVST/Channel4/source/Channel4Proc.cpp | 92 +- plugins/MacVST/Channel5/source/Channel5.cpp | 4 +- plugins/MacVST/Channel5/source/Channel5.h | 4 +- .../MacVST/Channel5/source/Channel5Proc.cpp | 12 +- .../MacVST/Channel6/source/Channel6Proc.cpp | 24 +- .../MacVST/Channel7/source/Channel7Proc.cpp | 32 +- .../MacVST/Channel8/source/Channel8Proc.cpp | 32 +- plugins/MacVST/Channel9/source/Channel9.h | 4 +- .../MacVST/Channel9/source/Channel9Proc.cpp | 52 +- plugins/MacVST/Chorus/source/Chorus.cpp | 4 +- plugins/MacVST/Chorus/source/Chorus.h | 4 +- plugins/MacVST/Chorus/source/ChorusProc.cpp | 118 +- .../ChorusEnsemble/source/ChorusEnsemble.cpp | 4 +- .../ChorusEnsemble/source/ChorusEnsemble.h | 4 +- .../source/ChorusEnsembleProc.cpp | 118 +- .../ChromeOxide/source/ChromeOxideProc.cpp | 8 +- plugins/MacVST/Cider/source/CiderProc.cpp | 8 +- plugins/MacVST/ClipOnly2/source/ClipOnly2.h | 8 +- plugins/MacVST/Coils/source/Coils.h | 4 +- plugins/MacVST/Coils/source/CoilsProc.cpp | 24 +- plugins/MacVST/Coils2/source/Coils2.h | 8 +- plugins/MacVST/Coils2/source/Coils2Proc.cpp | 52 +- plugins/MacVST/Cojones/source/Cojones.cpp | 4 +- plugins/MacVST/Cojones/source/Cojones.h | 12 +- plugins/MacVST/Cojones/source/CojonesProc.cpp | 54 +- .../source/CompresaturatorProc.cpp | 24 +- .../Console4Buss/source/Console4Buss.cpp | 4 +- .../Console4Buss/source/Console4BussProc.cpp | 130 +- .../source/Console4Channel.cpp | 4 +- .../source/Console4ChannelProc.cpp | 126 +- .../Console5Buss/source/Console5Buss.cpp | 4 +- .../MacVST/Console5Buss/source/Console5Buss.h | 4 +- .../Console5Buss/source/Console5BussProc.cpp | 118 +- .../source/Console5Channel.cpp | 4 +- .../Console5Channel/source/Console5Channel.h | 4 +- .../source/Console5ChannelProc.cpp | 118 +- .../Console5DarkCh/source/Console5DarkCh.cpp | 4 +- .../Console5DarkCh/source/Console5DarkCh.h | 4 +- .../source/Console5DarkChProc.cpp | 118 +- .../Console6Buss/source/Console6BussProc.cpp | 8 +- .../source/Console6ChannelProc.cpp | 8 +- .../MacVST/Console7Buss/source/Console7Buss.h | 4 +- .../Console7Buss/source/Console7BussProc.cpp | 28 +- .../Console7Cascade/source/Console7Cascade.h | 10 +- .../source/Console7CascadeProc.cpp | 28 +- .../Console7Channel/source/Console7Channel.h | 2 +- .../source/Console7ChannelProc.cpp | 28 +- .../Console7Crunch/source/Console7Crunch.h | 10 +- .../source/Console7CrunchProc.cpp | 28 +- .../source/CrunchyGrooveWear.cpp | 4 +- .../source/CrunchyGrooveWear.h | 4 +- .../source/CrunchyGrooveWearProc.cpp | 118 +- plugins/MacVST/Crystal/source/Crystal.cpp | 4 +- plugins/MacVST/Crystal/source/Crystal.h | 4 +- plugins/MacVST/Crystal/source/CrystalProc.cpp | 38 +- plugins/MacVST/Dark/source/DarkProc.cpp | 8 +- .../MacVST/DarkNoise/source/DarkNoiseProc.cpp | 40 +- plugins/MacVST/DeBess/source/DeBess.h | 4 +- plugins/MacVST/DeBess/source/DeBessProc.cpp | 8 +- plugins/MacVST/DeEss/source/DeEss.cpp | 4 +- plugins/MacVST/DeEss/source/DeEss.h | 4 +- plugins/MacVST/DeEss/source/DeEssProc.cpp | 38 +- plugins/MacVST/DeHiss/source/DeHissProc.cpp | 16 +- plugins/MacVST/DeRez/source/DeRez.cpp | 4 +- plugins/MacVST/DeRez/source/DeRez.h | 4 +- plugins/MacVST/DeRez/source/DeRezProc.cpp | 138 +- plugins/MacVST/DeRez2/source/DeRez2Proc.cpp | 32 +- .../Deckwrecka/source/DeckwreckaProc.cpp | 8 +- plugins/MacVST/Density/source/Density.cpp | 4 +- plugins/MacVST/Density/source/Density.h | 4 +- plugins/MacVST/Density/source/DensityProc.cpp | 126 +- plugins/MacVST/Density2/source/Density2.h | 36 +- .../MacVST/Density2/source/Density2Proc.cpp | 68 +- plugins/MacVST/Desk/source/Desk.cpp | 4 +- plugins/MacVST/Desk/source/Desk.h | 12 +- plugins/MacVST/Desk/source/DeskProc.cpp | 126 +- plugins/MacVST/Desk4/source/Desk4.cpp | 4 +- plugins/MacVST/Desk4/source/Desk4.h | 4 +- plugins/MacVST/Desk4/source/Desk4Proc.cpp | 118 +- .../DigitalBlack/source/DigitalBlackProc.cpp | 20 +- plugins/MacVST/Distance/source/Distance.cpp | 4 +- plugins/MacVST/Distance/source/Distance.h | 4 +- .../MacVST/Distance/source/DistanceProc.cpp | 126 +- plugins/MacVST/Distance2/source/Distance2.cpp | 4 +- plugins/MacVST/Distance2/source/Distance2.h | 82 +- .../MacVST/Distance2/source/Distance2Proc.cpp | 42 +- plugins/MacVST/Distortion/source/Distortion.h | 8 +- .../Distortion/source/DistortionProc.cpp | 32 +- .../DitherFloat/source/DitherFloatProc.cpp | 16 +- .../DitherMeDiskers/source/DitherMeDiskers.h | 4 +- .../DitherMeTimbers/source/DitherMeTimbers.h | 4 +- plugins/MacVST/Ditherbox/source/Ditherbox.h | 12 +- .../MacVST/Ditherbox/source/DitherboxProc.cpp | 168 +- .../DoublePaul/source/DoublePaulProc.cpp | 88 +- plugins/MacVST/Drive/source/Drive.cpp | 4 +- plugins/MacVST/Drive/source/Drive.h | 4 +- plugins/MacVST/Drive/source/DriveProc.cpp | 126 +- plugins/MacVST/DrumSlam/source/DrumSlam.cpp | 4 +- plugins/MacVST/DrumSlam/source/DrumSlam.h | 4 +- .../MacVST/DrumSlam/source/DrumSlamProc.cpp | 158 +- plugins/MacVST/DubCenter/source/DubCenter.cpp | 4 +- plugins/MacVST/DubCenter/source/DubCenter.h | 4 +- .../MacVST/DubCenter/source/DubCenterProc.cpp | 46 +- plugins/MacVST/DubSub/source/DubSub.cpp | 4 +- plugins/MacVST/DubSub/source/DubSub.h | 4 +- plugins/MacVST/DubSub/source/DubSubProc.cpp | 42 +- .../MacVST/DustBunny/source/DustBunnyProc.cpp | 84 +- plugins/MacVST/Dyno/source/DynoProc.cpp | 12 +- plugins/MacVST/EQ/source/EQ.cpp | 4 +- plugins/MacVST/EQ/source/EQ.h | 4 +- plugins/MacVST/EQ/source/EQProc.cpp | 118 +- plugins/MacVST/EdIsDim/source/EdIsDim.cpp | 4 +- plugins/MacVST/EdIsDim/source/EdIsDim.h | 4 +- plugins/MacVST/EdIsDim/source/EdIsDimProc.cpp | 100 +- plugins/MacVST/Elation/source/ElationProc.cpp | 16 +- .../MacVST/ElectroHat/source/ElectroHat.cpp | 4 +- plugins/MacVST/ElectroHat/source/ElectroHat.h | 4 +- .../ElectroHat/source/ElectroHatProc.cpp | 38 +- plugins/MacVST/Energy/source/Energy.cpp | 4 +- plugins/MacVST/Energy/source/Energy.h | 4 +- plugins/MacVST/Energy/source/EnergyProc.cpp | 46 +- plugins/MacVST/Energy2/source/Energy2Proc.cpp | 40 +- plugins/MacVST/Ensemble/source/Ensemble.cpp | 4 +- plugins/MacVST/Ensemble/source/Ensemble.h | 4 +- .../MacVST/Ensemble/source/EnsembleProc.cpp | 118 +- plugins/MacVST/EveryTrim/source/EveryTrim.cpp | 4 +- plugins/MacVST/EveryTrim/source/EveryTrim.h | 4 +- .../MacVST/EveryTrim/source/EveryTrimProc.cpp | 126 +- plugins/MacVST/Facet/source/FacetProc.cpp | 8 +- .../FathomFive/source/FathomFiveProc.cpp | 88 +- plugins/MacVST/Floor/source/Floor.cpp | 4 +- plugins/MacVST/Floor/source/Floor.h | 4 +- plugins/MacVST/Floor/source/FloorProc.cpp | 46 +- plugins/MacVST/Focus/source/Focus.h | 4 +- plugins/MacVST/Focus/source/FocusProc.cpp | 36 +- plugins/MacVST/Fracture/source/Fracture.cpp | 4 +- plugins/MacVST/Fracture/source/Fracture.h | 4 +- .../MacVST/Fracture/source/FractureProc.cpp | 126 +- plugins/MacVST/FromTape/source/FromTape.cpp | 4 +- plugins/MacVST/FromTape/source/FromTape.h | 4 +- .../MacVST/FromTape/source/FromTapeProc.cpp | 118 +- .../MacVST/Galactic/source/GalacticProc.cpp | 24 +- plugins/MacVST/Gatelope/source/Gatelope.cpp | 4 +- plugins/MacVST/Gatelope/source/Gatelope.h | 4 +- .../MacVST/Gatelope/source/GatelopeProc.cpp | 38 +- .../source/GlitchShifterProc.cpp | 16 +- plugins/MacVST/Golem/source/Golem.cpp | 4 +- plugins/MacVST/Golem/source/Golem.h | 4 +- plugins/MacVST/Golem/source/GolemProc.cpp | 118 +- plugins/MacVST/Gringer/source/Gringer.h | 8 +- plugins/MacVST/Gringer/source/GringerProc.cpp | 12 +- .../MacVST/GrooveWear/source/GrooveWear.cpp | 4 +- plugins/MacVST/GrooveWear/source/GrooveWear.h | 4 +- .../GrooveWear/source/GrooveWearProc.cpp | 118 +- .../source/GuitarConditioner.cpp | 4 +- .../source/GuitarConditioner.h | 4 +- .../source/GuitarConditionerProc.cpp | 134 +- .../MacVST/HardVacuum/source/HardVacuum.cpp | 4 +- plugins/MacVST/HardVacuum/source/HardVacuum.h | 4 +- .../HardVacuum/source/HardVacuumProc.cpp | 118 +- plugins/MacVST/HermeTrim/source/HermeTrim.cpp | 4 +- plugins/MacVST/HermeTrim/source/HermeTrim.h | 4 +- .../MacVST/HermeTrim/source/HermeTrimProc.cpp | 126 +- plugins/MacVST/Hermepass/source/Hermepass.cpp | 4 +- plugins/MacVST/Hermepass/source/Hermepass.h | 4 +- .../MacVST/Hermepass/source/HermepassProc.cpp | 126 +- .../source/HighGlossDitherProc.cpp | 88 +- .../MacVST/HighImpact/source/HighImpact.cpp | 4 +- plugins/MacVST/HighImpact/source/HighImpact.h | 4 +- .../HighImpact/source/HighImpactProc.cpp | 126 +- plugins/MacVST/Highpass/source/Highpass.cpp | 4 +- plugins/MacVST/Highpass/source/Highpass.h | 4 +- .../MacVST/Highpass/source/HighpassProc.cpp | 110 +- .../MacVST/Highpass2/source/Highpass2Proc.cpp | 16 +- plugins/MacVST/Holt/source/Holt.h | 32 +- plugins/MacVST/Holt/source/HoltProc.cpp | 24 +- plugins/MacVST/Hombre/source/Hombre.cpp | 4 +- plugins/MacVST/Hombre/source/Hombre.h | 4 +- plugins/MacVST/Hombre/source/HombreProc.cpp | 118 +- plugins/MacVST/Hull/source/Hull.h | 8 +- plugins/MacVST/Hull/source/HullProc.cpp | 68 +- .../MacVST/HypersonX/source/HypersonXProc.cpp | 2 +- .../Hypersonic/source/HypersonicProc.cpp | 2 +- plugins/MacVST/Infinity/source/Infinity.h | 6 +- .../MacVST/Infinity/source/InfinityProc.cpp | 72 +- plugins/MacVST/Infinity2/source/Infinity2.h | 6 +- .../MacVST/Infinity2/source/Infinity2Proc.cpp | 72 +- plugins/MacVST/Infrasonic/source/Infrasonic.h | 10 +- .../Infrasonic/source/InfrasonicProc.cpp | 16 +- plugins/MacVST/Interstage/source/Interstage.h | 4 +- .../Interstage/source/InterstageProc.cpp | 16 +- .../MacVST/IronOxide5/source/IronOxide5.cpp | 4 +- plugins/MacVST/IronOxide5/source/IronOxide5.h | 4 +- .../IronOxide5/source/IronOxide5Proc.cpp | 118 +- .../source/IronOxideClassic.cpp | 4 +- .../source/IronOxideClassic.h | 4 +- .../source/IronOxideClassicProc.cpp | 118 +- .../source/IronOxideClassic2.h | 4 +- .../source/IronOxideClassic2Proc.cpp | 40 +- plugins/MacVST/Isolator/source/Isolator.h | 6 +- .../MacVST/Isolator/source/IsolatorProc.cpp | 24 +- plugins/MacVST/Logical4/source/Logical4.cpp | 4 +- .../MacVST/Logical4/source/Logical4Proc.cpp | 118 +- plugins/MacVST/Loud/source/LoudProc.cpp | 8 +- plugins/MacVST/Lowpass/source/Lowpass.cpp | 4 +- plugins/MacVST/Lowpass/source/Lowpass.h | 4 +- plugins/MacVST/Lowpass/source/LowpassProc.cpp | 110 +- .../MacVST/Lowpass2/source/Lowpass2Proc.cpp | 16 +- plugins/MacVST/Luxor/source/LuxorProc.cpp | 8 +- plugins/MacVST/MV/source/MVProc.cpp | 8 +- plugins/MacVST/MackEQ/source/MackEQ.h | 32 +- plugins/MacVST/MackEQ/source/MackEQProc.cpp | 64 +- plugins/MacVST/Mackity/source/Mackity.h | 12 +- plugins/MacVST/Mackity/source/MackityProc.cpp | 32 +- plugins/MacVST/MatrixVerb/source/MatrixVerb.h | 6 +- .../MatrixVerb/source/MatrixVerbProc.cpp | 72 +- plugins/MacVST/Melt/source/Melt.cpp | 4 +- plugins/MacVST/Melt/source/Melt.h | 4 +- plugins/MacVST/Melt/source/MeltProc.cpp | 126 +- plugins/MacVST/MidSide/source/MidSide.cpp | 4 +- plugins/MacVST/MidSide/source/MidSide.h | 4 +- plugins/MacVST/MidSide/source/MidSideProc.cpp | 100 +- plugins/MacVST/MoNoam/source/MoNoamProc.cpp | 16 +- plugins/MacVST/Mojo/source/MojoProc.cpp | 12 +- plugins/MacVST/Monitoring/source/Monitoring.h | 8 +- .../Monitoring/source/MonitoringProc.cpp | 72 +- .../MacVST/Monitoring2/source/Monitoring2.h | 2 +- .../Monitoring2/source/Monitoring2Proc.cpp | 48 +- .../source/MultiBandDistortionProc.cpp | 24 +- .../MacVST/NCSeventeen/source/NCSeventeen.cpp | 4 +- .../MacVST/NCSeventeen/source/NCSeventeen.h | 4 +- .../NCSeventeen/source/NCSeventeenProc.cpp | 118 +- .../source/NaturalizeDitherProc.cpp | 88 +- .../MacVST/Neverland/source/NeverlandProc.cpp | 8 +- plugins/MacVST/Nikola/source/NikolaProc.cpp | 16 +- .../NodeDither/source/NodeDitherProc.cpp | 88 +- plugins/MacVST/Noise/source/Noise.cpp | 4 +- plugins/MacVST/Noise/source/Noise.h | 4 +- plugins/MacVST/Noise/source/NoiseProc.cpp | 118 +- .../NonlinearSpace/source/NonlinearSpace.cpp | 4 +- .../NonlinearSpace/source/NonlinearSpace.h | 4 +- .../source/NonlinearSpaceProc.cpp | 126 +- .../source/NotJustAnotherCD.h | 4 +- .../source/NotJustAnotherCDProc.cpp | 88 +- .../source/NotJustAnotherDither.h | 4 +- .../source/NotJustAnotherDitherProc.cpp | 34 +- .../OneCornerClip/source/OneCornerClip.cpp | 4 +- .../OneCornerClip/source/OneCornerClip.h | 4 +- .../source/OneCornerClipProc.cpp | 118 +- plugins/MacVST/PDBuss/source/PDBuss.cpp | 4 +- plugins/MacVST/PDBuss/source/PDBuss.h | 4 +- plugins/MacVST/PDBuss/source/PDBussProc.cpp | 118 +- plugins/MacVST/PDChannel/source/PDChannel.cpp | 4 +- plugins/MacVST/PDChannel/source/PDChannel.h | 4 +- .../MacVST/PDChannel/source/PDChannelProc.cpp | 118 +- plugins/MacVST/Pafnuty/source/Pafnuty.cpp | 4 +- plugins/MacVST/Pafnuty/source/Pafnuty.h | 4 +- plugins/MacVST/Pafnuty/source/PafnutyProc.cpp | 146 +- .../PaulDither/source/PaulDitherProc.cpp | 8 +- .../MacVST/PaulWide/source/PaulWideProc.cpp | 20 +- .../MacVST/PeaksOnly/source/PeaksOnlyProc.cpp | 8 +- .../MacVST/PhaseNudge/source/PhaseNudge.cpp | 4 +- plugins/MacVST/PhaseNudge/source/PhaseNudge.h | 4 +- .../PhaseNudge/source/PhaseNudgeProc.cpp | 126 +- plugins/MacVST/PitchDelay/source/PitchDelay.h | 8 +- .../PitchDelay/source/PitchDelayProc.cpp | 36 +- .../PocketVerbs/source/PocketVerbsProc.cpp | 16 +- plugins/MacVST/Podcast/source/PodcastProc.cpp | 16 +- .../source/PodcastDeluxeProc.cpp | 8 +- plugins/MacVST/Point/source/Point.cpp | 4 +- plugins/MacVST/Point/source/Point.h | 4 +- plugins/MacVST/Point/source/PointProc.cpp | 118 +- plugins/MacVST/Pop/source/Pop.h | 24 +- plugins/MacVST/Pop/source/PopProc.cpp | 36 +- plugins/MacVST/PowerSag/source/PowerSag.cpp | 4 +- plugins/MacVST/PowerSag/source/PowerSag.h | 4 +- .../MacVST/PowerSag/source/PowerSagProc.cpp | 118 +- .../MacVST/PowerSag2/source/PowerSag2Proc.cpp | 16 +- .../MacVST/Precious/source/PreciousProc.cpp | 8 +- .../MacVST/Preponderant/source/Preponderant.h | 34 +- .../Preponderant/source/PreponderantProc.cpp | 64 +- plugins/MacVST/Pressure4/source/Pressure4.cpp | 4 +- plugins/MacVST/Pressure4/source/Pressure4.h | 4 +- .../MacVST/Pressure4/source/Pressure4Proc.cpp | 122 +- plugins/MacVST/Pressure5/source/Pressure5.h | 12 +- .../MacVST/Pressure5/source/Pressure5Proc.cpp | 32 +- plugins/MacVST/PurestAir/source/PurestAir.h | 24 +- .../MacVST/PurestAir/source/PurestAirProc.cpp | 16 +- .../source/PurestConsole2Buss.h | 2 +- .../source/PurestConsole2BussProc.cpp | 28 +- .../source/PurestConsole2Channel.h | 2 +- .../source/PurestConsole2ChannelProc.cpp | 28 +- .../source/PurestConsoleBuss.cpp | 4 +- .../source/PurestConsoleBuss.h | 4 +- .../source/PurestConsoleBussProc.cpp | 118 +- .../source/PurestConsoleChannel.cpp | 4 +- .../source/PurestConsoleChannel.h | 4 +- .../source/PurestConsoleChannelProc.cpp | 118 +- .../MacVST/PurestDrive/source/PurestDrive.cpp | 4 +- .../MacVST/PurestDrive/source/PurestDrive.h | 4 +- .../PurestDrive/source/PurestDriveProc.cpp | 118 +- .../MacVST/PurestEcho/source/PurestEcho.cpp | 4 +- plugins/MacVST/PurestEcho/source/PurestEcho.h | 4 +- .../PurestEcho/source/PurestEchoProc.cpp | 118 +- .../PurestFade/source/PurestFadeProc.cpp | 24 +- .../MacVST/PurestGain/source/PurestGain.cpp | 4 +- plugins/MacVST/PurestGain/source/PurestGain.h | 4 +- .../PurestGain/source/PurestGainProc.cpp | 92 +- .../PurestSquish/source/PurestSquishProc.cpp | 32 +- .../MacVST/PurestWarm/source/PurestWarm.cpp | 4 +- plugins/MacVST/PurestWarm/source/PurestWarm.h | 4 +- .../PurestWarm/source/PurestWarmProc.cpp | 104 +- plugins/MacVST/Pyewacket/source/Pyewacket.cpp | 4 +- plugins/MacVST/Pyewacket/source/Pyewacket.h | 4 +- .../MacVST/Pyewacket/source/PyewacketProc.cpp | 134 +- .../RawGlitters/source/RawGlittersProc.cpp | 8 +- .../RawTimbers/source/RawTimbersProc.cpp | 8 +- plugins/MacVST/Recurve/source/Recurve.h | 2 +- plugins/MacVST/Recurve/source/RecurveProc.cpp | 8 +- plugins/MacVST/Remap/source/RemapProc.cpp | 32 +- plugins/MacVST/ResEQ/source/ResEQProc.cpp | 16 +- plugins/MacVST/Reverb/source/Reverb.h | 6 +- plugins/MacVST/Reverb/source/ReverbProc.cpp | 72 +- .../MacVST/Righteous4/source/Righteous4.cpp | 4 +- plugins/MacVST/Righteous4/source/Righteous4.h | 8 +- .../Righteous4/source/Righteous4Proc.cpp | 130 +- plugins/MacVST/SideDull/source/SideDull.cpp | 4 +- plugins/MacVST/SideDull/source/SideDull.h | 4 +- .../MacVST/SideDull/source/SideDullProc.cpp | 122 +- plugins/MacVST/Sidepass/source/Sidepass.cpp | 4 +- plugins/MacVST/Sidepass/source/Sidepass.h | 4 +- .../MacVST/Sidepass/source/SidepassProc.cpp | 122 +- .../source/SingleEndedTriode.cpp | 4 +- .../source/SingleEndedTriode.h | 4 +- .../source/SingleEndedTriodeProc.cpp | 130 +- plugins/MacVST/Slew/source/SlewProc.cpp | 80 +- plugins/MacVST/Slew2/source/Slew2Proc.cpp | 80 +- plugins/MacVST/Slew3/source/Slew3Proc.cpp | 8 +- .../MacVST/SlewOnly/source/SlewOnlyProc.cpp | 96 +- plugins/MacVST/Smooth/source/SmoothProc.cpp | 16 +- .../MacVST/SoftGate/source/SoftGateProc.cpp | 8 +- .../source/SpatializeDitherProc.cpp | 8 +- plugins/MacVST/Spiral/source/SpiralProc.cpp | 8 +- plugins/MacVST/Spiral2/source/Spiral2.h | 12 +- plugins/MacVST/Spiral2/source/Spiral2Proc.cpp | 24 +- plugins/MacVST/Srsly/source/Srsly.h | 18 +- plugins/MacVST/Srsly/source/SrslyProc.cpp | 112 +- plugins/MacVST/Srsly2/source/Srsly2.h | 18 +- plugins/MacVST/Srsly2/source/Srsly2Proc.cpp | 112 +- plugins/MacVST/StarChild/source/StarChild.cpp | 4 +- plugins/MacVST/StarChild/source/StarChild.h | 4 +- .../MacVST/StarChild/source/StarChildProc.cpp | 110 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../UserInterfaceState.xcuserstate | Bin 12075 -> 19471 bytes plugins/MacVST/StereoFX/source/StereoFX.cpp | 4 +- plugins/MacVST/StereoFX/source/StereoFX.h | 4 +- .../MacVST/StereoFX/source/StereoFXProc.cpp | 126 +- plugins/MacVST/StudioTan/source/StudioTan.h | 16 +- .../MacVST/StudioTan/source/StudioTanProc.cpp | 44 +- .../MacVST/SubsOnly/source/SubsOnlyProc.cpp | 88 +- plugins/MacVST/Surge/source/Surge.cpp | 4 +- plugins/MacVST/Surge/source/Surge.h | 14 +- plugins/MacVST/Surge/source/SurgeProc.cpp | 126 +- plugins/MacVST/SurgeTide/source/SurgeTide.cpp | 4 +- plugins/MacVST/SurgeTide/source/SurgeTide.h | 10 +- .../MacVST/SurgeTide/source/SurgeTideProc.cpp | 126 +- plugins/MacVST/Swell/source/Swell.cpp | 4 +- plugins/MacVST/Swell/source/Swell.h | 8 +- plugins/MacVST/Swell/source/SwellProc.cpp | 126 +- .../TPDFDither/source/TPDFDitherProc.cpp | 8 +- .../MacVST/TPDFWide/source/TPDFWideProc.cpp | 16 +- plugins/MacVST/Tape/source/Tape.h | 20 +- plugins/MacVST/Tape/source/TapeProc.cpp | 48 +- plugins/MacVST/TapeDelay/source/TapeDelay.cpp | 4 +- plugins/MacVST/TapeDelay/source/TapeDelay.h | 4 +- .../MacVST/TapeDelay/source/TapeDelayProc.cpp | 38 +- plugins/MacVST/TapeDelay2/source/TapeDelay2.h | 8 +- .../TapeDelay2/source/TapeDelay2Proc.cpp | 36 +- .../TapeDither/source/TapeDitherProc.cpp | 8 +- plugins/MacVST/TapeDust/source/TapeDust.cpp | 4 +- plugins/MacVST/TapeDust/source/TapeDust.h | 4 +- .../MacVST/TapeDust/source/TapeDustProc.cpp | 118 +- plugins/MacVST/TapeFat/source/TapeFat.cpp | 4 +- plugins/MacVST/TapeFat/source/TapeFat.h | 4 +- plugins/MacVST/TapeFat/source/TapeFatProc.cpp | 38 +- plugins/MacVST/Thunder/source/Thunder.cpp | 4 +- plugins/MacVST/Thunder/source/Thunder.h | 4 +- plugins/MacVST/Thunder/source/ThunderProc.cpp | 118 +- plugins/MacVST/ToTape5/source/ToTape5.cpp | 4 +- plugins/MacVST/ToTape5/source/ToTape5.h | 4 +- plugins/MacVST/ToTape5/source/ToTape5Proc.cpp | 122 +- plugins/MacVST/ToTape6/source/ToTape6.h | 20 +- plugins/MacVST/ToTape6/source/ToTape6Proc.cpp | 64 +- plugins/MacVST/ToVinyl4/source/ToVinyl4.cpp | 4 +- plugins/MacVST/ToVinyl4/source/ToVinyl4.h | 4 +- .../MacVST/ToVinyl4/source/ToVinyl4Proc.cpp | 110 +- plugins/MacVST/ToneSlant/source/ToneSlant.cpp | 4 +- plugins/MacVST/ToneSlant/source/ToneSlant.h | 4 +- .../MacVST/ToneSlant/source/ToneSlantProc.cpp | 110 +- plugins/MacVST/TransDesk/source/TransDesk.cpp | 4 +- plugins/MacVST/TransDesk/source/TransDesk.h | 12 +- .../MacVST/TransDesk/source/TransDeskProc.cpp | 126 +- .../TremoSquare/source/TremoSquareProc.cpp | 16 +- plugins/MacVST/Tremolo/source/Tremolo.cpp | 4 +- plugins/MacVST/Tremolo/source/Tremolo.h | 4 +- plugins/MacVST/Tremolo/source/TremoloProc.cpp | 126 +- .../TripleSpread/source/TripleSpreadProc.cpp | 24 +- plugins/MacVST/Tube/source/Tube.h | 8 +- plugins/MacVST/Tube/source/TubeProc.cpp | 32 +- plugins/MacVST/Tube2/source/Tube2.h | 12 +- plugins/MacVST/Tube2/source/Tube2Proc.cpp | 48 +- plugins/MacVST/TubeDesk/source/TubeDesk.cpp | 4 +- plugins/MacVST/TubeDesk/source/TubeDesk.h | 12 +- .../MacVST/TubeDesk/source/TubeDeskProc.cpp | 126 +- plugins/MacVST/UltrasonX/source/UltrasonX.h | 2 +- .../MacVST/UltrasonX/source/UltrasonXProc.cpp | 28 +- plugins/MacVST/Ultrasonic/source/Ultrasonic.h | 10 +- .../Ultrasonic/source/UltrasonicProc.cpp | 16 +- .../UltrasonicLite/source/UltrasonicLite.h | 2 +- .../source/UltrasonicLiteProc.cpp | 16 +- .../UltrasonicMed/source/UltrasonicMed.h | 4 +- .../source/UltrasonicMedProc.cpp | 16 +- plugins/MacVST/UnBox/source/UnBox.h | 24 +- plugins/MacVST/UnBox/source/UnBoxProc.cpp | 24 +- plugins/MacVST/VariMu/source/VariMu.cpp | 4 +- plugins/MacVST/VariMu/source/VariMu.h | 4 +- plugins/MacVST/VariMu/source/VariMuProc.cpp | 54 +- plugins/MacVST/Verbity/source/VerbityProc.cpp | 32 +- plugins/MacVST/Vibrato/source/VibratoProc.cpp | 8 +- .../VinylDither/source/VinylDitherProc.cpp | 8 +- .../source/VoiceOfTheStarship.cpp | 4 +- .../source/VoiceOfTheStarship.h | 4 +- .../source/VoiceOfTheStarshipProc.cpp | 30 +- .../VoiceTrick/source/VoiceTrickProc.cpp | 12 +- plugins/MacVST/Wider/source/Wider.cpp | 4 +- plugins/MacVST/Wider/source/Wider.h | 4 +- plugins/MacVST/Wider/source/WiderProc.cpp | 126 +- plugins/MacVST/XBandpass/source/XBandpass.h | 10 +- .../MacVST/XBandpass/source/XBandpassProc.cpp | 44 +- plugins/MacVST/XHighpass/source/XHighpass.h | 10 +- .../MacVST/XHighpass/source/XHighpassProc.cpp | 44 +- plugins/MacVST/XLowpass/source/XLowpass.h | 10 +- .../MacVST/XLowpass/source/XLowpassProc.cpp | 44 +- plugins/MacVST/XNotch/source/XNotch.h | 10 +- plugins/MacVST/XNotch/source/XNotchProc.cpp | 44 +- plugins/MacVST/XRegion/source/XRegion.h | 10 +- plugins/MacVST/XRegion/source/XRegionProc.cpp | 44 +- plugins/MacVST/YBandpass/source/YBandpass.h | 18 +- .../MacVST/YBandpass/source/YBandpassProc.cpp | 40 +- plugins/MacVST/YHighpass/source/YHighpass.h | 18 +- .../MacVST/YHighpass/source/YHighpassProc.cpp | 40 +- plugins/MacVST/YLowpass/source/YLowpass.h | 18 +- .../MacVST/YLowpass/source/YLowpassProc.cpp | 40 +- plugins/MacVST/YNotch/source/YNotch.h | 18 +- plugins/MacVST/YNotch/source/YNotchProc.cpp | 40 +- plugins/MacVST/ZBandpass/source/ZBandpass.h | 16 +- .../MacVST/ZBandpass/source/ZBandpassProc.cpp | 44 +- plugins/MacVST/ZBandpass2/source/ZBandpass2.h | 28 +- .../ZBandpass2/source/ZBandpass2Proc.cpp | 64 +- plugins/MacVST/ZHighpass/source/ZHighpass.h | 16 +- .../MacVST/ZHighpass/source/ZHighpassProc.cpp | 44 +- plugins/MacVST/ZHighpass2/source/ZHighpass2.h | 28 +- .../ZHighpass2/source/ZHighpass2Proc.cpp | 64 +- plugins/MacVST/ZLowpass/source/ZLowpass.h | 16 +- .../MacVST/ZLowpass/source/ZLowpassProc.cpp | 44 +- plugins/MacVST/ZLowpass2/source/ZLowpass2.h | 28 +- .../MacVST/ZLowpass2/source/ZLowpass2Proc.cpp | 64 +- plugins/MacVST/ZNotch/source/ZNotch.h | 16 +- plugins/MacVST/ZNotch/source/ZNotchProc.cpp | 44 +- plugins/MacVST/ZNotch2/source/ZNotch2.h | 28 +- plugins/MacVST/ZNotch2/source/ZNotch2Proc.cpp | 64 +- plugins/MacVST/curve/source/curve.h | 2 +- plugins/MacVST/curve/source/curveProc.cpp | 8 +- .../MacVST/uLawDecode/source/uLawDecode.cpp | 4 +- plugins/MacVST/uLawDecode/source/uLawDecode.h | 4 +- .../uLawDecode/source/uLawDecodeProc.cpp | 38 +- .../MacVST/uLawEncode/source/uLawEncode.cpp | 4 +- plugins/MacVST/uLawEncode/source/uLawEncode.h | 4 +- .../uLawEncode/source/uLawEncodeProc.cpp | 38 +- plugins/WinVST/ADClip7/ADClip7.cpp | 4 +- plugins/WinVST/ADClip7/ADClip7.h | 12 +- plugins/WinVST/ADClip7/ADClip7Proc.cpp | 130 +- plugins/WinVST/ADT/ADTProc.cpp | 8 +- .../AQuickVoiceClip/AQuickVoiceClip.cpp | 4 +- .../WinVST/AQuickVoiceClip/AQuickVoiceClip.h | 4 +- .../AQuickVoiceClip/AQuickVoiceClipProc.cpp | 118 +- plugins/WinVST/Acceleration/Acceleration.cpp | 4 +- plugins/WinVST/Acceleration/Acceleration.h | 4 +- .../WinVST/Acceleration/AccelerationProc.cpp | 118 +- plugins/WinVST/Acceleration2/Acceleration2.h | 4 +- .../Acceleration2/Acceleration2Proc.cpp | 36 +- plugins/WinVST/Air/Air.cpp | 4 +- plugins/WinVST/Air/Air.h | 4 +- plugins/WinVST/Air/AirProc.cpp | 118 +- plugins/WinVST/Air2/Air2.h | 2 +- plugins/WinVST/Air2/Air2Proc.cpp | 44 +- plugins/WinVST/Apicolypse/ApicolypseProc.cpp | 8 +- .../WinVST/AtmosphereBuss/AtmosphereBuss.h | 82 +- .../AtmosphereBuss/AtmosphereBussProc.cpp | 42 +- .../AtmosphereChannel/AtmosphereChannel.h | 82 +- .../AtmosphereChannelProc.cpp | 42 +- plugins/WinVST/Aura/Aura.cpp | 4 +- plugins/WinVST/Aura/Aura.h | 8 +- plugins/WinVST/Aura/AuraProc.cpp | 118 +- plugins/WinVST/AutoPan/AutoPanProc.cpp | 40 +- plugins/WinVST/AverMatrix/AverMatrixProc.cpp | 24 +- plugins/WinVST/Average/Average.cpp | 4 +- plugins/WinVST/Average/Average.h | 4 +- plugins/WinVST/Average/AverageProc.cpp | 110 +- plugins/WinVST/BassAmp/BassAmpProc.cpp | 8 +- plugins/WinVST/BassDrive/BassDriveProc.cpp | 8 +- plugins/WinVST/BassKit/BassKit.cpp | 4 +- plugins/WinVST/BassKit/BassKit.h | 4 +- plugins/WinVST/BassKit/BassKitProc.cpp | 38 +- plugins/WinVST/Baxandall/Baxandall.h | 16 +- plugins/WinVST/Baxandall/BaxandallProc.cpp | 24 +- plugins/WinVST/Beam/BeamProc.cpp | 8 +- plugins/WinVST/Biquad/Biquad.h | 2 +- plugins/WinVST/Biquad/BiquadProc.cpp | 40 +- plugins/WinVST/Biquad2/Biquad2.h | 2 +- plugins/WinVST/Biquad2/Biquad2Proc.cpp | 24 +- plugins/WinVST/BiquadDouble/BiquadDouble.h | 4 +- .../WinVST/BiquadDouble/BiquadDoubleProc.cpp | 24 +- plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h | 8 +- .../BiquadOneHalf/BiquadOneHalfProc.cpp | 24 +- plugins/WinVST/BiquadPlus/BiquadPlus.h | 2 +- plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp | 40 +- plugins/WinVST/BiquadTriple/BiquadTriple.h | 6 +- .../WinVST/BiquadTriple/BiquadTripleProc.cpp | 24 +- plugins/WinVST/BitGlitter/BitGlitterProc.cpp | 24 +- plugins/WinVST/Bite/Bite.cpp | 4 +- plugins/WinVST/Bite/Bite.h | 4 +- plugins/WinVST/Bite/BiteProc.cpp | 110 +- plugins/WinVST/BlockParty/BlockPartyProc.cpp | 16 +- plugins/WinVST/BrassRider/BrassRiderProc.cpp | 28 +- .../BrightAmbience/BrightAmbienceProc.cpp | 16 +- .../WinVST/BrightAmbience2/BrightAmbience2.h | 6 +- .../BrightAmbience2/BrightAmbience2Proc.cpp | 24 +- .../WinVST/BrightAmbience3/BrightAmbience3.h | 8 +- .../BrightAmbience3/BrightAmbience3Proc.cpp | 44 +- plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp | 80 +- plugins/WinVST/BussColors4/BussColors4.cpp | 4 +- plugins/WinVST/BussColors4/BussColors4.h | 4 +- .../WinVST/BussColors4/BussColors4Proc.cpp | 118 +- plugins/WinVST/ButterComp/ButterComp.cpp | 4 +- plugins/WinVST/ButterComp/ButterComp.h | 4 +- plugins/WinVST/ButterComp/ButterCompProc.cpp | 126 +- plugins/WinVST/ButterComp2/ButterComp2.cpp | 4 +- plugins/WinVST/ButterComp2/ButterComp2.h | 32 +- .../WinVST/ButterComp2/ButterComp2Proc.cpp | 102 +- plugins/WinVST/C5RawBuss/C5RawBuss.cpp | 4 +- plugins/WinVST/C5RawBuss/C5RawBuss.h | 4 +- plugins/WinVST/C5RawBuss/C5RawBussProc.cpp | 122 +- plugins/WinVST/C5RawChannel/C5RawChannel.cpp | 4 +- plugins/WinVST/C5RawChannel/C5RawChannel.h | 4 +- .../WinVST/C5RawChannel/C5RawChannelProc.cpp | 122 +- plugins/WinVST/CStrip/CStrip.cpp | 4 +- plugins/WinVST/CStrip/CStrip.h | 4 +- plugins/WinVST/CStrip/CStripProc.cpp | 126 +- plugins/WinVST/Calibre/CalibreProc.cpp | 8 +- plugins/WinVST/Capacitor/Capacitor.cpp | 4 +- plugins/WinVST/Capacitor/Capacitor.h | 4 +- plugins/WinVST/Capacitor/CapacitorProc.cpp | 118 +- plugins/WinVST/Capacitor2/Capacitor2Proc.cpp | 16 +- plugins/WinVST/Chamber/ChamberProc.cpp | 24 +- plugins/WinVST/Channel4/Channel4.h | 8 +- plugins/WinVST/Channel4/Channel4Proc.cpp | 92 +- plugins/WinVST/Channel5/Channel5.cpp | 4 +- plugins/WinVST/Channel5/Channel5.h | 4 +- plugins/WinVST/Channel5/Channel5Proc.cpp | 12 +- plugins/WinVST/Channel6/Channel6Proc.cpp | 24 +- plugins/WinVST/Channel7/Channel7Proc.cpp | 32 +- plugins/WinVST/Channel8/Channel8Proc.cpp | 32 +- plugins/WinVST/Channel9/Channel9.h | 4 +- plugins/WinVST/Channel9/Channel9Proc.cpp | 52 +- plugins/WinVST/Chorus/Chorus.cpp | 4 +- plugins/WinVST/Chorus/Chorus.h | 4 +- plugins/WinVST/Chorus/ChorusProc.cpp | 118 +- .../WinVST/ChorusEnsemble/ChorusEnsemble.cpp | 4 +- .../WinVST/ChorusEnsemble/ChorusEnsemble.h | 4 +- .../ChorusEnsemble/ChorusEnsembleProc.cpp | 118 +- .../WinVST/ChromeOxide/ChromeOxideProc.cpp | 8 +- plugins/WinVST/Cider/CiderProc.cpp | 8 +- plugins/WinVST/ClipOnly2/ClipOnly2.h | 8 +- plugins/WinVST/Coils/Coils.h | 4 +- plugins/WinVST/Coils/CoilsProc.cpp | 24 +- plugins/WinVST/Coils2/Coils2.h | 8 +- plugins/WinVST/Coils2/Coils2Proc.cpp | 52 +- plugins/WinVST/Cojones/Cojones.cpp | 4 +- plugins/WinVST/Cojones/Cojones.h | 12 +- plugins/WinVST/Cojones/CojonesProc.cpp | 54 +- .../Compresaturator/CompresaturatorProc.cpp | 24 +- plugins/WinVST/Console4Buss/Console4Buss.cpp | 4 +- .../WinVST/Console4Buss/Console4BussProc.cpp | 130 +- .../Console4Channel/Console4Channel.cpp | 4 +- .../Console4Channel/Console4ChannelProc.cpp | 126 +- plugins/WinVST/Console5Buss/Console5Buss.cpp | 4 +- plugins/WinVST/Console5Buss/Console5Buss.h | 4 +- .../WinVST/Console5Buss/Console5BussProc.cpp | 118 +- .../Console5Channel/Console5Channel.cpp | 4 +- .../WinVST/Console5Channel/Console5Channel.h | 4 +- .../Console5Channel/Console5ChannelProc.cpp | 118 +- .../WinVST/Console5DarkCh/Console5DarkCh.cpp | 4 +- .../WinVST/Console5DarkCh/Console5DarkCh.h | 4 +- .../Console5DarkCh/Console5DarkChProc.cpp | 118 +- .../WinVST/Console6Buss/Console6BussProc.cpp | 8 +- .../Console6Channel/Console6ChannelProc.cpp | 8 +- plugins/WinVST/Console7Buss/Console7Buss.h | 4 +- .../WinVST/Console7Buss/Console7BussProc.cpp | 28 +- .../WinVST/Console7Cascade/Console7Cascade.h | 10 +- .../Console7Cascade/Console7CascadeProc.cpp | 28 +- .../WinVST/Console7Channel/Console7Channel.h | 2 +- .../Console7Channel/Console7ChannelProc.cpp | 28 +- .../WinVST/Console7Crunch/Console7Crunch.h | 10 +- .../Console7Crunch/Console7CrunchProc.cpp | 28 +- .../CrunchyGrooveWear/CrunchyGrooveWear.cpp | 4 +- .../CrunchyGrooveWear/CrunchyGrooveWear.h | 4 +- .../CrunchyGrooveWearProc.cpp | 118 +- plugins/WinVST/Crystal/Crystal.cpp | 4 +- plugins/WinVST/Crystal/Crystal.h | 4 +- plugins/WinVST/Crystal/CrystalProc.cpp | 38 +- plugins/WinVST/Dark/DarkProc.cpp | 8 +- plugins/WinVST/DarkNoise/DarkNoiseProc.cpp | 40 +- plugins/WinVST/DeBess/DeBess.h | 4 +- plugins/WinVST/DeBess/DeBessProc.cpp | 8 +- plugins/WinVST/DeEss/DeEss.cpp | 4 +- plugins/WinVST/DeEss/DeEss.h | 4 +- plugins/WinVST/DeEss/DeEssProc.cpp | 38 +- plugins/WinVST/DeHiss/DeHissProc.cpp | 16 +- plugins/WinVST/DeRez/DeRez.cpp | 4 +- plugins/WinVST/DeRez/DeRez.h | 4 +- plugins/WinVST/DeRez/DeRezProc.cpp | 138 +- plugins/WinVST/DeRez2/DeRez2Proc.cpp | 32 +- plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp | 8 +- plugins/WinVST/Density/Density.cpp | 4 +- plugins/WinVST/Density/Density.h | 4 +- plugins/WinVST/Density/DensityProc.cpp | 126 +- plugins/WinVST/Density2/Density2.h | 36 +- plugins/WinVST/Density2/Density2Proc.cpp | 68 +- plugins/WinVST/Desk/Desk.cpp | 4 +- plugins/WinVST/Desk/Desk.h | 12 +- plugins/WinVST/Desk/DeskProc.cpp | 126 +- plugins/WinVST/Desk4/Desk4.cpp | 4 +- plugins/WinVST/Desk4/Desk4.h | 4 +- plugins/WinVST/Desk4/Desk4Proc.cpp | 118 +- .../WinVST/DigitalBlack/DigitalBlackProc.cpp | 20 +- plugins/WinVST/Distance/Distance.cpp | 4 +- plugins/WinVST/Distance/Distance.h | 4 +- plugins/WinVST/Distance/DistanceProc.cpp | 126 +- plugins/WinVST/Distance2/Distance2.cpp | 4 +- plugins/WinVST/Distance2/Distance2.h | 82 +- plugins/WinVST/Distance2/Distance2Proc.cpp | 42 +- plugins/WinVST/Distortion/Distortion.h | 8 +- plugins/WinVST/Distortion/DistortionProc.cpp | 32 +- .../WinVST/DitherFloat/DitherFloatProc.cpp | 16 +- .../WinVST/DitherMeDiskers/DitherMeDiskers.h | 4 +- .../WinVST/DitherMeTimbers/DitherMeTimbers.h | 4 +- plugins/WinVST/Ditherbox/Ditherbox.h | 12 +- plugins/WinVST/Ditherbox/DitherboxProc.cpp | 168 +- plugins/WinVST/DoublePaul/DoublePaulProc.cpp | 88 +- plugins/WinVST/Drive/Drive.cpp | 4 +- plugins/WinVST/Drive/Drive.h | 4 +- plugins/WinVST/Drive/DriveProc.cpp | 126 +- plugins/WinVST/DrumSlam/DrumSlam.cpp | 4 +- plugins/WinVST/DrumSlam/DrumSlam.h | 4 +- plugins/WinVST/DrumSlam/DrumSlamProc.cpp | 158 +- plugins/WinVST/DubCenter/DubCenter.cpp | 4 +- plugins/WinVST/DubCenter/DubCenter.h | 4 +- plugins/WinVST/DubCenter/DubCenterProc.cpp | 46 +- plugins/WinVST/DubSub/DubSub.cpp | 4 +- plugins/WinVST/DubSub/DubSub.h | 4 +- plugins/WinVST/DubSub/DubSubProc.cpp | 42 +- plugins/WinVST/DustBunny/DustBunnyProc.cpp | 84 +- plugins/WinVST/Dyno/DynoProc.cpp | 12 +- plugins/WinVST/EQ/EQ.cpp | 4 +- plugins/WinVST/EQ/EQ.h | 4 +- plugins/WinVST/EQ/EQProc.cpp | 118 +- plugins/WinVST/EdIsDim/EdIsDim.cpp | 4 +- plugins/WinVST/EdIsDim/EdIsDim.h | 4 +- plugins/WinVST/EdIsDim/EdIsDimProc.cpp | 100 +- plugins/WinVST/Elation/ElationProc.cpp | 16 +- plugins/WinVST/ElectroHat/ElectroHat.cpp | 4 +- plugins/WinVST/ElectroHat/ElectroHat.h | 4 +- plugins/WinVST/ElectroHat/ElectroHatProc.cpp | 38 +- plugins/WinVST/Energy/Energy.cpp | 4 +- plugins/WinVST/Energy/Energy.h | 4 +- plugins/WinVST/Energy/EnergyProc.cpp | 46 +- plugins/WinVST/Energy2/Energy2Proc.cpp | 40 +- plugins/WinVST/Ensemble/Ensemble.cpp | 4 +- plugins/WinVST/Ensemble/Ensemble.h | 4 +- plugins/WinVST/Ensemble/EnsembleProc.cpp | 118 +- plugins/WinVST/EveryTrim/EveryTrim.cpp | 4 +- plugins/WinVST/EveryTrim/EveryTrim.h | 4 +- plugins/WinVST/EveryTrim/EveryTrimProc.cpp | 126 +- plugins/WinVST/Facet/FacetProc.cpp | 8 +- plugins/WinVST/FathomFive/FathomFiveProc.cpp | 88 +- plugins/WinVST/Floor/Floor.cpp | 4 +- plugins/WinVST/Floor/Floor.h | 4 +- plugins/WinVST/Floor/FloorProc.cpp | 46 +- plugins/WinVST/Focus/Focus.h | 4 +- plugins/WinVST/Focus/FocusProc.cpp | 36 +- plugins/WinVST/Fracture/Fracture.cpp | 4 +- plugins/WinVST/Fracture/Fracture.h | 4 +- plugins/WinVST/Fracture/FractureProc.cpp | 126 +- plugins/WinVST/FromTape/FromTape.cpp | 4 +- plugins/WinVST/FromTape/FromTape.h | 4 +- plugins/WinVST/FromTape/FromTapeProc.cpp | 118 +- plugins/WinVST/Galactic/GalacticProc.cpp | 24 +- plugins/WinVST/Gatelope/Gatelope.cpp | 4 +- plugins/WinVST/Gatelope/Gatelope.h | 4 +- plugins/WinVST/Gatelope/GatelopeProc.cpp | 38 +- .../GlitchShifter/GlitchShifterProc.cpp | 16 +- plugins/WinVST/Golem/Golem.cpp | 4 +- plugins/WinVST/Golem/Golem.h | 4 +- plugins/WinVST/Golem/GolemProc.cpp | 118 +- plugins/WinVST/Gringer/Gringer.h | 8 +- plugins/WinVST/Gringer/GringerProc.cpp | 12 +- plugins/WinVST/GrooveWear/GrooveWear.cpp | 4 +- plugins/WinVST/GrooveWear/GrooveWear.h | 4 +- plugins/WinVST/GrooveWear/GrooveWearProc.cpp | 118 +- .../GuitarConditioner/GuitarConditioner.cpp | 4 +- .../GuitarConditioner/GuitarConditioner.h | 4 +- .../GuitarConditionerProc.cpp | 134 +- plugins/WinVST/HardVacuum/HardVacuum.cpp | 4 +- plugins/WinVST/HardVacuum/HardVacuum.h | 4 +- plugins/WinVST/HardVacuum/HardVacuumProc.cpp | 118 +- plugins/WinVST/HermeTrim/HermeTrim.cpp | 4 +- plugins/WinVST/HermeTrim/HermeTrim.h | 4 +- plugins/WinVST/HermeTrim/HermeTrimProc.cpp | 126 +- plugins/WinVST/Hermepass/Hermepass.cpp | 4 +- plugins/WinVST/Hermepass/Hermepass.h | 4 +- plugins/WinVST/Hermepass/HermepassProc.cpp | 126 +- .../HighGlossDither/HighGlossDitherProc.cpp | 88 +- plugins/WinVST/HighImpact/HighImpact.cpp | 4 +- plugins/WinVST/HighImpact/HighImpact.h | 4 +- plugins/WinVST/HighImpact/HighImpactProc.cpp | 126 +- plugins/WinVST/Highpass/Highpass.cpp | 4 +- plugins/WinVST/Highpass/Highpass.h | 4 +- plugins/WinVST/Highpass/HighpassProc.cpp | 110 +- plugins/WinVST/Highpass2/Highpass2Proc.cpp | 16 +- plugins/WinVST/Holt/Holt.h | 32 +- plugins/WinVST/Holt/HoltProc.cpp | 24 +- plugins/WinVST/Hombre/Hombre.cpp | 4 +- plugins/WinVST/Hombre/Hombre.h | 4 +- plugins/WinVST/Hombre/HombreProc.cpp | 118 +- plugins/WinVST/Hull/Hull.h | 8 +- plugins/WinVST/Hull/HullProc.cpp | 68 +- plugins/WinVST/HypersonX/HypersonXProc.cpp | 2 +- plugins/WinVST/Hypersonic/HypersonicProc.cpp | 2 +- plugins/WinVST/Infinity/Infinity.h | 6 +- plugins/WinVST/Infinity/InfinityProc.cpp | 72 +- plugins/WinVST/Infinity2/Infinity2.h | 6 +- plugins/WinVST/Infinity2/Infinity2Proc.cpp | 72 +- plugins/WinVST/Infrasonic/Infrasonic.h | 10 +- plugins/WinVST/Infrasonic/InfrasonicProc.cpp | 16 +- plugins/WinVST/Interstage/Interstage.h | 4 +- plugins/WinVST/Interstage/InterstageProc.cpp | 16 +- plugins/WinVST/IronOxide5/IronOxide5.cpp | 4 +- plugins/WinVST/IronOxide5/IronOxide5.h | 4 +- plugins/WinVST/IronOxide5/IronOxide5Proc.cpp | 118 +- .../IronOxideClassic/IronOxideClassic.cpp | 4 +- .../IronOxideClassic/IronOxideClassic.h | 4 +- .../IronOxideClassic/IronOxideClassicProc.cpp | 118 +- .../IronOxideClassic2/IronOxideClassic2.h | 4 +- .../IronOxideClassic2Proc.cpp | 40 +- plugins/WinVST/Isolator/Isolator.h | 6 +- plugins/WinVST/Isolator/IsolatorProc.cpp | 24 +- plugins/WinVST/Logical4/Logical4.cpp | 4 +- plugins/WinVST/Logical4/Logical4Proc.cpp | 118 +- plugins/WinVST/Loud/LoudProc.cpp | 8 +- plugins/WinVST/Lowpass/Lowpass.cpp | 4 +- plugins/WinVST/Lowpass/Lowpass.h | 4 +- plugins/WinVST/Lowpass/LowpassProc.cpp | 110 +- plugins/WinVST/Lowpass2/Lowpass2Proc.cpp | 16 +- plugins/WinVST/Luxor/LuxorProc.cpp | 8 +- plugins/WinVST/MV/MVProc.cpp | 8 +- plugins/WinVST/MackEQ/MackEQ.h | 32 +- plugins/WinVST/MackEQ/MackEQProc.cpp | 64 +- plugins/WinVST/Mackity/Mackity.h | 12 +- plugins/WinVST/Mackity/MackityProc.cpp | 32 +- plugins/WinVST/MatrixVerb/MatrixVerb.h | 6 +- plugins/WinVST/MatrixVerb/MatrixVerbProc.cpp | 72 +- plugins/WinVST/Melt/Melt.cpp | 4 +- plugins/WinVST/Melt/Melt.h | 4 +- plugins/WinVST/Melt/MeltProc.cpp | 126 +- plugins/WinVST/MidSide/MidSide.cpp | 4 +- plugins/WinVST/MidSide/MidSide.h | 4 +- plugins/WinVST/MidSide/MidSideProc.cpp | 100 +- plugins/WinVST/MoNoam/MoNoamProc.cpp | 16 +- plugins/WinVST/Mojo/MojoProc.cpp | 12 +- plugins/WinVST/Monitoring/Monitoring.h | 8 +- plugins/WinVST/Monitoring/MonitoringProc.cpp | 72 +- plugins/WinVST/Monitoring2/Monitoring2.h | 2 +- .../WinVST/Monitoring2/Monitoring2Proc.cpp | 48 +- .../MultiBandDistortionProc.cpp | 24 +- plugins/WinVST/NC-17/NCSeventeen.cpp | 4 +- plugins/WinVST/NC-17/NCSeventeen.h | 4 +- plugins/WinVST/NC-17/NCSeventeenProc.cpp | 118 +- plugins/WinVST/NCSeventeen/NCSeventeen.h | 8 +- .../WinVST/NCSeventeen/NCSeventeenProc.cpp | 96 +- .../NaturalizeDither/NaturalizeDitherProc.cpp | 88 +- plugins/WinVST/Neverland/NeverlandProc.cpp | 8 +- plugins/WinVST/Nikola/NikolaProc.cpp | 16 +- plugins/WinVST/NodeDither/NodeDitherProc.cpp | 88 +- plugins/WinVST/Noise/Noise.cpp | 4 +- plugins/WinVST/Noise/Noise.h | 4 +- plugins/WinVST/Noise/NoiseProc.cpp | 118 +- .../WinVST/NonlinearSpace/NonlinearSpace.cpp | 4 +- .../WinVST/NonlinearSpace/NonlinearSpace.h | 4 +- .../NonlinearSpace/NonlinearSpaceProc.cpp | 126 +- .../NotJustAnotherCD/NotJustAnotherCD.h | 4 +- .../NotJustAnotherCD/NotJustAnotherCDProc.cpp | 88 +- .../NotJustAnotherDither.h | 4 +- .../NotJustAnotherDitherProc.cpp | 34 +- .../WinVST/OneCornerClip/OneCornerClip.cpp | 4 +- plugins/WinVST/OneCornerClip/OneCornerClip.h | 4 +- .../OneCornerClip/OneCornerClipProc.cpp | 118 +- plugins/WinVST/PDBuss/PDBuss.cpp | 4 +- plugins/WinVST/PDBuss/PDBuss.h | 4 +- plugins/WinVST/PDBuss/PDBussProc.cpp | 118 +- plugins/WinVST/PDChannel/PDChannel.cpp | 4 +- plugins/WinVST/PDChannel/PDChannel.h | 4 +- plugins/WinVST/PDChannel/PDChannelProc.cpp | 118 +- plugins/WinVST/Pafnuty/Pafnuty.cpp | 4 +- plugins/WinVST/Pafnuty/Pafnuty.h | 4 +- plugins/WinVST/Pafnuty/PafnutyProc.cpp | 146 +- plugins/WinVST/PaulDither/PaulDitherProc.cpp | 8 +- plugins/WinVST/PaulWide/PaulWideProc.cpp | 20 +- plugins/WinVST/PeaksOnly/PeaksOnlyProc.cpp | 8 +- plugins/WinVST/PhaseNudge/PhaseNudge.cpp | 4 +- plugins/WinVST/PhaseNudge/PhaseNudge.h | 4 +- plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp | 126 +- plugins/WinVST/PitchDelay/PitchDelay.h | 8 +- plugins/WinVST/PitchDelay/PitchDelayProc.cpp | 36 +- .../WinVST/PocketVerbs/PocketVerbsProc.cpp | 16 +- plugins/WinVST/Podcast/PodcastProc.cpp | 16 +- .../PodcastDeluxe/PodcastDeluxeProc.cpp | 8 +- plugins/WinVST/Point/Point.cpp | 4 +- plugins/WinVST/Point/Point.h | 4 +- plugins/WinVST/Point/PointProc.cpp | 118 +- plugins/WinVST/Pop/Pop.h | 24 +- plugins/WinVST/Pop/PopProc.cpp | 36 +- plugins/WinVST/PowerSag/PowerSag.cpp | 4 +- plugins/WinVST/PowerSag/PowerSag.h | 4 +- plugins/WinVST/PowerSag/PowerSagProc.cpp | 118 +- plugins/WinVST/PowerSag2/PowerSag2Proc.cpp | 16 +- plugins/WinVST/Precious/PreciousProc.cpp | 8 +- plugins/WinVST/Preponderant/Preponderant.h | 34 +- .../WinVST/Preponderant/PreponderantProc.cpp | 64 +- plugins/WinVST/Pressure4/Pressure4.cpp | 4 +- plugins/WinVST/Pressure4/Pressure4.h | 4 +- plugins/WinVST/Pressure4/Pressure4Proc.cpp | 122 +- plugins/WinVST/Pressure5/Pressure5.h | 12 +- plugins/WinVST/Pressure5/Pressure5Proc.cpp | 32 +- plugins/WinVST/PurestAir/PurestAir.h | 24 +- plugins/WinVST/PurestAir/PurestAirProc.cpp | 16 +- .../PurestConsole2Buss/PurestConsole2Buss.h | 2 +- .../PurestConsole2BussProc.cpp | 28 +- .../PurestConsole2Channel.h | 2 +- .../PurestConsole2ChannelProc.cpp | 28 +- .../PurestConsoleBuss/PurestConsoleBuss.cpp | 4 +- .../PurestConsoleBuss/PurestConsoleBuss.h | 4 +- .../PurestConsoleBussProc.cpp | 118 +- .../PurestConsoleChannel.cpp | 4 +- .../PurestConsoleChannel.h | 4 +- .../PurestConsoleChannelProc.cpp | 118 +- plugins/WinVST/PurestDrive/PurestDrive.cpp | 4 +- plugins/WinVST/PurestDrive/PurestDrive.h | 4 +- .../WinVST/PurestDrive/PurestDriveProc.cpp | 118 +- plugins/WinVST/PurestEcho/PurestEcho.cpp | 4 +- plugins/WinVST/PurestEcho/PurestEcho.h | 4 +- plugins/WinVST/PurestEcho/PurestEchoProc.cpp | 118 +- plugins/WinVST/PurestFade/PurestFadeProc.cpp | 24 +- plugins/WinVST/PurestGain/PurestGain.cpp | 4 +- plugins/WinVST/PurestGain/PurestGain.h | 4 +- plugins/WinVST/PurestGain/PurestGainProc.cpp | 92 +- .../WinVST/PurestSquish/PurestSquishProc.cpp | 32 +- plugins/WinVST/PurestWarm/PurestWarm.cpp | 4 +- plugins/WinVST/PurestWarm/PurestWarm.h | 4 +- plugins/WinVST/PurestWarm/PurestWarmProc.cpp | 104 +- plugins/WinVST/Pyewacket/Pyewacket.cpp | 4 +- plugins/WinVST/Pyewacket/Pyewacket.h | 4 +- plugins/WinVST/Pyewacket/PyewacketProc.cpp | 134 +- .../WinVST/RawGlitters/RawGlittersProc.cpp | 8 +- plugins/WinVST/RawTimbers/RawTimbersProc.cpp | 8 +- plugins/WinVST/Recurve/Recurve.h | 2 +- plugins/WinVST/Recurve/RecurveProc.cpp | 8 +- plugins/WinVST/Remap/RemapProc.cpp | 32 +- plugins/WinVST/ResEQ/ResEQProc.cpp | 16 +- plugins/WinVST/Reverb/Reverb.h | 6 +- plugins/WinVST/Reverb/ReverbProc.cpp | 72 +- plugins/WinVST/Righteous4/Righteous4.cpp | 4 +- plugins/WinVST/Righteous4/Righteous4.h | 8 +- plugins/WinVST/Righteous4/Righteous4Proc.cpp | 130 +- plugins/WinVST/SideDull/SideDull.cpp | 4 +- plugins/WinVST/SideDull/SideDull.h | 4 +- plugins/WinVST/SideDull/SideDullProc.cpp | 122 +- plugins/WinVST/Sidepass/Sidepass.cpp | 4 +- plugins/WinVST/Sidepass/Sidepass.h | 4 +- plugins/WinVST/Sidepass/SidepassProc.cpp | 122 +- .../SingleEndedTriode/SingleEndedTriode.cpp | 4 +- .../SingleEndedTriode/SingleEndedTriode.h | 4 +- .../SingleEndedTriodeProc.cpp | 130 +- plugins/WinVST/Slew/SlewProc.cpp | 80 +- plugins/WinVST/Slew2/Slew2Proc.cpp | 80 +- plugins/WinVST/Slew3/Slew3Proc.cpp | 8 +- plugins/WinVST/SlewOnly/SlewOnlyProc.cpp | 96 +- plugins/WinVST/Smooth/SmoothProc.cpp | 16 +- plugins/WinVST/SoftGate/SoftGateProc.cpp | 8 +- .../SpatializeDither/SpatializeDitherProc.cpp | 8 +- plugins/WinVST/Spiral/SpiralProc.cpp | 8 +- plugins/WinVST/Spiral2/Spiral2.h | 12 +- plugins/WinVST/Spiral2/Spiral2Proc.cpp | 24 +- plugins/WinVST/Srsly/Srsly.h | 18 +- plugins/WinVST/Srsly/SrslyProc.cpp | 112 +- plugins/WinVST/Srsly2/Srsly2.h | 18 +- plugins/WinVST/Srsly2/Srsly2Proc.cpp | 112 +- plugins/WinVST/StarChild/StarChild.cpp | 4 +- plugins/WinVST/StarChild/StarChild.h | 4 +- plugins/WinVST/StarChild/StarChildProc.cpp | 110 +- plugins/WinVST/StereoFX/StereoFX.cpp | 4 +- plugins/WinVST/StereoFX/StereoFX.h | 4 +- plugins/WinVST/StereoFX/StereoFXProc.cpp | 126 +- plugins/WinVST/StudioTan/StudioTan.h | 16 +- plugins/WinVST/StudioTan/StudioTanProc.cpp | 44 +- plugins/WinVST/SubsOnly/SubsOnlyProc.cpp | 88 +- plugins/WinVST/Surge/Surge.cpp | 4 +- plugins/WinVST/Surge/Surge.h | 14 +- plugins/WinVST/Surge/SurgeProc.cpp | 126 +- plugins/WinVST/SurgeTide/SurgeTide.cpp | 4 +- plugins/WinVST/SurgeTide/SurgeTide.h | 10 +- plugins/WinVST/SurgeTide/SurgeTideProc.cpp | 126 +- plugins/WinVST/Swell/Swell.cpp | 4 +- plugins/WinVST/Swell/Swell.h | 8 +- plugins/WinVST/Swell/SwellProc.cpp | 126 +- plugins/WinVST/TPDFDither/TPDFDitherProc.cpp | 8 +- plugins/WinVST/TPDFWide/TPDFWideProc.cpp | 16 +- plugins/WinVST/Tape/Tape.h | 20 +- plugins/WinVST/Tape/TapeProc.cpp | 48 +- plugins/WinVST/TapeDelay/TapeDelay.cpp | 4 +- plugins/WinVST/TapeDelay/TapeDelay.h | 4 +- plugins/WinVST/TapeDelay/TapeDelayProc.cpp | 38 +- plugins/WinVST/TapeDelay2/TapeDelay2.h | 8 +- plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp | 36 +- plugins/WinVST/TapeDither/TapeDitherProc.cpp | 8 +- plugins/WinVST/TapeDust/TapeDust.cpp | 4 +- plugins/WinVST/TapeDust/TapeDust.h | 4 +- plugins/WinVST/TapeDust/TapeDustProc.cpp | 118 +- plugins/WinVST/TapeFat/TapeFat.cpp | 4 +- plugins/WinVST/TapeFat/TapeFat.h | 4 +- plugins/WinVST/TapeFat/TapeFatProc.cpp | 38 +- plugins/WinVST/Thunder/Thunder.cpp | 4 +- plugins/WinVST/Thunder/Thunder.h | 4 +- plugins/WinVST/Thunder/ThunderProc.cpp | 118 +- plugins/WinVST/ToTape5/ToTape5.cpp | 4 +- plugins/WinVST/ToTape5/ToTape5.h | 4 +- plugins/WinVST/ToTape5/ToTape5Proc.cpp | 122 +- plugins/WinVST/ToTape6/ToTape6.h | 20 +- plugins/WinVST/ToTape6/ToTape6Proc.cpp | 64 +- plugins/WinVST/ToVinyl4/ToVinyl4.cpp | 4 +- plugins/WinVST/ToVinyl4/ToVinyl4.h | 4 +- plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp | 110 +- plugins/WinVST/ToneSlant/ToneSlant.cpp | 4 +- plugins/WinVST/ToneSlant/ToneSlant.h | 4 +- plugins/WinVST/ToneSlant/ToneSlantProc.cpp | 110 +- plugins/WinVST/TransDesk/TransDesk.cpp | 4 +- plugins/WinVST/TransDesk/TransDesk.h | 12 +- plugins/WinVST/TransDesk/TransDeskProc.cpp | 126 +- .../WinVST/TremoSquare/TremoSquareProc.cpp | 16 +- plugins/WinVST/Tremolo/Tremolo.cpp | 4 +- plugins/WinVST/Tremolo/Tremolo.h | 4 +- plugins/WinVST/Tremolo/TremoloProc.cpp | 126 +- .../WinVST/TripleSpread/TripleSpreadProc.cpp | 24 +- plugins/WinVST/Tube/Tube.h | 8 +- plugins/WinVST/Tube/TubeProc.cpp | 32 +- plugins/WinVST/Tube2/Tube2.h | 12 +- plugins/WinVST/Tube2/Tube2Proc.cpp | 48 +- plugins/WinVST/TubeDesk/TubeDesk.cpp | 4 +- plugins/WinVST/TubeDesk/TubeDesk.h | 12 +- plugins/WinVST/TubeDesk/TubeDeskProc.cpp | 126 +- plugins/WinVST/UltrasonX/UltrasonX.h | 2 +- plugins/WinVST/UltrasonX/UltrasonXProc.cpp | 28 +- plugins/WinVST/Ultrasonic/Ultrasonic.h | 10 +- plugins/WinVST/Ultrasonic/UltrasonicProc.cpp | 16 +- .../WinVST/UltrasonicLite/UltrasonicLite.h | 2 +- .../UltrasonicLite/UltrasonicLiteProc.cpp | 16 +- plugins/WinVST/UltrasonicMed/UltrasonicMed.h | 4 +- .../UltrasonicMed/UltrasonicMedProc.cpp | 16 +- plugins/WinVST/UnBox/UnBox.h | 24 +- plugins/WinVST/UnBox/UnBoxProc.cpp | 24 +- plugins/WinVST/VariMu/VariMu.cpp | 4 +- plugins/WinVST/VariMu/VariMu.h | 4 +- plugins/WinVST/VariMu/VariMuProc.cpp | 54 +- plugins/WinVST/Verbity/VerbityProc.cpp | 32 +- plugins/WinVST/Vibrato/VibratoProc.cpp | 8 +- .../WinVST/VinylDither/VinylDitherProc.cpp | 8 +- .../VoiceOfTheStarship/VoiceOfTheStarship.cpp | 4 +- .../VoiceOfTheStarship/VoiceOfTheStarship.h | 4 +- .../VoiceOfTheStarshipProc.cpp | 30 +- plugins/WinVST/VoiceTrick/VoiceTrickProc.cpp | 12 +- plugins/WinVST/Wider/Wider.cpp | 4 +- plugins/WinVST/Wider/Wider.h | 4 +- plugins/WinVST/Wider/WiderProc.cpp | 126 +- plugins/WinVST/XBandpass/XBandpass.h | 10 +- plugins/WinVST/XBandpass/XBandpassProc.cpp | 44 +- plugins/WinVST/XHighpass/XHighpass.h | 10 +- plugins/WinVST/XHighpass/XHighpassProc.cpp | 44 +- plugins/WinVST/XLowpass/XLowpass.h | 10 +- plugins/WinVST/XLowpass/XLowpassProc.cpp | 44 +- plugins/WinVST/XNotch/XNotch.h | 10 +- plugins/WinVST/XNotch/XNotchProc.cpp | 44 +- plugins/WinVST/XRegion/XRegion.h | 10 +- plugins/WinVST/XRegion/XRegionProc.cpp | 44 +- plugins/WinVST/YBandpass/YBandpass.h | 18 +- plugins/WinVST/YBandpass/YBandpassProc.cpp | 40 +- plugins/WinVST/YHighpass/YHighpass.h | 18 +- plugins/WinVST/YHighpass/YHighpassProc.cpp | 40 +- plugins/WinVST/YLowpass/YLowpass.h | 18 +- plugins/WinVST/YLowpass/YLowpassProc.cpp | 40 +- plugins/WinVST/YNotch/YNotch.h | 18 +- plugins/WinVST/YNotch/YNotchProc.cpp | 40 +- plugins/WinVST/ZBandpass/ZBandpass.h | 16 +- plugins/WinVST/ZBandpass/ZBandpassProc.cpp | 44 +- plugins/WinVST/ZBandpass2/ZBandpass2.h | 28 +- plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp | 64 +- plugins/WinVST/ZHighpass/ZHighpass.h | 16 +- plugins/WinVST/ZHighpass/ZHighpassProc.cpp | 44 +- plugins/WinVST/ZHighpass2/ZHighpass2.h | 28 +- plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp | 64 +- plugins/WinVST/ZLowpass/ZLowpass.h | 16 +- plugins/WinVST/ZLowpass/ZLowpassProc.cpp | 44 +- plugins/WinVST/ZLowpass2/ZLowpass2.h | 28 +- plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp | 64 +- plugins/WinVST/ZNotch/ZNotch.h | 16 +- plugins/WinVST/ZNotch/ZNotchProc.cpp | 44 +- plugins/WinVST/ZNotch2/ZNotch2.h | 28 +- plugins/WinVST/ZNotch2/ZNotch2Proc.cpp | 64 +- plugins/WinVST/curve/curve.h | 2 +- plugins/WinVST/curve/curveProc.cpp | 8 +- plugins/WinVST/uLawDecode/uLawDecode.cpp | 4 +- plugins/WinVST/uLawDecode/uLawDecode.h | 4 +- plugins/WinVST/uLawDecode/uLawDecodeProc.cpp | 38 +- plugins/WinVST/uLawEncode/uLawEncode.cpp | 4 +- plugins/WinVST/uLawEncode/uLawEncode.h | 4 +- plugins/WinVST/uLawEncode/uLawEncodeProc.cpp | 38 +- 3302 files changed, 52490 insertions(+), 63509 deletions(-) create mode 100755 plugins/MacSignedAU/Cabs/Cabs.cpp create mode 100755 plugins/MacSignedAU/Cabs/Cabs.exp create mode 100755 plugins/MacSignedAU/Cabs/Cabs.h create mode 100755 plugins/MacSignedAU/Cabs/Cabs.r create mode 100644 plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.mode1v3 create mode 100644 plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser create mode 100644 plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 create mode 100644 plugins/MacSignedAU/Cabs/Cabs.xcodeproj/project.pbxproj create mode 100755 plugins/MacSignedAU/Cabs/CabsVersion.h create mode 100755 plugins/MacSignedAU/Cabs/Cabs_Prefix.pch create mode 100644 plugins/MacSignedAU/Cabs/English.lproj/InfoPlist.strings create mode 100644 plugins/MacSignedAU/Cabs/Info.plist create mode 100644 plugins/MacSignedAU/Cabs/version.plist create mode 100644 plugins/MacSignedAU/Isolator2/English.lproj/InfoPlist.strings create mode 100644 plugins/MacSignedAU/Isolator2/Info.plist create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.cpp create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.exp create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.h create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.r create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.mode1v3 create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/project.pbxproj create mode 100644 plugins/MacSignedAU/Isolator2/Isolator2Version.h create mode 100644 plugins/MacSignedAU/Isolator2/version.plist create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 create mode 100755 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.pbxproj create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.mode1v3 create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.pbxuser create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme create mode 100755 plugins/MacSignedVST/Cabs/mac/Info.plist create mode 100755 plugins/MacSignedVST/Cabs/mac/PkgInfo create mode 100755 plugins/MacSignedVST/Cabs/mac/xcode_vst_prefix.h create mode 100755 plugins/MacSignedVST/Cabs/source/Cabs.cpp create mode 100755 plugins/MacSignedVST/Cabs/source/Cabs.h create mode 100755 plugins/MacSignedVST/Cabs/source/CabsProc.cpp mode change 100644 => 100755 plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/xcshareddata/xcschemes/Console7Buss.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/xcshareddata/xcschemes/Console7Channel.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.pbxuser mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.perspectivev3 mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.mode1v3 mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.pbxuser mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcshareddata/xcschemes/Galactic.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist mode change 100644 => 100755 plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 create mode 100755 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.pbxproj create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.mode1v3 create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.pbxuser create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme create mode 100755 plugins/MacSignedVST/Isolator2/mac/Info.plist create mode 100755 plugins/MacSignedVST/Isolator2/mac/PkgInfo create mode 100755 plugins/MacSignedVST/Isolator2/mac/xcode_vst_prefix.h create mode 100755 plugins/MacSignedVST/Isolator2/source/Isolator2.cpp create mode 100755 plugins/MacSignedVST/Isolator2/source/Isolator2.h create mode 100755 plugins/MacSignedVST/Isolator2/source/Isolator2Proc.cpp mode change 100644 => 100755 plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/xcshareddata/xcschemes/Monitoring.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.pbxuser mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.perspectivev3 mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.mode1v3 mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.pbxuser mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcshareddata/xcschemes/Pressure5.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist mode change 100644 => 100755 plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/xcshareddata/xcschemes/Srsly2.xcscheme mode change 100644 => 100755 plugins/MacSignedVST/Verbity/Verbity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 plugins/MacSignedVST/Verbity/Verbity.xcodeproj/xcshareddata/xcschemes/Verbity.xcscheme create mode 100644 plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/plugins/LinuxVST/src/ADClip7/ADClip7.cpp b/plugins/LinuxVST/src/ADClip7/ADClip7.cpp index 7ebc8179d..9f8bc2c88 100755 --- a/plugins/LinuxVST/src/ADClip7/ADClip7.cpp +++ b/plugins/LinuxVST/src/ADClip7/ADClip7.cpp @@ -30,8 +30,8 @@ ADClip7::ADClip7(audioMasterCallback audioMaster) : iirLowsBL = 0.0; iirLowsBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ADClip7/ADClip7.h b/plugins/LinuxVST/src/ADClip7/ADClip7.h index f0cde6cf7..6a619cd09 100755 --- a/plugins/LinuxVST/src/ADClip7/ADClip7.h +++ b/plugins/LinuxVST/src/ADClip7/ADClip7.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; float bL[22200]; float bR[22200]; int gcount; @@ -69,8 +69,8 @@ private: double iirLowsAR; double iirLowsBL; double iirLowsBR; - long double refclipL; - long double refclipR; + double refclipL; + double refclipR; float A; float B; diff --git a/plugins/LinuxVST/src/ADClip7/ADClip7Proc.cpp b/plugins/LinuxVST/src/ADClip7/ADClip7Proc.cpp index abc9909d5..db5a449b0 100755 --- a/plugins/LinuxVST/src/ADClip7/ADClip7Proc.cpp +++ b/plugins/LinuxVST/src/ADClip7/ADClip7Proc.cpp @@ -17,8 +17,8 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -28,7 +28,7 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -55,51 +55,15 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -447,14 +411,14 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,8 +440,8 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -487,7 +451,7 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -514,52 +478,16 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -907,16 +835,14 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ADT/ADTProc.cpp b/plugins/LinuxVST/src/ADT/ADTProc.cpp index 828579d06..555f0877e 100755 --- a/plugins/LinuxVST/src/ADT/ADTProc.cpp +++ b/plugins/LinuxVST/src/ADT/ADTProc.cpp @@ -29,8 +29,8 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.cpp index 9b8422125..a96f32802 100755 --- a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.cpp +++ b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.cpp @@ -57,8 +57,8 @@ AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.h b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.h index 40cfab209..862629b6b 100755 --- a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.h +++ b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClip.h @@ -115,8 +115,8 @@ private: double RiirSampleD; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClipProc.cpp b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClipProc.cpp index cc282b6dd..6ddecdf61 100755 --- a/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClipProc.cpp +++ b/plugins/LinuxVST/src/AQuickVoiceClip/AQuickVoiceClipProc.cpp @@ -42,51 +42,15 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -407,14 +371,14 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); @@ -474,51 +438,15 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -839,16 +767,14 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); diff --git a/plugins/LinuxVST/src/Acceleration/Acceleration.cpp b/plugins/LinuxVST/src/Acceleration/Acceleration.cpp index b2721d922..a2d27752d 100755 --- a/plugins/LinuxVST/src/Acceleration/Acceleration.cpp +++ b/plugins/LinuxVST/src/Acceleration/Acceleration.cpp @@ -23,8 +23,8 @@ Acceleration::Acceleration(audioMasterCallback audioMaster) : o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Acceleration/Acceleration.h b/plugins/LinuxVST/src/Acceleration/Acceleration.h index 02a3760ba..4e4dea014 100755 --- a/plugins/LinuxVST/src/Acceleration/Acceleration.h +++ b/plugins/LinuxVST/src/Acceleration/Acceleration.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double ataLastOutL; double s1L; diff --git a/plugins/LinuxVST/src/Acceleration/AccelerationProc.cpp b/plugins/LinuxVST/src/Acceleration/AccelerationProc.cpp index 0151dbeb1..050c433ca 100755 --- a/plugins/LinuxVST/src/Acceleration/AccelerationProc.cpp +++ b/plugins/LinuxVST/src/Acceleration/AccelerationProc.cpp @@ -29,51 +29,15 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -132,14 +96,14 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -173,51 +137,15 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -276,16 +204,14 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Acceleration2/Acceleration2.h b/plugins/LinuxVST/src/Acceleration2/Acceleration2.h index e16c92d77..ee3a7e56f 100755 --- a/plugins/LinuxVST/src/Acceleration2/Acceleration2.h +++ b/plugins/LinuxVST/src/Acceleration2/Acceleration2.h @@ -64,8 +64,8 @@ private: double m1R; double m2R; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Acceleration2/Acceleration2Proc.cpp b/plugins/LinuxVST/src/Acceleration2/Acceleration2Proc.cpp index 575e70a23..49ece8844 100755 --- a/plugins/LinuxVST/src/Acceleration2/Acceleration2Proc.cpp +++ b/plugins/LinuxVST/src/Acceleration2/Acceleration2Proc.cpp @@ -46,14 +46,14 @@ void Acceleration2::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -151,14 +151,14 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -199,12 +199,12 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Air/Air.cpp b/plugins/LinuxVST/src/Air/Air.cpp index ea52c265c..5ad55b387 100755 --- a/plugins/LinuxVST/src/Air/Air.cpp +++ b/plugins/LinuxVST/src/Air/Air.cpp @@ -61,8 +61,8 @@ Air::Air(audioMasterCallback audioMaster) : D = 0.0; E = 1.0; F = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Air/Air.h b/plugins/LinuxVST/src/Air/Air.h index a713cf275..9432f792b 100755 --- a/plugins/LinuxVST/src/Air/Air.h +++ b/plugins/LinuxVST/src/Air/Air.h @@ -100,8 +100,8 @@ private: bool flop; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Air/AirProc.cpp b/plugins/LinuxVST/src/Air/AirProc.cpp index f5eb39fde..9e72d87e2 100755 --- a/plugins/LinuxVST/src/Air/AirProc.cpp +++ b/plugins/LinuxVST/src/Air/AirProc.cpp @@ -23,8 +23,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -34,44 +34,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -257,14 +221,14 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -292,8 +256,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -303,44 +267,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -526,16 +454,14 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Air2/Air2.h b/plugins/LinuxVST/src/Air2/Air2.h index b50e7c919..5fa7a5325 100644 --- a/plugins/LinuxVST/src/Air2/Air2.h +++ b/plugins/LinuxVST/src/Air2/Air2.h @@ -106,7 +106,7 @@ private: bool flipB; bool flop; int count; - long double postsine; + double postsine; float A; diff --git a/plugins/LinuxVST/src/Air2/Air2Proc.cpp b/plugins/LinuxVST/src/Air2/Air2Proc.cpp index 16b6ae552..e07abffda 100644 --- a/plugins/LinuxVST/src/Air2/Air2Proc.cpp +++ b/plugins/LinuxVST/src/Air2/Air2Proc.cpp @@ -44,17 +44,17 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -190,7 +190,7 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -333,17 +333,17 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -479,7 +479,7 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -568,12 +568,12 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Apicolypse/ApicolypseProc.cpp b/plugins/LinuxVST/src/Apicolypse/ApicolypseProc.cpp index b6cdb8513..bc9e99ab5 100755 --- a/plugins/LinuxVST/src/Apicolypse/ApicolypseProc.cpp +++ b/plugins/LinuxVST/src/Apicolypse/ApicolypseProc.cpp @@ -37,8 +37,8 @@ void Apicolypse::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -213,8 +213,8 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBuss.h b/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBuss.h index 79a5d23d8..ebaf0919c 100755 --- a/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBuss.h +++ b/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBuss.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBussProc.cpp b/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBussProc.cpp index 16d7a3198..add056764 100755 --- a/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBussProc.cpp +++ b/plugins/LinuxVST/src/AtmosphereBuss/AtmosphereBussProc.cpp @@ -18,10 +18,10 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -249,14 +249,14 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -279,10 +279,10 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -510,16 +510,14 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannel.h b/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannel.h index 1e95258b9..4ed29b1c1 100755 --- a/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannel.h +++ b/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannel.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannelProc.cpp b/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannelProc.cpp index bbdf44cc9..763853004 100755 --- a/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannelProc.cpp +++ b/plugins/LinuxVST/src/AtmosphereChannel/AtmosphereChannelProc.cpp @@ -18,10 +18,10 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -244,14 +244,14 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -274,10 +274,10 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -500,16 +500,14 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Aura/Aura.cpp b/plugins/LinuxVST/src/Aura/Aura.cpp index 8663d3bb1..b26d8a86f 100755 --- a/plugins/LinuxVST/src/Aura/Aura.cpp +++ b/plugins/LinuxVST/src/Aura/Aura.cpp @@ -24,8 +24,8 @@ Aura::Aura(audioMasterCallback audioMaster) : lastSampleR = 0.0; previousVelocityR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Aura/Aura.h b/plugins/LinuxVST/src/Aura/Aura.h index 22d4653d0..e0feff0c2 100755 --- a/plugins/LinuxVST/src/Aura/Aura.h +++ b/plugins/LinuxVST/src/Aura/Aura.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; + double lastSampleL; double previousVelocityL; - long double lastSampleR; + double lastSampleR; double previousVelocityR; double bL[21]; diff --git a/plugins/LinuxVST/src/Aura/AuraProc.cpp b/plugins/LinuxVST/src/Aura/AuraProc.cpp index 089a8731b..e6d4f4e7a 100755 --- a/plugins/LinuxVST/src/Aura/AuraProc.cpp +++ b/plugins/LinuxVST/src/Aura/AuraProc.cpp @@ -27,8 +27,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -83,44 +83,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -208,14 +172,14 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,8 +211,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -303,44 +267,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -428,16 +356,14 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/AutoPan/AutoPanProc.cpp b/plugins/LinuxVST/src/AutoPan/AutoPanProc.cpp index 8301a2b25..632f9bfaa 100755 --- a/plugins/LinuxVST/src/AutoPan/AutoPanProc.cpp +++ b/plugins/LinuxVST/src/AutoPan/AutoPanProc.cpp @@ -25,12 +25,12 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -44,8 +44,8 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -95,12 +95,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -114,8 +114,8 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -129,12 +129,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/AverMatrix/AverMatrixProc.cpp b/plugins/LinuxVST/src/AverMatrix/AverMatrixProc.cpp index 381ea9c35..af0105057 100755 --- a/plugins/LinuxVST/src/AverMatrix/AverMatrixProc.cpp +++ b/plugins/LinuxVST/src/AverMatrix/AverMatrixProc.cpp @@ -48,15 +48,15 @@ void AverMatrix::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; @@ -140,15 +140,15 @@ void AverMatrix::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; diff --git a/plugins/LinuxVST/src/Average/Average.cpp b/plugins/LinuxVST/src/Average/Average.cpp index 2f39ca1db..64f301f56 100755 --- a/plugins/LinuxVST/src/Average/Average.cpp +++ b/plugins/LinuxVST/src/Average/Average.cpp @@ -17,8 +17,8 @@ Average::Average(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Average/Average.h b/plugins/LinuxVST/src/Average/Average.h index 9932e99d9..1cdc884ba 100755 --- a/plugins/LinuxVST/src/Average/Average.h +++ b/plugins/LinuxVST/src/Average/Average.h @@ -57,8 +57,8 @@ private: double f[11]; double bR[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Average/AverageProc.cpp b/plugins/LinuxVST/src/Average/AverageProc.cpp index 17f478362..fce6a3af4 100755 --- a/plugins/LinuxVST/src/Average/AverageProc.cpp +++ b/plugins/LinuxVST/src/Average/AverageProc.cpp @@ -57,44 +57,8 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -151,14 +115,14 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //in the floating point system. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -218,44 +182,8 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -311,16 +239,14 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/BassAmp/BassAmpProc.cpp b/plugins/LinuxVST/src/BassAmp/BassAmpProc.cpp index a84fcce3a..025fa038a 100755 --- a/plugins/LinuxVST/src/BassAmp/BassAmpProc.cpp +++ b/plugins/LinuxVST/src/BassAmp/BassAmpProc.cpp @@ -36,8 +36,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-37) LinputSample = fpd * 1.18e-37; if (fabs(RinputSample)<1.18e-37) RinputSample = fpd * 1.18e-37; @@ -408,8 +408,8 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-43) LinputSample = fpd * 1.18e-43; if (fabs(RinputSample)<1.18e-43) RinputSample = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/BassDrive/BassDriveProc.cpp b/plugins/LinuxVST/src/BassDrive/BassDriveProc.cpp index 3e199ea59..68f67e7f7 100755 --- a/plugins/LinuxVST/src/BassDrive/BassDriveProc.cpp +++ b/plugins/LinuxVST/src/BassDrive/BassDriveProc.cpp @@ -25,8 +25,8 @@ void BassDrive::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -349,8 +349,8 @@ void BassDrive::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/BassKit/BassKit.cpp b/plugins/LinuxVST/src/BassKit/BassKit.cpp index 008f045da..0eec1c5eb 100755 --- a/plugins/LinuxVST/src/BassKit/BassKit.cpp +++ b/plugins/LinuxVST/src/BassKit/BassKit.cpp @@ -68,8 +68,8 @@ BassKit::BassKit(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/BassKit/BassKit.h b/plugins/LinuxVST/src/BassKit/BassKit.h index f421d3d4d..c192cfa11 100755 --- a/plugins/LinuxVST/src/BassKit/BassKit.h +++ b/plugins/LinuxVST/src/BassKit/BassKit.h @@ -105,8 +105,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/BassKit/BassKitProc.cpp b/plugins/LinuxVST/src/BassKit/BassKitProc.cpp index 9199c82d3..3044c5cec 100755 --- a/plugins/LinuxVST/src/BassKit/BassKitProc.cpp +++ b/plugins/LinuxVST/src/BassKit/BassKitProc.cpp @@ -33,8 +33,8 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -204,14 +204,14 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,8 +249,8 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -420,16 +420,14 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Baxandall/Baxandall.h b/plugins/LinuxVST/src/Baxandall/Baxandall.h index 380e3d09f..a30751cfc 100755 --- a/plugins/LinuxVST/src/Baxandall/Baxandall.h +++ b/plugins/LinuxVST/src/Baxandall/Baxandall.h @@ -56,15 +56,15 @@ private: uint32_t fpd; //default stuff - long double trebleAL[9]; - long double trebleBL[9]; - long double bassAL[9]; - long double bassBL[9]; + double trebleAL[9]; + double trebleBL[9]; + double bassAL[9]; + double bassBL[9]; - long double trebleAR[9]; - long double trebleBR[9]; - long double bassAR[9]; - long double bassBR[9]; + double trebleAR[9]; + double trebleBR[9]; + double bassAR[9]; + double bassBR[9]; bool flip; float A; diff --git a/plugins/LinuxVST/src/Baxandall/BaxandallProc.cpp b/plugins/LinuxVST/src/Baxandall/BaxandallProc.cpp index 9f75cced2..f52cba8ec 100755 --- a/plugins/LinuxVST/src/Baxandall/BaxandallProc.cpp +++ b/plugins/LinuxVST/src/Baxandall/BaxandallProc.cpp @@ -45,8 +45,8 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -59,10 +59,10 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { @@ -182,8 +182,8 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -196,10 +196,10 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { diff --git a/plugins/LinuxVST/src/Beam/BeamProc.cpp b/plugins/LinuxVST/src/Beam/BeamProc.cpp index 5871eb5c1..15eda5357 100755 --- a/plugins/LinuxVST/src/Beam/BeamProc.cpp +++ b/plugins/LinuxVST/src/Beam/BeamProc.cpp @@ -35,8 +35,8 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Biquad/Biquad.h b/plugins/LinuxVST/src/Biquad/Biquad.h index 17993cd4c..2476d2595 100755 --- a/plugins/LinuxVST/src/Biquad/Biquad.h +++ b/plugins/LinuxVST/src/Biquad/Biquad.h @@ -55,7 +55,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[11]; //note that this stereo form doesn't require L and R forms! + double biquad[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Biquad/BiquadProc.cpp b/plugins/LinuxVST/src/Biquad/BiquadProc.cpp index 0dfbfe46f..cff2485a6 100755 --- a/plugins/LinuxVST/src/Biquad/BiquadProc.cpp +++ b/plugins/LinuxVST/src/Biquad/BiquadProc.cpp @@ -88,12 +88,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -101,16 +101,16 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -120,12 +120,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -245,12 +245,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -258,16 +258,16 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -277,12 +277,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/LinuxVST/src/Biquad2/Biquad2.h b/plugins/LinuxVST/src/Biquad2/Biquad2.h index 20c1d1ceb..1c715f1a7 100755 --- a/plugins/LinuxVST/src/Biquad2/Biquad2.h +++ b/plugins/LinuxVST/src/Biquad2/Biquad2.h @@ -56,7 +56,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; //note that this stereo form doesn't require L and R forms! + double biquad[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Biquad2/Biquad2Proc.cpp b/plugins/LinuxVST/src/Biquad2/Biquad2Proc.cpp index 837a072b8..9e9d6bce8 100755 --- a/plugins/LinuxVST/src/Biquad2/Biquad2Proc.cpp +++ b/plugins/LinuxVST/src/Biquad2/Biquad2Proc.cpp @@ -79,12 +79,12 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -134,10 +134,10 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -291,12 +291,12 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -346,10 +346,10 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; diff --git a/plugins/LinuxVST/src/BiquadDouble/BiquadDouble.h b/plugins/LinuxVST/src/BiquadDouble/BiquadDouble.h index 525d753a0..486a9b642 100755 --- a/plugins/LinuxVST/src/BiquadDouble/BiquadDouble.h +++ b/plugins/LinuxVST/src/BiquadDouble/BiquadDouble.h @@ -56,8 +56,8 @@ private: std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/BiquadDouble/BiquadDoubleProc.cpp b/plugins/LinuxVST/src/BiquadDouble/BiquadDoubleProc.cpp index c5318a700..055743d43 100755 --- a/plugins/LinuxVST/src/BiquadDouble/BiquadDoubleProc.cpp +++ b/plugins/LinuxVST/src/BiquadDouble/BiquadDoubleProc.cpp @@ -89,24 +89,24 @@ void BiquadDouble::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -238,24 +238,24 @@ void BiquadDouble::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalf.h b/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalf.h index cd9dacc2e..e3024989d 100755 --- a/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalf.h +++ b/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalf.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadAL[9]; - long double biquadAR[9]; - long double biquadBL[9]; - long double biquadBR[9]; + double biquadAL[9]; + double biquadAR[9]; + double biquadBL[9]; + double biquadBR[9]; bool flip; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalfProc.cpp b/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalfProc.cpp index e126dcf7e..87d9763c1 100755 --- a/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalfProc.cpp +++ b/plugins/LinuxVST/src/BiquadOneHalf/BiquadOneHalfProc.cpp @@ -87,19 +87,19 @@ void BiquadOneHalf::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { @@ -239,20 +239,20 @@ void BiquadOneHalf::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { diff --git a/plugins/LinuxVST/src/BiquadPlus/BiquadPlus.h b/plugins/LinuxVST/src/BiquadPlus/BiquadPlus.h index bec774331..0ef273e12 100644 --- a/plugins/LinuxVST/src/BiquadPlus/BiquadPlus.h +++ b/plugins/LinuxVST/src/BiquadPlus/BiquadPlus.h @@ -80,7 +80,7 @@ private: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/BiquadPlus/BiquadPlusProc.cpp b/plugins/LinuxVST/src/BiquadPlus/BiquadPlusProc.cpp index 34f5c68fb..b2ad19c4d 100644 --- a/plugins/LinuxVST/src/BiquadPlus/BiquadPlusProc.cpp +++ b/plugins/LinuxVST/src/BiquadPlus/BiquadPlusProc.cpp @@ -107,20 +107,20 @@ void BiquadPlus::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -239,20 +239,20 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -268,12 +268,12 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/BiquadTriple/BiquadTriple.h b/plugins/LinuxVST/src/BiquadTriple/BiquadTriple.h index acd55ebb6..b23660d14 100755 --- a/plugins/LinuxVST/src/BiquadTriple/BiquadTriple.h +++ b/plugins/LinuxVST/src/BiquadTriple/BiquadTriple.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/BiquadTriple/BiquadTripleProc.cpp b/plugins/LinuxVST/src/BiquadTriple/BiquadTripleProc.cpp index f6d97f74f..84ee1b7f5 100755 --- a/plugins/LinuxVST/src/BiquadTriple/BiquadTripleProc.cpp +++ b/plugins/LinuxVST/src/BiquadTriple/BiquadTripleProc.cpp @@ -90,24 +90,24 @@ void BiquadTriple::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -251,23 +251,23 @@ void BiquadTriple::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/LinuxVST/src/BitGlitter/BitGlitterProc.cpp b/plugins/LinuxVST/src/BitGlitter/BitGlitterProc.cpp index 288c269bf..38afa37d9 100755 --- a/plugins/LinuxVST/src/BitGlitter/BitGlitterProc.cpp +++ b/plugins/LinuxVST/src/BitGlitter/BitGlitterProc.cpp @@ -32,12 +32,12 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section @@ -68,7 +68,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -97,7 +97,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; @@ -252,12 +252,12 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section inputSampleL *= ingain; @@ -287,7 +287,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -316,7 +316,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; diff --git a/plugins/LinuxVST/src/Bite/Bite.cpp b/plugins/LinuxVST/src/Bite/Bite.cpp index c9d0fcbc2..1defea7df 100755 --- a/plugins/LinuxVST/src/Bite/Bite.cpp +++ b/plugins/LinuxVST/src/Bite/Bite.cpp @@ -34,8 +34,8 @@ Bite::Bite(audioMasterCallback audioMaster) : sampleHR = 0.0; sampleIR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Bite/Bite.h b/plugins/LinuxVST/src/Bite/Bite.h index 288ac7f80..895aab027 100755 --- a/plugins/LinuxVST/src/Bite/Bite.h +++ b/plugins/LinuxVST/src/Bite/Bite.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sampleAL; double sampleBL; diff --git a/plugins/LinuxVST/src/Bite/BiteProc.cpp b/plugins/LinuxVST/src/Bite/BiteProc.cpp index 64e0ac419..66747041e 100755 --- a/plugins/LinuxVST/src/Bite/BiteProc.cpp +++ b/plugins/LinuxVST/src/Bite/BiteProc.cpp @@ -50,44 +50,8 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -116,14 +80,14 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -178,44 +142,8 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -244,16 +172,14 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/BlockParty/BlockPartyProc.cpp b/plugins/LinuxVST/src/BlockParty/BlockPartyProc.cpp index 12c19d4a3..37c3a6545 100755 --- a/plugins/LinuxVST/src/BlockParty/BlockPartyProc.cpp +++ b/plugins/LinuxVST/src/BlockParty/BlockPartyProc.cpp @@ -29,8 +29,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); @@ -590,8 +590,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -629,8 +629,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/LinuxVST/src/BrassRider/BrassRiderProc.cpp b/plugins/LinuxVST/src/BrassRider/BrassRiderProc.cpp index 3acd7834c..449a965fc 100755 --- a/plugins/LinuxVST/src/BrassRider/BrassRiderProc.cpp +++ b/plugins/LinuxVST/src/BrassRider/BrassRiderProc.cpp @@ -21,8 +21,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -60,8 +60,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -70,7 +70,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -79,7 +79,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -102,7 +102,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); @@ -163,8 +163,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -202,8 +202,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -212,7 +212,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -221,7 +221,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -244,7 +244,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/LinuxVST/src/BrightAmbience/BrightAmbienceProc.cpp b/plugins/LinuxVST/src/BrightAmbience/BrightAmbienceProc.cpp index 63bfecbf8..dc4ecd233 100755 --- a/plugins/LinuxVST/src/BrightAmbience/BrightAmbienceProc.cpp +++ b/plugins/LinuxVST/src/BrightAmbience/BrightAmbienceProc.cpp @@ -23,8 +23,8 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -174,7 +174,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -315,7 +315,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; @@ -355,8 +355,8 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -506,7 +506,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -647,7 +647,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; diff --git a/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2.h b/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2.h index c49b14e20..860fe9551 100755 --- a/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2.h +++ b/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2.h @@ -64,9 +64,9 @@ private: int gcount; float pL[32768]; float pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; float A; float B; diff --git a/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2Proc.cpp b/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2Proc.cpp index 72b7adf6c..95daad017 100755 --- a/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2Proc.cpp +++ b/plugins/LinuxVST/src/BrightAmbience2/BrightAmbience2Proc.cpp @@ -22,14 +22,14 @@ void BrightAmbience2::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; @@ -90,14 +90,14 @@ void BrightAmbience2::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3.h b/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3.h index ab479927b..cd9a6abd0 100644 --- a/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3.h +++ b/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3.h @@ -62,10 +62,10 @@ private: int gcount; double pL[32768]; double pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3Proc.cpp b/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3Proc.cpp index 6c912ad33..dd6875d28 100644 --- a/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3Proc.cpp +++ b/plugins/LinuxVST/src/BrightAmbience3/BrightAmbience3Proc.cpp @@ -43,17 +43,17 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -67,7 +67,7 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -202,17 +202,17 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -226,7 +226,7 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -307,12 +307,12 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/BuildATPDF/BuildATPDFProc.cpp b/plugins/LinuxVST/src/BuildATPDF/BuildATPDFProc.cpp index dfea1258a..0b61354b3 100755 --- a/plugins/LinuxVST/src/BuildATPDF/BuildATPDFProc.cpp +++ b/plugins/LinuxVST/src/BuildATPDF/BuildATPDFProc.cpp @@ -32,44 +32,8 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -149,44 +113,8 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/LinuxVST/src/BussColors4/BussColors4.cpp b/plugins/LinuxVST/src/BussColors4/BussColors4.cpp index c7de380ea..731e1331f 100755 --- a/plugins/LinuxVST/src/BussColors4/BussColors4.cpp +++ b/plugins/LinuxVST/src/BussColors4/BussColors4.cpp @@ -44,8 +44,8 @@ BussColors4::BussColors4(audioMasterCallback audioMaster) : slowdynR = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/BussColors4/BussColors4.h b/plugins/LinuxVST/src/BussColors4/BussColors4.h index 6452555a5..694ce678b 100755 --- a/plugins/LinuxVST/src/BussColors4/BussColors4.h +++ b/plugins/LinuxVST/src/BussColors4/BussColors4.h @@ -68,8 +68,8 @@ private: double slowdynR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/BussColors4/BussColors4Proc.cpp b/plugins/LinuxVST/src/BussColors4/BussColors4Proc.cpp index b1b945144..983bcc510 100755 --- a/plugins/LinuxVST/src/BussColors4/BussColors4Proc.cpp +++ b/plugins/LinuxVST/src/BussColors4/BussColors4Proc.cpp @@ -32,8 +32,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -58,44 +58,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -792,14 +756,14 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -836,8 +800,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -862,44 +826,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1596,16 +1524,14 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ButterComp/ButterComp.cpp b/plugins/LinuxVST/src/ButterComp/ButterComp.cpp index b3123e2e2..deac8039a 100755 --- a/plugins/LinuxVST/src/ButterComp/ButterComp.cpp +++ b/plugins/LinuxVST/src/ButterComp/ButterComp.cpp @@ -26,8 +26,8 @@ ButterComp::ButterComp(audioMasterCallback audioMaster) : controlBnegR = 1.0; targetposR = 1.0; targetnegR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ButterComp/ButterComp.h b/plugins/LinuxVST/src/ButterComp/ButterComp.h index 5c9862b3e..12c693fe2 100755 --- a/plugins/LinuxVST/src/ButterComp/ButterComp.h +++ b/plugins/LinuxVST/src/ButterComp/ButterComp.h @@ -65,8 +65,8 @@ private: double controlBnegR; double targetposR; double targetnegR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ButterComp/ButterCompProc.cpp b/plugins/LinuxVST/src/ButterComp/ButterCompProc.cpp index d87030c41..06c02ad31 100755 --- a/plugins/LinuxVST/src/ButterComp/ButterCompProc.cpp +++ b/plugins/LinuxVST/src/ButterComp/ButterCompProc.cpp @@ -24,8 +24,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -34,8 +34,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -54,44 +54,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -178,14 +142,14 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -214,8 +178,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -224,8 +188,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -244,44 +208,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -368,16 +296,14 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ButterComp2/ButterComp2.cpp b/plugins/LinuxVST/src/ButterComp2/ButterComp2.cpp index 0484416d5..b7bf3f1c0 100755 --- a/plugins/LinuxVST/src/ButterComp2/ButterComp2.cpp +++ b/plugins/LinuxVST/src/ButterComp2/ButterComp2.cpp @@ -32,8 +32,8 @@ ButterComp2::ButterComp2(audioMasterCallback audioMaster) : A = 0.0; B = 0.5; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ButterComp2/ButterComp2.h b/plugins/LinuxVST/src/ButterComp2/ButterComp2.h index 188adb5c3..d1f8721c1 100755 --- a/plugins/LinuxVST/src/ButterComp2/ButterComp2.h +++ b/plugins/LinuxVST/src/ButterComp2/ButterComp2.h @@ -54,23 +54,23 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double controlAposL; - long double controlAnegL; - long double controlBposL; - long double controlBnegL; - long double targetposL; - long double targetnegL; - long double lastOutputL; - long double controlAposR; - long double controlAnegR; - long double controlBposR; - long double controlBnegR; - long double targetposR; - long double targetnegR; - long double lastOutputR; + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double lastOutputL; + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double lastOutputR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ButterComp2/ButterComp2Proc.cpp b/plugins/LinuxVST/src/ButterComp2/ButterComp2Proc.cpp index 67a63675c..f5520a44a 100755 --- a/plugins/LinuxVST/src/ButterComp2/ButterComp2Proc.cpp +++ b/plugins/LinuxVST/src/ButterComp2/ButterComp2Proc.cpp @@ -30,8 +30,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,30 +75,30 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -138,23 +138,23 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -187,8 +187,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -223,14 +223,14 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -265,8 +265,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -310,30 +310,30 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -373,23 +373,23 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -422,8 +422,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -458,16 +458,14 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.cpp b/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.cpp index 8fba0ef0f..1515cfdec 100755 --- a/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.cpp +++ b/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.cpp @@ -17,8 +17,8 @@ C5RawBuss::C5RawBuss(audioMasterCallback audioMaster) : lastSampleBussL = 0.0; lastFXBussR = 0.0; lastSampleBussR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.h b/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.h index f4d01fe1e..dfc108b22 100755 --- a/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.h +++ b/plugins/LinuxVST/src/C5RawBuss/C5RawBuss.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXBussL; double lastSampleBussL; diff --git a/plugins/LinuxVST/src/C5RawBuss/C5RawBussProc.cpp b/plugins/LinuxVST/src/C5RawBuss/C5RawBussProc.cpp index fab4612e2..cc884ee73 100755 --- a/plugins/LinuxVST/src/C5RawBuss/C5RawBussProc.cpp +++ b/plugins/LinuxVST/src/C5RawBuss/C5RawBussProc.cpp @@ -15,7 +15,7 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -108,14 +72,14 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl //build new signal off what was present in output last time //slew aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -135,7 +99,7 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -144,51 +108,15 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -228,16 +156,14 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt //build new signal off what was present in output last time //slew aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.cpp b/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.cpp index ffc2ecfe7..a25bbd81d 100755 --- a/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.cpp +++ b/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.cpp @@ -17,8 +17,8 @@ C5RawChannel::C5RawChannel(audioMasterCallback audioMaster) : lastSampleChannelL = 0.0; lastFXChannelR = 0.0; lastSampleChannelR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.h b/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.h index 3ce3e845b..8ed6e152e 100755 --- a/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.h +++ b/plugins/LinuxVST/src/C5RawChannel/C5RawChannel.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXChannelL; double lastSampleChannelL; diff --git a/plugins/LinuxVST/src/C5RawChannel/C5RawChannelProc.cpp b/plugins/LinuxVST/src/C5RawChannel/C5RawChannelProc.cpp index b2679ffb6..d8e91ece8 100755 --- a/plugins/LinuxVST/src/C5RawChannel/C5RawChannelProc.cpp +++ b/plugins/LinuxVST/src/C5RawChannel/C5RawChannelProc.cpp @@ -15,7 +15,7 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -107,14 +71,14 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -134,7 +98,7 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -143,51 +107,15 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -226,16 +154,14 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/CStrip/CStrip.cpp b/plugins/LinuxVST/src/CStrip/CStrip.cpp index 2049ab870..88b4e1748 100755 --- a/plugins/LinuxVST/src/CStrip/CStrip.cpp +++ b/plugins/LinuxVST/src/CStrip/CStrip.cpp @@ -153,8 +153,8 @@ CStrip::CStrip(audioMasterCallback audioMaster) : nvgRA = nvgRB = 0.0; //end ButterComp - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/CStrip/CStrip.h b/plugins/LinuxVST/src/CStrip/CStrip.h index cc9f722af..3e4f6219e 100755 --- a/plugins/LinuxVST/src/CStrip/CStrip.h +++ b/plugins/LinuxVST/src/CStrip/CStrip.h @@ -63,8 +63,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/CStrip/CStripProc.cpp b/plugins/LinuxVST/src/CStrip/CStripProc.cpp index 60ce59c56..0a758963e 100755 --- a/plugins/LinuxVST/src/CStrip/CStripProc.cpp +++ b/plugins/LinuxVST/src/CStrip/CStripProc.cpp @@ -20,10 +20,10 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -111,44 +111,8 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -726,14 +690,14 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -758,10 +722,10 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -849,44 +813,8 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -1464,16 +1392,14 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Calibre/CalibreProc.cpp b/plugins/LinuxVST/src/Calibre/CalibreProc.cpp index a7d6cd0db..14350eff2 100755 --- a/plugins/LinuxVST/src/Calibre/CalibreProc.cpp +++ b/plugins/LinuxVST/src/Calibre/CalibreProc.cpp @@ -37,8 +37,8 @@ void Calibre::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Calibre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Capacitor/Capacitor.cpp b/plugins/LinuxVST/src/Capacitor/Capacitor.cpp index 0ade9c9db..525bf3763 100755 --- a/plugins/LinuxVST/src/Capacitor/Capacitor.cpp +++ b/plugins/LinuxVST/src/Capacitor/Capacitor.cpp @@ -51,8 +51,8 @@ Capacitor::Capacitor(audioMasterCallback audioMaster) : lastHighpass = 1000.0; lastWet = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Capacitor/Capacitor.h b/plugins/LinuxVST/src/Capacitor/Capacitor.h index 0799d39d2..7407eb5d1 100755 --- a/plugins/LinuxVST/src/Capacitor/Capacitor.h +++ b/plugins/LinuxVST/src/Capacitor/Capacitor.h @@ -94,8 +94,8 @@ private: double lastHighpass; double lastWet; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Capacitor/CapacitorProc.cpp b/plugins/LinuxVST/src/Capacitor/CapacitorProc.cpp index 6b3582b09..f851b2c9e 100755 --- a/plugins/LinuxVST/src/Capacitor/CapacitorProc.cpp +++ b/plugins/LinuxVST/src/Capacitor/CapacitorProc.cpp @@ -31,8 +31,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; float drySampleL; float drySampleR; @@ -40,44 +40,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -179,14 +143,14 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -222,8 +186,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -232,44 +196,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -370,16 +298,14 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Capacitor2/Capacitor2Proc.cpp b/plugins/LinuxVST/src/Capacitor2/Capacitor2Proc.cpp index 7799c21a8..899aaaa4a 100755 --- a/plugins/LinuxVST/src/Capacitor2/Capacitor2Proc.cpp +++ b/plugins/LinuxVST/src/Capacitor2/Capacitor2Proc.cpp @@ -30,12 +30,12 @@ void Capacitor2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); @@ -193,12 +193,12 @@ void Capacitor2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); diff --git a/plugins/LinuxVST/src/Chamber/ChamberProc.cpp b/plugins/LinuxVST/src/Chamber/ChamberProc.cpp index 1dbe7bae0..c536ef030 100644 --- a/plugins/LinuxVST/src/Chamber/ChamberProc.cpp +++ b/plugins/LinuxVST/src/Chamber/ChamberProc.cpp @@ -58,12 +58,12 @@ void Chamber::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -314,12 +314,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -501,12 +501,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Channel4/Channel4.h b/plugins/LinuxVST/src/Channel4/Channel4.h index 0338d0a77..e8ca7a260 100755 --- a/plugins/LinuxVST/src/Channel4/Channel4.h +++ b/plugins/LinuxVST/src/Channel4/Channel4.h @@ -53,10 +53,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/LinuxVST/src/Channel4/Channel4Proc.cpp b/plugins/LinuxVST/src/Channel4/Channel4Proc.cpp index 380e52c9e..a57623d4f 100755 --- a/plugins/LinuxVST/src/Channel4/Channel4Proc.cpp +++ b/plugins/LinuxVST/src/Channel4/Channel4Proc.cpp @@ -25,53 +25,17 @@ void Channel4::processReplacing(float **inputs, float **outputs, VstInt32 sample const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -165,53 +129,17 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/LinuxVST/src/Channel5/Channel5.cpp b/plugins/LinuxVST/src/Channel5/Channel5.cpp index 26b592a7d..21581df74 100755 --- a/plugins/LinuxVST/src/Channel5/Channel5.cpp +++ b/plugins/LinuxVST/src/Channel5/Channel5.cpp @@ -15,8 +15,8 @@ Channel5::Channel5(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/LinuxVST/src/Channel5/Channel5.h b/plugins/LinuxVST/src/Channel5/Channel5.h index 07516f7a7..510f34f6a 100755 --- a/plugins/LinuxVST/src/Channel5/Channel5.h +++ b/plugins/LinuxVST/src/Channel5/Channel5.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/LinuxVST/src/Channel5/Channel5Proc.cpp b/plugins/LinuxVST/src/Channel5/Channel5Proc.cpp index 174ee28c5..b029d9303 100755 --- a/plugins/LinuxVST/src/Channel5/Channel5Proc.cpp +++ b/plugins/LinuxVST/src/Channel5/Channel5Proc.cpp @@ -23,8 +23,8 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -79,7 +79,7 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); @@ -158,8 +158,8 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -214,7 +214,7 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); diff --git a/plugins/LinuxVST/src/Channel6/Channel6Proc.cpp b/plugins/LinuxVST/src/Channel6/Channel6Proc.cpp index b0ad39368..777666f14 100755 --- a/plugins/LinuxVST/src/Channel6/Channel6Proc.cpp +++ b/plugins/LinuxVST/src/Channel6/Channel6Proc.cpp @@ -23,8 +23,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -45,8 +45,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -54,7 +54,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -63,7 +63,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section @@ -123,8 +123,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -145,8 +145,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -154,7 +154,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -163,7 +163,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section diff --git a/plugins/LinuxVST/src/Channel7/Channel7Proc.cpp b/plugins/LinuxVST/src/Channel7/Channel7Proc.cpp index b19f42671..e9e9a6852 100755 --- a/plugins/LinuxVST/src/Channel7/Channel7Proc.cpp +++ b/plugins/LinuxVST/src/Channel7/Channel7Proc.cpp @@ -26,8 +26,8 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -46,16 +46,16 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -63,11 +63,11 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -132,8 +132,8 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -152,16 +152,16 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -169,11 +169,11 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/LinuxVST/src/Channel8/Channel8Proc.cpp b/plugins/LinuxVST/src/Channel8/Channel8Proc.cpp index 8442ad2d8..afb1a48fe 100755 --- a/plugins/LinuxVST/src/Channel8/Channel8Proc.cpp +++ b/plugins/LinuxVST/src/Channel8/Channel8Proc.cpp @@ -27,8 +27,8 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -50,16 +50,16 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -67,11 +67,11 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -157,8 +157,8 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -180,16 +180,16 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -197,11 +197,11 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/LinuxVST/src/Channel9/Channel9.h b/plugins/LinuxVST/src/Channel9/Channel9.h index 5772f32ff..1232f66f6 100755 --- a/plugins/LinuxVST/src/Channel9/Channel9.h +++ b/plugins/LinuxVST/src/Channel9/Channel9.h @@ -68,8 +68,8 @@ private: double lastSampleAR; double lastSampleBR; double lastSampleCR; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; double iirAmount; double threshold; double cutoff; diff --git a/plugins/LinuxVST/src/Channel9/Channel9Proc.cpp b/plugins/LinuxVST/src/Channel9/Channel9Proc.cpp index 7c37fea56..5ca21ec9c 100755 --- a/plugins/LinuxVST/src/Channel9/Channel9Proc.cpp +++ b/plugins/LinuxVST/src/Channel9/Channel9Proc.cpp @@ -46,11 +46,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -83,16 +83,16 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -100,11 +100,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -218,11 +218,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -255,16 +255,16 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -272,11 +272,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -333,12 +333,12 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Chorus/Chorus.cpp b/plugins/LinuxVST/src/Chorus/Chorus.cpp index 1f3965afd..d2a630dff 100755 --- a/plugins/LinuxVST/src/Chorus/Chorus.cpp +++ b/plugins/LinuxVST/src/Chorus/Chorus.cpp @@ -28,8 +28,8 @@ Chorus::Chorus(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Chorus/Chorus.h b/plugins/LinuxVST/src/Chorus/Chorus.h index 5508ac3a3..933415bca 100755 --- a/plugins/LinuxVST/src/Chorus/Chorus.h +++ b/plugins/LinuxVST/src/Chorus/Chorus.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 16386; float dL[totalsamples]; diff --git a/plugins/LinuxVST/src/Chorus/ChorusProc.cpp b/plugins/LinuxVST/src/Chorus/ChorusProc.cpp index 368ade75c..8f02bebbc 100755 --- a/plugins/LinuxVST/src/Chorus/ChorusProc.cpp +++ b/plugins/LinuxVST/src/Chorus/ChorusProc.cpp @@ -31,8 +31,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -40,44 +40,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -176,8 +140,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -185,44 +149,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither fpFlip = !fpFlip; *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.cpp b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.cpp index 318b6782b..a9f898ec9 100755 --- a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.cpp +++ b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.cpp @@ -28,8 +28,8 @@ ChorusEnsemble::ChorusEnsemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.h b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.h index e7df33253..8b796e8eb 100755 --- a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.h +++ b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsemble.h @@ -68,8 +68,8 @@ private: double airOddR; double airFactorR; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsembleProc.cpp b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsembleProc.cpp index 166324483..8ee1eea32 100755 --- a/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsembleProc.cpp +++ b/plugins/LinuxVST/src/ChorusEnsemble/ChorusEnsembleProc.cpp @@ -30,8 +30,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -44,44 +44,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -174,14 +138,14 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -216,8 +180,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -230,44 +194,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -360,16 +288,14 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ChromeOxide/ChromeOxideProc.cpp b/plugins/LinuxVST/src/ChromeOxide/ChromeOxideProc.cpp index 6c2d99f53..be036a80e 100755 --- a/plugins/LinuxVST/src/ChromeOxide/ChromeOxideProc.cpp +++ b/plugins/LinuxVST/src/ChromeOxide/ChromeOxideProc.cpp @@ -46,8 +46,8 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -207,8 +207,8 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Cider/CiderProc.cpp b/plugins/LinuxVST/src/Cider/CiderProc.cpp index e5631e4b7..9222a2ea7 100755 --- a/plugins/LinuxVST/src/Cider/CiderProc.cpp +++ b/plugins/LinuxVST/src/Cider/CiderProc.cpp @@ -37,8 +37,8 @@ void Cider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Cider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/ClipOnly2/ClipOnly2.h b/plugins/LinuxVST/src/ClipOnly2/ClipOnly2.h index 451dba2fb..efe560d03 100644 --- a/plugins/LinuxVST/src/ClipOnly2/ClipOnly2.h +++ b/plugins/LinuxVST/src/ClipOnly2/ClipOnly2.h @@ -51,12 +51,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/LinuxVST/src/Coils/Coils.h b/plugins/LinuxVST/src/Coils/Coils.h index 08171fbee..8a4469ee2 100755 --- a/plugins/LinuxVST/src/Coils/Coils.h +++ b/plugins/LinuxVST/src/Coils/Coils.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/Coils/CoilsProc.cpp b/plugins/LinuxVST/src/Coils/CoilsProc.cpp index 409fd66d7..d963e9053 100755 --- a/plugins/LinuxVST/src/Coils/CoilsProc.cpp +++ b/plugins/LinuxVST/src/Coils/CoilsProc.cpp @@ -32,14 +32,14 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -51,7 +51,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); @@ -116,14 +116,14 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -135,7 +135,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/LinuxVST/src/Coils2/Coils2.h b/plugins/LinuxVST/src/Coils2/Coils2.h index 92cf19efc..0e3f61a3c 100755 --- a/plugins/LinuxVST/src/Coils2/Coils2.h +++ b/plugins/LinuxVST/src/Coils2/Coils2.h @@ -54,10 +54,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double hysteresisL; - long double hysteresisR; + double biquadA[15]; + double biquadB[15]; + double hysteresisL; + double hysteresisR; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/Coils2/Coils2Proc.cpp b/plugins/LinuxVST/src/Coils2/Coils2Proc.cpp index 2ae3bf41d..d4466f4bc 100755 --- a/plugins/LinuxVST/src/Coils2/Coils2Proc.cpp +++ b/plugins/LinuxVST/src/Coils2/Coils2Proc.cpp @@ -22,7 +22,7 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -42,15 +42,15 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -59,10 +59,10 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -121,7 +121,7 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -141,15 +141,15 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -158,10 +158,10 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -187,12 +187,12 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Cojones/Cojones.cpp b/plugins/LinuxVST/src/Cojones/Cojones.cpp index f1a8359e6..bd6001fa7 100755 --- a/plugins/LinuxVST/src/Cojones/Cojones.cpp +++ b/plugins/LinuxVST/src/Cojones/Cojones.cpp @@ -24,8 +24,8 @@ Cojones::Cojones(audioMasterCallback audioMaster) : storedR[0] = storedR[1] = 0.0; diffR[0] = diffR[1] = diffR[2] = diffR[3] = diffR[4] = diffR[5] = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Cojones/Cojones.h b/plugins/LinuxVST/src/Cojones/Cojones.h index 10650f832..519304f48 100755 --- a/plugins/LinuxVST/src/Cojones/Cojones.h +++ b/plugins/LinuxVST/src/Cojones/Cojones.h @@ -56,15 +56,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double storedL[2]; - long double diffL[6]; + double storedL[2]; + double diffL[6]; - long double storedR[2]; - long double diffR[6]; + double storedR[2]; + double diffR[6]; float A; float B; diff --git a/plugins/LinuxVST/src/Cojones/CojonesProc.cpp b/plugins/LinuxVST/src/Cojones/CojonesProc.cpp index f1af80356..24606e3af 100755 --- a/plugins/LinuxVST/src/Cojones/CojonesProc.cpp +++ b/plugins/LinuxVST/src/Cojones/CojonesProc.cpp @@ -24,8 +24,8 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,17 +88,17 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -158,14 +158,14 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -194,8 +194,8 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,17 +258,17 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -328,16 +328,14 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Compresaturator/CompresaturatorProc.cpp b/plugins/LinuxVST/src/Compresaturator/CompresaturatorProc.cpp index f39d52e6a..921f25b11 100755 --- a/plugins/LinuxVST/src/Compresaturator/CompresaturatorProc.cpp +++ b/plugins/LinuxVST/src/Compresaturator/CompresaturatorProc.cpp @@ -25,8 +25,8 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -64,13 +64,13 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin drive L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -82,7 +82,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with @@ -240,8 +240,8 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -279,13 +279,13 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -297,7 +297,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/LinuxVST/src/Console4Buss/Console4Buss.cpp b/plugins/LinuxVST/src/Console4Buss/Console4Buss.cpp index 0c8e00c34..4db7b1432 100755 --- a/plugins/LinuxVST/src/Console4Buss/Console4Buss.cpp +++ b/plugins/LinuxVST/src/Console4Buss/Console4Buss.cpp @@ -22,8 +22,8 @@ Console4Buss::Console4Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/LinuxVST/src/Console4Buss/Console4BussProc.cpp b/plugins/LinuxVST/src/Console4Buss/Console4BussProc.cpp index dde872ab2..2b863eaf1 100755 --- a/plugins/LinuxVST/src/Console4Buss/Console4BussProc.cpp +++ b/plugins/LinuxVST/src/Console4Buss/Console4BussProc.cpp @@ -18,11 +18,11 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -36,44 +36,8 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -149,11 +113,11 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -166,44 +130,8 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -249,16 +177,14 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Console4Channel/Console4Channel.cpp b/plugins/LinuxVST/src/Console4Channel/Console4Channel.cpp index 2e524a1e5..6e8f95441 100755 --- a/plugins/LinuxVST/src/Console4Channel/Console4Channel.cpp +++ b/plugins/LinuxVST/src/Console4Channel/Console4Channel.cpp @@ -20,8 +20,8 @@ Console4Channel::Console4Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/LinuxVST/src/Console4Channel/Console4ChannelProc.cpp b/plugins/LinuxVST/src/Console4Channel/Console4ChannelProc.cpp index 3538710ed..eed5c8d67 100755 --- a/plugins/LinuxVST/src/Console4Channel/Console4ChannelProc.cpp +++ b/plugins/LinuxVST/src/Console4Channel/Console4ChannelProc.cpp @@ -18,10 +18,10 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; // replace inputgain with gain, serves same purpose. Stereo inputsample. if (settingchase != gain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -101,14 +65,14 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,10 +95,10 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; if (settingchase != gain) { chasespeed *= 2.0; @@ -148,44 +112,8 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -214,16 +142,14 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Console5Buss/Console5Buss.cpp b/plugins/LinuxVST/src/Console5Buss/Console5Buss.cpp index 7e937a84b..69a467ab8 100755 --- a/plugins/LinuxVST/src/Console5Buss/Console5Buss.cpp +++ b/plugins/LinuxVST/src/Console5Buss/Console5Buss.cpp @@ -22,8 +22,8 @@ Console5Buss::Console5Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Console5Buss/Console5Buss.h b/plugins/LinuxVST/src/Console5Buss/Console5Buss.h index 0166f3370..81f9d0eac 100755 --- a/plugins/LinuxVST/src/Console5Buss/Console5Buss.h +++ b/plugins/LinuxVST/src/Console5Buss/Console5Buss.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Console5Buss/Console5BussProc.cpp b/plugins/LinuxVST/src/Console5Buss/Console5BussProc.cpp index 21069e81e..a61c2e7cb 100755 --- a/plugins/LinuxVST/src/Console5Buss/Console5BussProc.cpp +++ b/plugins/LinuxVST/src/Console5Buss/Console5BussProc.cpp @@ -25,8 +25,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -148,14 +112,14 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -185,8 +149,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -199,44 +163,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -308,16 +236,14 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Console5Channel/Console5Channel.cpp b/plugins/LinuxVST/src/Console5Channel/Console5Channel.cpp index 1a8f6fb00..b38d63844 100755 --- a/plugins/LinuxVST/src/Console5Channel/Console5Channel.cpp +++ b/plugins/LinuxVST/src/Console5Channel/Console5Channel.cpp @@ -22,8 +22,8 @@ Console5Channel::Console5Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Console5Channel/Console5Channel.h b/plugins/LinuxVST/src/Console5Channel/Console5Channel.h index bbc58b357..17e48be47 100755 --- a/plugins/LinuxVST/src/Console5Channel/Console5Channel.h +++ b/plugins/LinuxVST/src/Console5Channel/Console5Channel.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Console5Channel/Console5ChannelProc.cpp b/plugins/LinuxVST/src/Console5Channel/Console5ChannelProc.cpp index a01017008..bab2c5971 100755 --- a/plugins/LinuxVST/src/Console5Channel/Console5ChannelProc.cpp +++ b/plugins/LinuxVST/src/Console5Channel/Console5ChannelProc.cpp @@ -25,8 +25,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.cpp b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.cpp index 350a6b379..25995665f 100755 --- a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.cpp +++ b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.cpp @@ -22,8 +22,8 @@ Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.h b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.h index 3265f5ca6..f3a777fbb 100755 --- a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.h +++ b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkCh.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkChProc.cpp b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkChProc.cpp index ba3a84275..60469e11e 100755 --- a/plugins/LinuxVST/src/Console5DarkCh/Console5DarkChProc.cpp +++ b/plugins/LinuxVST/src/Console5DarkCh/Console5DarkChProc.cpp @@ -25,8 +25,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Console6Buss/Console6BussProc.cpp b/plugins/LinuxVST/src/Console6Buss/Console6BussProc.cpp index ea597bf6a..03f8fb9a6 100755 --- a/plugins/LinuxVST/src/Console6Buss/Console6BussProc.cpp +++ b/plugins/LinuxVST/src/Console6Buss/Console6BussProc.cpp @@ -18,8 +18,8 @@ void Console6Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Console6Channel/Console6ChannelProc.cpp b/plugins/LinuxVST/src/Console6Channel/Console6ChannelProc.cpp index 65d2e793c..2d835fc8c 100755 --- a/plugins/LinuxVST/src/Console6Channel/Console6ChannelProc.cpp +++ b/plugins/LinuxVST/src/Console6Channel/Console6ChannelProc.cpp @@ -18,8 +18,8 @@ void Console6Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Console7Buss/Console7Buss.h b/plugins/LinuxVST/src/Console7Buss/Console7Buss.h index 7fa80b088..0be4fcf81 100644 --- a/plugins/LinuxVST/src/Console7Buss/Console7Buss.h +++ b/plugins/LinuxVST/src/Console7Buss/Console7Buss.h @@ -55,8 +55,8 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Console7Buss/Console7BussProc.cpp b/plugins/LinuxVST/src/Console7Buss/Console7BussProc.cpp index 0ef605a6e..6008a31b0 100644 --- a/plugins/LinuxVST/src/Console7Buss/Console7BussProc.cpp +++ b/plugins/LinuxVST/src/Console7Buss/Console7BussProc.cpp @@ -14,7 +14,7 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -42,15 +42,15 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -104,7 +104,7 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -132,15 +132,15 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -169,12 +169,12 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Console7Cascade/Console7Cascade.h b/plugins/LinuxVST/src/Console7Cascade/Console7Cascade.h index 13ef6e55e..05254a102 100644 --- a/plugins/LinuxVST/src/Console7Cascade/Console7Cascade.h +++ b/plugins/LinuxVST/src/Console7Cascade/Console7Cascade.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Console7Cascade/Console7CascadeProc.cpp b/plugins/LinuxVST/src/Console7Cascade/Console7CascadeProc.cpp index d210ca9a8..f004da812 100644 --- a/plugins/LinuxVST/src/Console7Cascade/Console7CascadeProc.cpp +++ b/plugins/LinuxVST/src/Console7Cascade/Console7CascadeProc.cpp @@ -14,7 +14,7 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Console7Channel/Console7Channel.h b/plugins/LinuxVST/src/Console7Channel/Console7Channel.h index 7833df454..7c8703c47 100644 --- a/plugins/LinuxVST/src/Console7Channel/Console7Channel.h +++ b/plugins/LinuxVST/src/Console7Channel/Console7Channel.h @@ -55,7 +55,7 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Console7Channel/Console7ChannelProc.cpp b/plugins/LinuxVST/src/Console7Channel/Console7ChannelProc.cpp index 18976ea5e..b683073da 100644 --- a/plugins/LinuxVST/src/Console7Channel/Console7ChannelProc.cpp +++ b/plugins/LinuxVST/src/Console7Channel/Console7ChannelProc.cpp @@ -14,7 +14,7 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -36,15 +36,15 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -94,7 +94,7 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -116,15 +116,15 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -149,12 +149,12 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Console7Crunch/Console7Crunch.h b/plugins/LinuxVST/src/Console7Crunch/Console7Crunch.h index fad7640a6..cb1c47ff2 100644 --- a/plugins/LinuxVST/src/Console7Crunch/Console7Crunch.h +++ b/plugins/LinuxVST/src/Console7Crunch/Console7Crunch.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Console7Crunch/Console7CrunchProc.cpp b/plugins/LinuxVST/src/Console7Crunch/Console7CrunchProc.cpp index f4c07fc9d..7dac81098 100644 --- a/plugins/LinuxVST/src/Console7Crunch/Console7CrunchProc.cpp +++ b/plugins/LinuxVST/src/Console7Crunch/Console7CrunchProc.cpp @@ -14,7 +14,7 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.cpp b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.cpp index 6653b9192..d634bfc08 100755 --- a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.cpp +++ b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.cpp @@ -36,8 +36,8 @@ CrunchyGrooveWear::CrunchyGrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.h b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.h index 3489e5bd3..3ccd654a6 100755 --- a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.h +++ b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp index 3c9762ef2..632ee3f59 100755 --- a/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp +++ b/plugins/LinuxVST/src/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp @@ -99,51 +99,15 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -431,14 +395,14 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -542,51 +506,15 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -874,16 +802,14 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Crystal/Crystal.cpp b/plugins/LinuxVST/src/Crystal/Crystal.cpp index 705fe2a99..67db8482c 100755 --- a/plugins/LinuxVST/src/Crystal/Crystal.cpp +++ b/plugins/LinuxVST/src/Crystal/Crystal.cpp @@ -19,8 +19,8 @@ Crystal::Crystal(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bL[count] = 0; bR[count] = 0;} lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Crystal/Crystal.h b/plugins/LinuxVST/src/Crystal/Crystal.h index 45ebb6ad0..524bbc595 100755 --- a/plugins/LinuxVST/src/Crystal/Crystal.h +++ b/plugins/LinuxVST/src/Crystal/Crystal.h @@ -60,8 +60,8 @@ private: double bR[35]; double lastSampleR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Crystal/CrystalProc.cpp b/plugins/LinuxVST/src/Crystal/CrystalProc.cpp index 7e696a70f..f5d6746b1 100755 --- a/plugins/LinuxVST/src/Crystal/CrystalProc.cpp +++ b/plugins/LinuxVST/src/Crystal/CrystalProc.cpp @@ -37,8 +37,8 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -191,14 +191,14 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -240,8 +240,8 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -394,16 +394,14 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Dark/DarkProc.cpp b/plugins/LinuxVST/src/Dark/DarkProc.cpp index 955a53f85..811fdf384 100755 --- a/plugins/LinuxVST/src/Dark/DarkProc.cpp +++ b/plugins/LinuxVST/src/Dark/DarkProc.cpp @@ -34,8 +34,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -149,8 +149,8 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/DarkNoise/DarkNoiseProc.cpp b/plugins/LinuxVST/src/DarkNoise/DarkNoiseProc.cpp index be7b9d0b5..cb4f3428f 100755 --- a/plugins/LinuxVST/src/DarkNoise/DarkNoiseProc.cpp +++ b/plugins/LinuxVST/src/DarkNoise/DarkNoiseProc.cpp @@ -51,12 +51,12 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -92,8 +92,8 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -184,12 +184,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -225,8 +225,8 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -255,12 +255,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/DeBess/DeBess.h b/plugins/LinuxVST/src/DeBess/DeBess.h index b60d94f0a..26e8bb620 100755 --- a/plugins/LinuxVST/src/DeBess/DeBess.h +++ b/plugins/LinuxVST/src/DeBess/DeBess.h @@ -56,13 +56,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double sL[41], mL[41], cL[41]; + double sL[41], mL[41], cL[41]; double ratioAL; double ratioBL; double iirSampleAL; double iirSampleBL; - long double sR[41], mR[41], cR[41]; + double sR[41], mR[41], cR[41]; double ratioAR; double ratioBR; double iirSampleAR; diff --git a/plugins/LinuxVST/src/DeBess/DeBessProc.cpp b/plugins/LinuxVST/src/DeBess/DeBessProc.cpp index 05d4b5668..075c9de3e 100755 --- a/plugins/LinuxVST/src/DeBess/DeBessProc.cpp +++ b/plugins/LinuxVST/src/DeBess/DeBessProc.cpp @@ -28,8 +28,8 @@ void DeBess::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -130,8 +130,8 @@ void DeBess::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/DeEss/DeEss.cpp b/plugins/LinuxVST/src/DeEss/DeEss.cpp index 64a9503df..f57f5c63c 100755 --- a/plugins/LinuxVST/src/DeEss/DeEss.cpp +++ b/plugins/LinuxVST/src/DeEss/DeEss.cpp @@ -32,8 +32,8 @@ DeEss::DeEss(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/DeEss/DeEss.h b/plugins/LinuxVST/src/DeEss/DeEss.h index dcab1e6c3..93afbe7b9 100755 --- a/plugins/LinuxVST/src/DeEss/DeEss.h +++ b/plugins/LinuxVST/src/DeEss/DeEss.h @@ -103,8 +103,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/DeEss/DeEssProc.cpp b/plugins/LinuxVST/src/DeEss/DeEssProc.cpp index 9b030a4c6..3f9adf647 100755 --- a/plugins/LinuxVST/src/DeEss/DeEssProc.cpp +++ b/plugins/LinuxVST/src/DeEss/DeEssProc.cpp @@ -28,8 +28,8 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -148,14 +148,14 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,8 +188,8 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -308,16 +308,14 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DeHiss/DeHissProc.cpp b/plugins/LinuxVST/src/DeHiss/DeHissProc.cpp index 405566e8a..41074f9c5 100755 --- a/plugins/LinuxVST/src/DeHiss/DeHissProc.cpp +++ b/plugins/LinuxVST/src/DeHiss/DeHissProc.cpp @@ -35,12 +35,12 @@ void DeHiss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; @@ -166,12 +166,12 @@ void DeHiss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; diff --git a/plugins/LinuxVST/src/DeRez/DeRez.cpp b/plugins/LinuxVST/src/DeRez/DeRez.cpp index cb9b514a8..f24f99df9 100755 --- a/plugins/LinuxVST/src/DeRez/DeRez.cpp +++ b/plugins/LinuxVST/src/DeRez/DeRez.cpp @@ -23,8 +23,8 @@ DeRez::DeRez(audioMasterCallback audioMaster) : incrementA = 0.0; incrementB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/DeRez/DeRez.h b/plugins/LinuxVST/src/DeRez/DeRez.h index 8ebdcd9d6..85cfe1c66 100755 --- a/plugins/LinuxVST/src/DeRez/DeRez.h +++ b/plugins/LinuxVST/src/DeRez/DeRez.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/DeRez/DeRezProc.cpp b/plugins/LinuxVST/src/DeRez/DeRezProc.cpp index cbe42d57d..36cb20004 100755 --- a/plugins/LinuxVST/src/DeRez/DeRezProc.cpp +++ b/plugins/LinuxVST/src/DeRez/DeRezProc.cpp @@ -26,48 +26,12 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -75,8 +39,8 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -90,7 +54,7 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -130,14 +94,14 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,48 +132,12 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -217,8 +145,8 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -232,7 +160,7 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -272,16 +200,14 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DeRez2/DeRez2Proc.cpp b/plugins/LinuxVST/src/DeRez2/DeRez2Proc.cpp index 889fd79b4..d43944d9e 100755 --- a/plugins/LinuxVST/src/DeRez2/DeRez2Proc.cpp +++ b/plugins/LinuxVST/src/DeRez2/DeRez2Proc.cpp @@ -28,12 +28,12 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -42,8 +42,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -57,8 +57,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; @@ -206,12 +206,12 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -220,8 +220,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -235,8 +235,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; diff --git a/plugins/LinuxVST/src/Deckwrecka/DeckwreckaProc.cpp b/plugins/LinuxVST/src/Deckwrecka/DeckwreckaProc.cpp index 6b109e1ed..e7146df5d 100755 --- a/plugins/LinuxVST/src/Deckwrecka/DeckwreckaProc.cpp +++ b/plugins/LinuxVST/src/Deckwrecka/DeckwreckaProc.cpp @@ -32,8 +32,8 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -217,8 +217,8 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Density/Density.cpp b/plugins/LinuxVST/src/Density/Density.cpp index bac4fb24b..01ad61f14 100755 --- a/plugins/LinuxVST/src/Density/Density.cpp +++ b/plugins/LinuxVST/src/Density/Density.cpp @@ -21,8 +21,8 @@ Density::Density(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Density/Density.h b/plugins/LinuxVST/src/Density/Density.h index b634c4475..0f188b3bb 100755 --- a/plugins/LinuxVST/src/Density/Density.h +++ b/plugins/LinuxVST/src/Density/Density.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/LinuxVST/src/Density/DensityProc.cpp b/plugins/LinuxVST/src/Density/DensityProc.cpp index f229a9ded..5db9e5022 100755 --- a/plugins/LinuxVST/src/Density/DensityProc.cpp +++ b/plugins/LinuxVST/src/Density/DensityProc.cpp @@ -27,53 +27,17 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -187,53 +151,17 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Density2/Density2.h b/plugins/LinuxVST/src/Density2/Density2.h index cca180d09..eb0ca981c 100755 --- a/plugins/LinuxVST/src/Density2/Density2.h +++ b/plugins/LinuxVST/src/Density2/Density2.h @@ -59,25 +59,25 @@ private: uint32_t fpdR; //default stuff - long double last3SampleL; - long double last2SampleL; - long double last1SampleL; - long double ataAL; - long double ataBL; - long double ataCL; - long double lastDiffSampleL; - long double iirSampleAL; - long double iirSampleBL; + double last3SampleL; + double last2SampleL; + double last1SampleL; + double ataAL; + double ataBL; + double ataCL; + double lastDiffSampleL; + double iirSampleAL; + double iirSampleBL; - long double last3SampleR; - long double last2SampleR; - long double last1SampleR; - long double ataAR; - long double ataBR; - long double ataCR; - long double lastDiffSampleR; - long double iirSampleAR; - long double iirSampleBR; + double last3SampleR; + double last2SampleR; + double last1SampleR; + double ataAR; + double ataBR; + double ataCR; + double lastDiffSampleR; + double iirSampleAR; + double iirSampleBR; float A; float B; diff --git a/plugins/LinuxVST/src/Density2/Density2Proc.cpp b/plugins/LinuxVST/src/Density2/Density2Proc.cpp index e266cd26a..bd79936ab 100755 --- a/plugins/LinuxVST/src/Density2/Density2Proc.cpp +++ b/plugins/LinuxVST/src/Density2/Density2Proc.cpp @@ -27,18 +27,18 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -46,7 +46,7 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -83,12 +83,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -128,12 +128,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -184,18 +184,18 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -203,7 +203,7 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -240,12 +240,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -285,12 +285,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -303,12 +303,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet); //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Desk/Desk.cpp b/plugins/LinuxVST/src/Desk/Desk.cpp index 9582f0459..a23bbc3b5 100755 --- a/plugins/LinuxVST/src/Desk/Desk.cpp +++ b/plugins/LinuxVST/src/Desk/Desk.cpp @@ -18,8 +18,8 @@ Desk::Desk(audioMasterCallback audioMaster) : lastSampleR = 0.0; lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Desk/Desk.h b/plugins/LinuxVST/src/Desk/Desk.h index f7f933df0..b33f2bf52 100755 --- a/plugins/LinuxVST/src/Desk/Desk.h +++ b/plugins/LinuxVST/src/Desk/Desk.h @@ -51,15 +51,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/LinuxVST/src/Desk/DeskProc.cpp b/plugins/LinuxVST/src/Desk/DeskProc.cpp index d53894b86..328e06643 100755 --- a/plugins/LinuxVST/src/Desk/DeskProc.cpp +++ b/plugins/LinuxVST/src/Desk/DeskProc.cpp @@ -30,53 +30,17 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR /= gain; //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -190,53 +154,17 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR /= gain; //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Desk4/Desk4.cpp b/plugins/LinuxVST/src/Desk4/Desk4.cpp index 0a05d870b..ebf1daadb 100755 --- a/plugins/LinuxVST/src/Desk4/Desk4.cpp +++ b/plugins/LinuxVST/src/Desk4/Desk4.cpp @@ -30,8 +30,8 @@ Desk4::Desk4(audioMasterCallback audioMaster) : lastSlewR = 0.0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Desk4/Desk4.h b/plugins/LinuxVST/src/Desk4/Desk4.h index 802ee4733..8b1a72406 100755 --- a/plugins/LinuxVST/src/Desk4/Desk4.h +++ b/plugins/LinuxVST/src/Desk4/Desk4.h @@ -70,8 +70,8 @@ private: double lastSlewR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Desk4/Desk4Proc.cpp b/plugins/LinuxVST/src/Desk4/Desk4Proc.cpp index fd165b697..0426cc218 100755 --- a/plugins/LinuxVST/src/Desk4/Desk4Proc.cpp +++ b/plugins/LinuxVST/src/Desk4/Desk4Proc.cpp @@ -48,51 +48,15 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,14 +190,14 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -286,51 +250,15 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -464,16 +392,14 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DigitalBlack/DigitalBlackProc.cpp b/plugins/LinuxVST/src/DigitalBlack/DigitalBlackProc.cpp index 758a5d899..8caeff273 100755 --- a/plugins/LinuxVST/src/DigitalBlack/DigitalBlackProc.cpp +++ b/plugins/LinuxVST/src/DigitalBlack/DigitalBlackProc.cpp @@ -24,12 +24,12 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -67,7 +67,7 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); @@ -125,12 +125,12 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -168,7 +168,7 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/LinuxVST/src/Distance/Distance.cpp b/plugins/LinuxVST/src/Distance/Distance.cpp index 7ccd8fba2..ca1806e47 100755 --- a/plugins/LinuxVST/src/Distance/Distance.cpp +++ b/plugins/LinuxVST/src/Distance/Distance.cpp @@ -16,8 +16,8 @@ Distance::Distance(audioMasterCallback audioMaster) : B = 1.0; thirdresultL = prevresultL = lastclampL = clampL = changeL = lastL = 0.0; thirdresultR = prevresultR = lastclampR = clampR = changeR = lastR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Distance/Distance.h b/plugins/LinuxVST/src/Distance/Distance.h index 5566f8485..021335d65 100755 --- a/plugins/LinuxVST/src/Distance/Distance.h +++ b/plugins/LinuxVST/src/Distance/Distance.h @@ -67,8 +67,8 @@ private: double prevresultR; double lastR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Distance/DistanceProc.cpp b/plugins/LinuxVST/src/Distance/DistanceProc.cpp index 32eb3fa9d..30065e778 100755 --- a/plugins/LinuxVST/src/Distance/DistanceProc.cpp +++ b/plugins/LinuxVST/src/Distance/DistanceProc.cpp @@ -28,53 +28,17 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -123,14 +87,14 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -163,53 +127,17 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -258,16 +186,14 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Distance2/Distance2.cpp b/plugins/LinuxVST/src/Distance2/Distance2.cpp index d6e26d85e..8e1e63871 100755 --- a/plugins/LinuxVST/src/Distance2/Distance2.cpp +++ b/plugins/LinuxVST/src/Distance2/Distance2.cpp @@ -61,8 +61,8 @@ Distance2::Distance2(audioMasterCallback audioMaster) : thresholdL = 1.763323098246125; thresholdM = 1.939655408070737; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Distance2/Distance2.h b/plugins/LinuxVST/src/Distance2/Distance2.h index dba008f6a..17d29134d 100755 --- a/plugins/LinuxVST/src/Distance2/Distance2.h +++ b/plugins/LinuxVST/src/Distance2/Distance2.h @@ -54,51 +54,51 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; double thirdSampleL; double lastSampleL; diff --git a/plugins/LinuxVST/src/Distance2/Distance2Proc.cpp b/plugins/LinuxVST/src/Distance2/Distance2Proc.cpp index 473f3c86e..0a92a9268 100755 --- a/plugins/LinuxVST/src/Distance2/Distance2Proc.cpp +++ b/plugins/LinuxVST/src/Distance2/Distance2Proc.cpp @@ -43,8 +43,8 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -97,7 +97,7 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -266,14 +266,14 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -321,8 +321,8 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -375,7 +375,7 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -544,16 +544,14 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Distortion/Distortion.h b/plugins/LinuxVST/src/Distortion/Distortion.h index 53ccfde6c..c0f2d7553 100755 --- a/plugins/LinuxVST/src/Distortion/Distortion.h +++ b/plugins/LinuxVST/src/Distortion/Distortion.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousInL[9]; - long double previousOutL[9]; - long double previousInR[9]; - long double previousOutR[9]; + double previousInL[9]; + double previousOutL[9]; + double previousInR[9]; + double previousOutR[9]; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/Distortion/DistortionProc.cpp b/plugins/LinuxVST/src/Distortion/DistortionProc.cpp index 31b455c6e..8d6a4f8b0 100755 --- a/plugins/LinuxVST/src/Distortion/DistortionProc.cpp +++ b/plugins/LinuxVST/src/Distortion/DistortionProc.cpp @@ -23,18 +23,18 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -74,14 +74,14 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -90,7 +90,7 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; @@ -144,18 +144,18 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -195,14 +195,14 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -211,7 +211,7 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; diff --git a/plugins/LinuxVST/src/DitherFloat/DitherFloatProc.cpp b/plugins/LinuxVST/src/DitherFloat/DitherFloatProc.cpp index a7121e8ac..80e204250 100755 --- a/plugins/LinuxVST/src/DitherFloat/DitherFloatProc.cpp +++ b/plugins/LinuxVST/src/DitherFloat/DitherFloatProc.cpp @@ -19,9 +19,9 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -63,8 +63,8 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); @@ -104,9 +104,9 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -148,8 +148,8 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); diff --git a/plugins/LinuxVST/src/DitherMeDiskers/DitherMeDiskers.h b/plugins/LinuxVST/src/DitherMeDiskers/DitherMeDiskers.h index 11f769eb2..4ba134f9a 100755 --- a/plugins/LinuxVST/src/DitherMeDiskers/DitherMeDiskers.h +++ b/plugins/LinuxVST/src/DitherMeDiskers/DitherMeDiskers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/LinuxVST/src/DitherMeTimbers/DitherMeTimbers.h b/plugins/LinuxVST/src/DitherMeTimbers/DitherMeTimbers.h index 58daf0f03..03d712ee0 100755 --- a/plugins/LinuxVST/src/DitherMeTimbers/DitherMeTimbers.h +++ b/plugins/LinuxVST/src/DitherMeTimbers/DitherMeTimbers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/LinuxVST/src/Ditherbox/Ditherbox.h b/plugins/LinuxVST/src/Ditherbox/Ditherbox.h index fa54082b1..164f37bab 100755 --- a/plugins/LinuxVST/src/Ditherbox/Ditherbox.h +++ b/plugins/LinuxVST/src/Ditherbox/Ditherbox.h @@ -54,8 +54,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double contingentErrL; double contingentErrR; double currentDitherL; @@ -68,10 +68,10 @@ private: double NSOddR; double prevR; double nsR[16]; - long double lastSampleL; - long double outSampleL; - long double lastSampleR; - long double outSampleR; + double lastSampleL; + double outSampleL; + double lastSampleR; + double outSampleR; double iirSampleAL; double iirSampleBL; diff --git a/plugins/LinuxVST/src/Ditherbox/DitherboxProc.cpp b/plugins/LinuxVST/src/Ditherbox/DitherboxProc.cpp index 4906413e8..8851aeaa0 100755 --- a/plugins/LinuxVST/src/Ditherbox/DitherboxProc.cpp +++ b/plugins/LinuxVST/src/Ditherbox/DitherboxProc.cpp @@ -15,31 +15,31 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -48,46 +48,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; float drySampleL = inputSampleL; float drySampleR = inputSampleR; @@ -1020,31 +984,31 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -1053,46 +1017,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; diff --git a/plugins/LinuxVST/src/DoublePaul/DoublePaulProc.cpp b/plugins/LinuxVST/src/DoublePaul/DoublePaulProc.cpp index 66de94f5c..0ba4cae2b 100755 --- a/plugins/LinuxVST/src/DoublePaul/DoublePaulProc.cpp +++ b/plugins/LinuxVST/src/DoublePaul/DoublePaulProc.cpp @@ -17,51 +17,15 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -136,51 +100,15 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/LinuxVST/src/Drive/Drive.cpp b/plugins/LinuxVST/src/Drive/Drive.cpp index ac5f228ae..e88a7b678 100755 --- a/plugins/LinuxVST/src/Drive/Drive.cpp +++ b/plugins/LinuxVST/src/Drive/Drive.cpp @@ -21,8 +21,8 @@ Drive::Drive(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Drive/Drive.h b/plugins/LinuxVST/src/Drive/Drive.h index 525a09eb0..5b9bf5910 100755 --- a/plugins/LinuxVST/src/Drive/Drive.h +++ b/plugins/LinuxVST/src/Drive/Drive.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/LinuxVST/src/Drive/DriveProc.cpp b/plugins/LinuxVST/src/Drive/DriveProc.cpp index 074ccfd3c..d30635b48 100755 --- a/plugins/LinuxVST/src/Drive/DriveProc.cpp +++ b/plugins/LinuxVST/src/Drive/DriveProc.cpp @@ -27,53 +27,17 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -127,14 +91,14 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,53 +130,17 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -266,16 +194,14 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DrumSlam/DrumSlam.cpp b/plugins/LinuxVST/src/DrumSlam/DrumSlam.cpp index 5b8861982..7449845c9 100755 --- a/plugins/LinuxVST/src/DrumSlam/DrumSlam.cpp +++ b/plugins/LinuxVST/src/DrumSlam/DrumSlam.cpp @@ -36,8 +36,8 @@ DrumSlam::DrumSlam(audioMasterCallback audioMaster) : iirSampleHR = 0.0; lastSampleR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/DrumSlam/DrumSlam.h b/plugins/LinuxVST/src/DrumSlam/DrumSlam.h index 418282d59..3d83fce09 100755 --- a/plugins/LinuxVST/src/DrumSlam/DrumSlam.h +++ b/plugins/LinuxVST/src/DrumSlam/DrumSlam.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/LinuxVST/src/DrumSlam/DrumSlamProc.cpp b/plugins/LinuxVST/src/DrumSlam/DrumSlamProc.cpp index 2e86142c7..ab071ac1e 100755 --- a/plugins/LinuxVST/src/DrumSlam/DrumSlamProc.cpp +++ b/plugins/LinuxVST/src/DrumSlam/DrumSlamProc.cpp @@ -28,54 +28,18 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -147,10 +111,10 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -219,14 +183,14 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -259,54 +223,18 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -378,10 +306,10 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -450,16 +378,14 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DubCenter/DubCenter.cpp b/plugins/LinuxVST/src/DubCenter/DubCenter.cpp index 098e72313..ed7ff1c06 100755 --- a/plugins/LinuxVST/src/DubCenter/DubCenter.cpp +++ b/plugins/LinuxVST/src/DubCenter/DubCenter.cpp @@ -80,8 +80,8 @@ DubCenter::DubCenter(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/DubCenter/DubCenter.h b/plugins/LinuxVST/src/DubCenter/DubCenter.h index 9d7c7e6fb..54b9eeb59 100755 --- a/plugins/LinuxVST/src/DubCenter/DubCenter.h +++ b/plugins/LinuxVST/src/DubCenter/DubCenter.h @@ -117,8 +117,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/DubCenter/DubCenterProc.cpp b/plugins/LinuxVST/src/DubCenter/DubCenterProc.cpp index b0c49a397..49806b773 100755 --- a/plugins/LinuxVST/src/DubCenter/DubCenterProc.cpp +++ b/plugins/LinuxVST/src/DubCenter/DubCenterProc.cpp @@ -49,8 +49,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,8 +88,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -306,14 +306,14 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -366,8 +366,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -405,8 +405,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -623,16 +623,14 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DubSub/DubSub.cpp b/plugins/LinuxVST/src/DubSub/DubSub.cpp index 6dc87fcbe..e53c47dcc 100755 --- a/plugins/LinuxVST/src/DubSub/DubSub.cpp +++ b/plugins/LinuxVST/src/DubSub/DubSub.cpp @@ -118,8 +118,8 @@ DubSub::DubSub(audioMasterCallback audioMaster) : oscGateL = 1.0; oscGateR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/DubSub/DubSub.h b/plugins/LinuxVST/src/DubSub/DubSub.h index 0e26cfad4..4f3f6af8c 100755 --- a/plugins/LinuxVST/src/DubSub/DubSub.h +++ b/plugins/LinuxVST/src/DubSub/DubSub.h @@ -159,8 +159,8 @@ private: double oscGateR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/DubSub/DubSubProc.cpp b/plugins/LinuxVST/src/DubSub/DubSubProc.cpp index 7a0349d51..4195d3b38 100755 --- a/plugins/LinuxVST/src/DubSub/DubSubProc.cpp +++ b/plugins/LinuxVST/src/DubSub/DubSubProc.cpp @@ -53,8 +53,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -92,8 +92,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aDubSub. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -392,14 +392,14 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -457,8 +457,8 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -795,16 +795,14 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/DustBunny/DustBunnyProc.cpp b/plugins/LinuxVST/src/DustBunny/DustBunnyProc.cpp index 27a8d66c0..d4667fdec 100755 --- a/plugins/LinuxVST/src/DustBunny/DustBunnyProc.cpp +++ b/plugins/LinuxVST/src/DustBunny/DustBunnyProc.cpp @@ -25,44 +25,8 @@ void DustBunny::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -144,52 +108,16 @@ void DustBunny::processDoubleReplacing(double **inputs, double **outputs, VstInt unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); bunny = (bunny*bunny); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/LinuxVST/src/Dyno/DynoProc.cpp b/plugins/LinuxVST/src/Dyno/DynoProc.cpp index f01381c06..3e9052c73 100755 --- a/plugins/LinuxVST/src/Dyno/DynoProc.cpp +++ b/plugins/LinuxVST/src/Dyno/DynoProc.cpp @@ -18,8 +18,8 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); @@ -65,8 +65,8 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); diff --git a/plugins/LinuxVST/src/EQ/EQ.cpp b/plugins/LinuxVST/src/EQ/EQ.cpp index f2e4e0134..702dd33d4 100755 --- a/plugins/LinuxVST/src/EQ/EQ.cpp +++ b/plugins/LinuxVST/src/EQ/EQ.cpp @@ -111,8 +111,8 @@ EQ::EQ(audioMasterCallback audioMaster) : flip = false; flipthree = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/EQ/EQ.h b/plugins/LinuxVST/src/EQ/EQ.h index 26fade4aa..7d533787f 100755 --- a/plugins/LinuxVST/src/EQ/EQ.h +++ b/plugins/LinuxVST/src/EQ/EQ.h @@ -59,8 +59,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/EQ/EQProc.cpp b/plugins/LinuxVST/src/EQ/EQProc.cpp index 917dc7e77..220314936 100755 --- a/plugins/LinuxVST/src/EQ/EQProc.cpp +++ b/plugins/LinuxVST/src/EQ/EQProc.cpp @@ -21,8 +21,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -69,44 +69,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -431,14 +395,14 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -464,8 +428,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -512,44 +476,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -874,16 +802,14 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/EdIsDim/EdIsDim.cpp b/plugins/LinuxVST/src/EdIsDim/EdIsDim.cpp index eb6abd32d..8a4f6db6f 100755 --- a/plugins/LinuxVST/src/EdIsDim/EdIsDim.cpp +++ b/plugins/LinuxVST/src/EdIsDim/EdIsDim.cpp @@ -13,8 +13,8 @@ EdIsDim::EdIsDim(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/EdIsDim/EdIsDim.h b/plugins/LinuxVST/src/EdIsDim/EdIsDim.h index 4f6270586..7b887d69e 100755 --- a/plugins/LinuxVST/src/EdIsDim/EdIsDim.h +++ b/plugins/LinuxVST/src/EdIsDim/EdIsDim.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/EdIsDim/EdIsDimProc.cpp b/plugins/LinuxVST/src/EdIsDim/EdIsDimProc.cpp index 0d033eb65..2273bfcaa 100755 --- a/plugins/LinuxVST/src/EdIsDim/EdIsDimProc.cpp +++ b/plugins/LinuxVST/src/EdIsDim/EdIsDimProc.cpp @@ -15,10 +15,10 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -27,44 +27,8 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -74,7 +38,7 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -99,10 +63,10 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -111,44 +75,8 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; @@ -159,7 +87,7 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/LinuxVST/src/Elation/ElationProc.cpp b/plugins/LinuxVST/src/Elation/ElationProc.cpp index dd2878dd9..359c931b3 100755 --- a/plugins/LinuxVST/src/Elation/ElationProc.cpp +++ b/plugins/LinuxVST/src/Elation/ElationProc.cpp @@ -34,12 +34,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; @@ -314,12 +314,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; diff --git a/plugins/LinuxVST/src/ElectroHat/ElectroHat.cpp b/plugins/LinuxVST/src/ElectroHat/ElectroHat.cpp index 6be41e4b1..0ca7bd6c1 100755 --- a/plugins/LinuxVST/src/ElectroHat/ElectroHat.cpp +++ b/plugins/LinuxVST/src/ElectroHat/ElectroHat.cpp @@ -25,8 +25,8 @@ ElectroHat::ElectroHat(audioMasterCallback audioMaster) : lok = 0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ElectroHat/ElectroHat.h b/plugins/LinuxVST/src/ElectroHat/ElectroHat.h index 85315cd63..b07061904 100755 --- a/plugins/LinuxVST/src/ElectroHat/ElectroHat.h +++ b/plugins/LinuxVST/src/ElectroHat/ElectroHat.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedSampleL; diff --git a/plugins/LinuxVST/src/ElectroHat/ElectroHatProc.cpp b/plugins/LinuxVST/src/ElectroHat/ElectroHatProc.cpp index ee5a3070f..d99dc44ab 100755 --- a/plugins/LinuxVST/src/ElectroHat/ElectroHatProc.cpp +++ b/plugins/LinuxVST/src/ElectroHat/ElectroHatProc.cpp @@ -25,8 +25,8 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -123,14 +123,14 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -160,8 +160,8 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -258,16 +258,14 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Energy/Energy.cpp b/plugins/LinuxVST/src/Energy/Energy.cpp index 8571e56c1..8d8ab6081 100755 --- a/plugins/LinuxVST/src/Energy/Energy.cpp +++ b/plugins/LinuxVST/src/Energy/Energy.cpp @@ -160,8 +160,8 @@ Energy::Energy(audioMasterCallback audioMaster) : PrevAR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Energy/Energy.h b/plugins/LinuxVST/src/Energy/Energy.h index b039c608c..0500e8391 100755 --- a/plugins/LinuxVST/src/Energy/Energy.h +++ b/plugins/LinuxVST/src/Energy/Energy.h @@ -60,8 +60,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double duoEvenL; diff --git a/plugins/LinuxVST/src/Energy/EnergyProc.cpp b/plugins/LinuxVST/src/Energy/EnergyProc.cpp index a0a86f85f..dbe218778 100755 --- a/plugins/LinuxVST/src/Energy/EnergyProc.cpp +++ b/plugins/LinuxVST/src/Energy/EnergyProc.cpp @@ -27,8 +27,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -742,14 +742,14 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -781,8 +781,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -821,8 +821,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -1496,16 +1496,14 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Energy2/Energy2Proc.cpp b/plugins/LinuxVST/src/Energy2/Energy2Proc.cpp index cfd7a3ba5..6cdbba15c 100644 --- a/plugins/LinuxVST/src/Energy2/Energy2Proc.cpp +++ b/plugins/LinuxVST/src/Energy2/Energy2Proc.cpp @@ -37,17 +37,17 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -680,17 +680,17 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -1275,12 +1275,12 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Ensemble/Ensemble.cpp b/plugins/LinuxVST/src/Ensemble/Ensemble.cpp index b90bf6e69..1b701ecc2 100755 --- a/plugins/LinuxVST/src/Ensemble/Ensemble.cpp +++ b/plugins/LinuxVST/src/Ensemble/Ensemble.cpp @@ -29,8 +29,8 @@ Ensemble::Ensemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Ensemble/Ensemble.h b/plugins/LinuxVST/src/Ensemble/Ensemble.h index 7697d9317..7d0af8926 100755 --- a/plugins/LinuxVST/src/Ensemble/Ensemble.h +++ b/plugins/LinuxVST/src/Ensemble/Ensemble.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 65540; float dL[totalsamples]; diff --git a/plugins/LinuxVST/src/Ensemble/EnsembleProc.cpp b/plugins/LinuxVST/src/Ensemble/EnsembleProc.cpp index e9a3a4392..ec4b9c8db 100755 --- a/plugins/LinuxVST/src/Ensemble/EnsembleProc.cpp +++ b/plugins/LinuxVST/src/Ensemble/EnsembleProc.cpp @@ -38,8 +38,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -56,44 +56,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -153,14 +117,14 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -203,8 +167,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -221,44 +185,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -318,16 +246,14 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/EveryTrim/EveryTrim.cpp b/plugins/LinuxVST/src/EveryTrim/EveryTrim.cpp index b0a98d48c..fcb71bec3 100755 --- a/plugins/LinuxVST/src/EveryTrim/EveryTrim.cpp +++ b/plugins/LinuxVST/src/EveryTrim/EveryTrim.cpp @@ -17,8 +17,8 @@ EveryTrim::EveryTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/EveryTrim/EveryTrim.h b/plugins/LinuxVST/src/EveryTrim/EveryTrim.h index 4efc3cd6b..aec024775 100755 --- a/plugins/LinuxVST/src/EveryTrim/EveryTrim.h +++ b/plugins/LinuxVST/src/EveryTrim/EveryTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/EveryTrim/EveryTrimProc.cpp b/plugins/LinuxVST/src/EveryTrim/EveryTrimProc.cpp index 3c30eda6b..1bb858da7 100755 --- a/plugins/LinuxVST/src/EveryTrim/EveryTrimProc.cpp +++ b/plugins/LinuxVST/src/EveryTrim/EveryTrimProc.cpp @@ -21,10 +21,10 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Facet/FacetProc.cpp b/plugins/LinuxVST/src/Facet/FacetProc.cpp index 53e92ce39..fb5cdbd6e 100755 --- a/plugins/LinuxVST/src/Facet/FacetProc.cpp +++ b/plugins/LinuxVST/src/Facet/FacetProc.cpp @@ -18,8 +18,8 @@ void Facet::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Facet::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/FathomFive/FathomFiveProc.cpp b/plugins/LinuxVST/src/FathomFive/FathomFiveProc.cpp index f509c2188..fee6aba1e 100755 --- a/plugins/LinuxVST/src/FathomFive/FathomFiveProc.cpp +++ b/plugins/LinuxVST/src/FathomFive/FathomFiveProc.cpp @@ -25,51 +25,15 @@ void FathomFive::processReplacing(float **inputs, float **outputs, VstInt32 samp if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} @@ -143,51 +107,15 @@ void FathomFive::processDoubleReplacing(double **inputs, double **outputs, VstIn if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} diff --git a/plugins/LinuxVST/src/Floor/Floor.cpp b/plugins/LinuxVST/src/Floor/Floor.cpp index ff12e691c..7bb4a8ddb 100755 --- a/plugins/LinuxVST/src/Floor/Floor.cpp +++ b/plugins/LinuxVST/src/Floor/Floor.cpp @@ -39,8 +39,8 @@ Floor::Floor(audioMasterCallback audioMaster) : iirSample2DR = 0.0; iirSample2ER = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Floor/Floor.h b/plugins/LinuxVST/src/Floor/Floor.h index dc6b58c54..c80bb7c7f 100755 --- a/plugins/LinuxVST/src/Floor/Floor.h +++ b/plugins/LinuxVST/src/Floor/Floor.h @@ -78,8 +78,8 @@ private: double iirSample2DR; double iirSample2ER; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Floor/FloorProc.cpp b/plugins/LinuxVST/src/Floor/FloorProc.cpp index 865446b5f..0cfa58c69 100755 --- a/plugins/LinuxVST/src/Floor/FloorProc.cpp +++ b/plugins/LinuxVST/src/Floor/FloorProc.cpp @@ -36,8 +36,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,8 +75,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -247,14 +247,14 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -295,8 +295,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -334,8 +334,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -506,16 +506,14 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Focus/Focus.h b/plugins/LinuxVST/src/Focus/Focus.h index cd7e72a97..7b2cf706d 100755 --- a/plugins/LinuxVST/src/Focus/Focus.h +++ b/plugins/LinuxVST/src/Focus/Focus.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/Focus/FocusProc.cpp b/plugins/LinuxVST/src/Focus/FocusProc.cpp index f25a32814..9e1c9c070 100755 --- a/plugins/LinuxVST/src/Focus/FocusProc.cpp +++ b/plugins/LinuxVST/src/Focus/FocusProc.cpp @@ -32,18 +32,18 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -62,8 +62,8 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -98,14 +98,14 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -170,18 +170,18 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -200,8 +200,8 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -236,14 +236,14 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; diff --git a/plugins/LinuxVST/src/Fracture/Fracture.cpp b/plugins/LinuxVST/src/Fracture/Fracture.cpp index 03f3b1968..302b4dc54 100755 --- a/plugins/LinuxVST/src/Fracture/Fracture.cpp +++ b/plugins/LinuxVST/src/Fracture/Fracture.cpp @@ -16,8 +16,8 @@ Fracture::Fracture(audioMasterCallback audioMaster) : B = 0.5; //2 from 1 to 3: (B*2.999)+1 C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Fracture/Fracture.h b/plugins/LinuxVST/src/Fracture/Fracture.h index 49d271858..54aac5a86 100755 --- a/plugins/LinuxVST/src/Fracture/Fracture.h +++ b/plugins/LinuxVST/src/Fracture/Fracture.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Fracture/FractureProc.cpp b/plugins/LinuxVST/src/Fracture/FractureProc.cpp index 5c1aaa941..e7b6e7225 100755 --- a/plugins/LinuxVST/src/Fracture/FractureProc.cpp +++ b/plugins/LinuxVST/src/Fracture/FractureProc.cpp @@ -23,53 +23,17 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -98,14 +62,14 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -136,53 +100,17 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -211,16 +139,14 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/FromTape/FromTape.cpp b/plugins/LinuxVST/src/FromTape/FromTape.cpp index 40b787673..4573e48be 100755 --- a/plugins/LinuxVST/src/FromTape/FromTape.cpp +++ b/plugins/LinuxVST/src/FromTape/FromTape.cpp @@ -82,8 +82,8 @@ FromTape::FromTape(audioMasterCallback audioMaster) : flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/FromTape/FromTape.h b/plugins/LinuxVST/src/FromTape/FromTape.h index 40efabc1b..cd63776b9 100755 --- a/plugins/LinuxVST/src/FromTape/FromTape.h +++ b/plugins/LinuxVST/src/FromTape/FromTape.h @@ -120,8 +120,8 @@ private: double iirSampleYR; double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/FromTape/FromTapeProc.cpp b/plugins/LinuxVST/src/FromTape/FromTapeProc.cpp index 2d268ef27..0f4db6e85 100755 --- a/plugins/LinuxVST/src/FromTape/FromTapeProc.cpp +++ b/plugins/LinuxVST/src/FromTape/FromTapeProc.cpp @@ -37,52 +37,16 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -221,14 +185,14 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -270,51 +234,15 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -454,16 +382,14 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Galactic/GalacticProc.cpp b/plugins/LinuxVST/src/Galactic/GalacticProc.cpp index ccb0aef48..19344f0e4 100644 --- a/plugins/LinuxVST/src/Galactic/GalacticProc.cpp +++ b/plugins/LinuxVST/src/Galactic/GalacticProc.cpp @@ -47,12 +47,12 @@ void Galactic::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -279,12 +279,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -453,12 +453,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Gatelope/Gatelope.cpp b/plugins/LinuxVST/src/Gatelope/Gatelope.cpp index 41ed2af14..225c337d5 100755 --- a/plugins/LinuxVST/src/Gatelope/Gatelope.cpp +++ b/plugins/LinuxVST/src/Gatelope/Gatelope.cpp @@ -28,8 +28,8 @@ Gatelope::Gatelope(audioMasterCallback audioMaster) : treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Gatelope/Gatelope.h b/plugins/LinuxVST/src/Gatelope/Gatelope.h index 06a0c5571..273e19f6f 100755 --- a/plugins/LinuxVST/src/Gatelope/Gatelope.h +++ b/plugins/LinuxVST/src/Gatelope/Gatelope.h @@ -67,8 +67,8 @@ private: double treblefreq; double bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Gatelope/GatelopeProc.cpp b/plugins/LinuxVST/src/Gatelope/GatelopeProc.cpp index f42904218..b5f1d67d7 100755 --- a/plugins/LinuxVST/src/Gatelope/GatelopeProc.cpp +++ b/plugins/LinuxVST/src/Gatelope/GatelopeProc.cpp @@ -36,8 +36,8 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -196,14 +196,14 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -244,8 +244,8 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -404,16 +404,14 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/GlitchShifter/GlitchShifterProc.cpp b/plugins/LinuxVST/src/GlitchShifter/GlitchShifterProc.cpp index 9059dc5db..852c3bc0f 100755 --- a/plugins/LinuxVST/src/GlitchShifter/GlitchShifterProc.cpp +++ b/plugins/LinuxVST/src/GlitchShifter/GlitchShifterProc.cpp @@ -26,12 +26,12 @@ void GlitchShifter::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -343,12 +343,12 @@ void GlitchShifter::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} diff --git a/plugins/LinuxVST/src/Golem/Golem.cpp b/plugins/LinuxVST/src/Golem/Golem.cpp index c99c5cd92..22d4cb6f5 100755 --- a/plugins/LinuxVST/src/Golem/Golem.cpp +++ b/plugins/LinuxVST/src/Golem/Golem.cpp @@ -17,8 +17,8 @@ Golem::Golem(audioMasterCallback audioMaster) : C = 0.0; for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/Golem/Golem.h b/plugins/LinuxVST/src/Golem/Golem.h index e02ab7822..4416d3463 100755 --- a/plugins/LinuxVST/src/Golem/Golem.h +++ b/plugins/LinuxVST/src/Golem/Golem.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff double p[4099]; diff --git a/plugins/LinuxVST/src/Golem/GolemProc.cpp b/plugins/LinuxVST/src/Golem/GolemProc.cpp index 1d7e9f5f9..316632391 100755 --- a/plugins/LinuxVST/src/Golem/GolemProc.cpp +++ b/plugins/LinuxVST/src/Golem/GolemProc.cpp @@ -33,51 +33,15 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -112,14 +76,14 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = inputSampleL; //the output is totally mono - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -157,51 +121,15 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -236,16 +164,14 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = inputSampleL; //the output is totally mono - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Gringer/Gringer.h b/plugins/LinuxVST/src/Gringer/Gringer.h index 3306f47eb..53d8dce83 100755 --- a/plugins/LinuxVST/src/Gringer/Gringer.h +++ b/plugins/LinuxVST/src/Gringer/Gringer.h @@ -54,10 +54,10 @@ private: uint32_t fpd; //default stuff - long double inbandL[9]; - long double outbandL[9]; - long double inbandR[9]; - long double outbandR[9]; + double inbandL[9]; + double outbandL[9]; + double inbandR[9]; + double outbandR[9]; }; diff --git a/plugins/LinuxVST/src/Gringer/GringerProc.cpp b/plugins/LinuxVST/src/Gringer/GringerProc.cpp index 2a40f387c..b76693f2e 100755 --- a/plugins/LinuxVST/src/Gringer/GringerProc.cpp +++ b/plugins/LinuxVST/src/Gringer/GringerProc.cpp @@ -58,8 +58,8 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -67,7 +67,7 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); @@ -173,8 +173,8 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -182,7 +182,7 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); diff --git a/plugins/LinuxVST/src/GrooveWear/GrooveWear.cpp b/plugins/LinuxVST/src/GrooveWear/GrooveWear.cpp index cbe1fc57a..b15478506 100755 --- a/plugins/LinuxVST/src/GrooveWear/GrooveWear.cpp +++ b/plugins/LinuxVST/src/GrooveWear/GrooveWear.cpp @@ -36,8 +36,8 @@ GrooveWear::GrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/GrooveWear/GrooveWear.h b/plugins/LinuxVST/src/GrooveWear/GrooveWear.h index 4bf97453c..fe207c7b6 100755 --- a/plugins/LinuxVST/src/GrooveWear/GrooveWear.h +++ b/plugins/LinuxVST/src/GrooveWear/GrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/LinuxVST/src/GrooveWear/GrooveWearProc.cpp b/plugins/LinuxVST/src/GrooveWear/GrooveWearProc.cpp index e663203a4..98eeec25e 100755 --- a/plugins/LinuxVST/src/GrooveWear/GrooveWearProc.cpp +++ b/plugins/LinuxVST/src/GrooveWear/GrooveWearProc.cpp @@ -98,51 +98,15 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -430,14 +394,14 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -540,51 +504,15 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -872,16 +800,14 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.cpp b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.cpp index b0388ab94..309ce7e4e 100755 --- a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.cpp +++ b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new G GuitarConditioner::GuitarConditioner(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; lastSampleTL = 0.0; lastSampleBL = 0.0; //for Slews. T for treble, B for bass diff --git a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.h b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.h index 3be09e141..fca5a3c07 100755 --- a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.h +++ b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditioner.h @@ -49,8 +49,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff bool fpFlip; double lastSampleTL; diff --git a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditionerProc.cpp b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditionerProc.cpp index b25d600d1..6bfd3bbc4 100755 --- a/plugins/LinuxVST/src/GuitarConditioner/GuitarConditionerProc.cpp +++ b/plugins/LinuxVST/src/GuitarConditioner/GuitarConditionerProc.cpp @@ -18,12 +18,12 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -40,44 +40,8 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -165,14 +129,14 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -195,12 +159,12 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -218,44 +182,8 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -342,16 +270,14 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs inputSampleR = trebleR + bassR; //final merge fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/HardVacuum/HardVacuum.cpp b/plugins/LinuxVST/src/HardVacuum/HardVacuum.cpp index 9c14f8993..533cb5610 100755 --- a/plugins/LinuxVST/src/HardVacuum/HardVacuum.cpp +++ b/plugins/LinuxVST/src/HardVacuum/HardVacuum.cpp @@ -19,8 +19,8 @@ HardVacuum::HardVacuum(audioMasterCallback audioMaster) : E = 1.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/HardVacuum/HardVacuum.h b/plugins/LinuxVST/src/HardVacuum/HardVacuum.h index 7f4c098cb..f159aadb8 100755 --- a/plugins/LinuxVST/src/HardVacuum/HardVacuum.h +++ b/plugins/LinuxVST/src/HardVacuum/HardVacuum.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/HardVacuum/HardVacuumProc.cpp b/plugins/LinuxVST/src/HardVacuum/HardVacuumProc.cpp index e0e07e2b2..87a1b1edb 100755 --- a/plugins/LinuxVST/src/HardVacuum/HardVacuumProc.cpp +++ b/plugins/LinuxVST/src/HardVacuum/HardVacuumProc.cpp @@ -36,51 +36,15 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -173,14 +137,14 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -221,52 +185,16 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -359,16 +287,14 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/HermeTrim/HermeTrim.cpp b/plugins/LinuxVST/src/HermeTrim/HermeTrim.cpp index 117cc4599..77103be7b 100755 --- a/plugins/LinuxVST/src/HermeTrim/HermeTrim.cpp +++ b/plugins/LinuxVST/src/HermeTrim/HermeTrim.cpp @@ -17,8 +17,8 @@ HermeTrim::HermeTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/HermeTrim/HermeTrim.h b/plugins/LinuxVST/src/HermeTrim/HermeTrim.h index f0bc8ed52..6db22a3b5 100755 --- a/plugins/LinuxVST/src/HermeTrim/HermeTrim.h +++ b/plugins/LinuxVST/src/HermeTrim/HermeTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/HermeTrim/HermeTrimProc.cpp b/plugins/LinuxVST/src/HermeTrim/HermeTrimProc.cpp index 66d314485..dccb829c6 100755 --- a/plugins/LinuxVST/src/HermeTrim/HermeTrimProc.cpp +++ b/plugins/LinuxVST/src/HermeTrim/HermeTrimProc.cpp @@ -21,10 +21,10 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Hermepass/Hermepass.cpp b/plugins/LinuxVST/src/Hermepass/Hermepass.cpp index 4e4a5322e..c18a227be 100755 --- a/plugins/LinuxVST/src/Hermepass/Hermepass.cpp +++ b/plugins/LinuxVST/src/Hermepass/Hermepass.cpp @@ -33,8 +33,8 @@ Hermepass::Hermepass(audioMasterCallback audioMaster) : iirGR = 0.0; iirHR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Hermepass/Hermepass.h b/plugins/LinuxVST/src/Hermepass/Hermepass.h index 1000bb9da..d3f2970cc 100755 --- a/plugins/LinuxVST/src/Hermepass/Hermepass.h +++ b/plugins/LinuxVST/src/Hermepass/Hermepass.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirAL; double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one diff --git a/plugins/LinuxVST/src/Hermepass/HermepassProc.cpp b/plugins/LinuxVST/src/Hermepass/HermepassProc.cpp index fddffe31d..178979fbf 100755 --- a/plugins/LinuxVST/src/Hermepass/HermepassProc.cpp +++ b/plugins/LinuxVST/src/Hermepass/HermepassProc.cpp @@ -17,8 +17,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -64,8 +64,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -74,44 +74,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -176,14 +140,14 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -205,8 +169,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -252,8 +216,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -262,44 +226,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -364,16 +292,14 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/HighGlossDither/HighGlossDitherProc.cpp b/plugins/LinuxVST/src/HighGlossDither/HighGlossDitherProc.cpp index 2529939de..fee894a81 100755 --- a/plugins/LinuxVST/src/HighGlossDither/HighGlossDitherProc.cpp +++ b/plugins/LinuxVST/src/HighGlossDither/HighGlossDitherProc.cpp @@ -16,51 +16,15 @@ void HighGlossDither::processReplacing(float **inputs, float **outputs, VstInt32 int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -111,51 +75,15 @@ void HighGlossDither::processDoubleReplacing(double **inputs, double **outputs, int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/LinuxVST/src/HighImpact/HighImpact.cpp b/plugins/LinuxVST/src/HighImpact/HighImpact.cpp index 960d80c7b..446f34127 100755 --- a/plugins/LinuxVST/src/HighImpact/HighImpact.cpp +++ b/plugins/LinuxVST/src/HighImpact/HighImpact.cpp @@ -17,8 +17,8 @@ HighImpact::HighImpact(audioMasterCallback audioMaster) : C = 0.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/HighImpact/HighImpact.h b/plugins/LinuxVST/src/HighImpact/HighImpact.h index a57230b85..71123e03c 100755 --- a/plugins/LinuxVST/src/HighImpact/HighImpact.h +++ b/plugins/LinuxVST/src/HighImpact/HighImpact.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/HighImpact/HighImpactProc.cpp b/plugins/LinuxVST/src/HighImpact/HighImpactProc.cpp index f24804a5e..c6ac619a9 100755 --- a/plugins/LinuxVST/src/HighImpact/HighImpactProc.cpp +++ b/plugins/LinuxVST/src/HighImpact/HighImpactProc.cpp @@ -15,10 +15,10 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -35,44 +35,8 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -158,14 +122,14 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,10 +152,10 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -208,44 +172,8 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -331,16 +259,14 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Highpass/Highpass.cpp b/plugins/LinuxVST/src/Highpass/Highpass.cpp index 86ebe241c..a87a3f0ce 100755 --- a/plugins/LinuxVST/src/Highpass/Highpass.cpp +++ b/plugins/LinuxVST/src/Highpass/Highpass.cpp @@ -19,8 +19,8 @@ Highpass::Highpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/Highpass/Highpass.h b/plugins/LinuxVST/src/Highpass/Highpass.h index 673f951fe..468baa479 100755 --- a/plugins/LinuxVST/src/Highpass/Highpass.h +++ b/plugins/LinuxVST/src/Highpass/Highpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Highpass/HighpassProc.cpp b/plugins/LinuxVST/src/Highpass/HighpassProc.cpp index 371ed57a4..92c60aa8b 100755 --- a/plugins/LinuxVST/src/Highpass/HighpassProc.cpp +++ b/plugins/LinuxVST/src/Highpass/HighpassProc.cpp @@ -40,44 +40,8 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -118,14 +82,14 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -170,44 +134,8 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -248,16 +176,14 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/LinuxVST/src/Highpass2/Highpass2Proc.cpp b/plugins/LinuxVST/src/Highpass2/Highpass2Proc.cpp index adc3ba169..e5f6a8066 100755 --- a/plugins/LinuxVST/src/Highpass2/Highpass2Proc.cpp +++ b/plugins/LinuxVST/src/Highpass2/Highpass2Proc.cpp @@ -38,8 +38,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -208,8 +208,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -247,8 +247,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/LinuxVST/src/Holt/Holt.h b/plugins/LinuxVST/src/Holt/Holt.h index bf14fca9d..d9d61e929 100755 --- a/plugins/LinuxVST/src/Holt/Holt.h +++ b/plugins/LinuxVST/src/Holt/Holt.h @@ -59,23 +59,23 @@ private: uint32_t fpd; //default stuff - long double previousSampleAL; - long double previousTrendAL; - long double previousSampleBL; - long double previousTrendBL; - long double previousSampleCL; - long double previousTrendCL; - long double previousSampleDL; - long double previousTrendDL; + double previousSampleAL; + double previousTrendAL; + double previousSampleBL; + double previousTrendBL; + double previousSampleCL; + double previousTrendCL; + double previousSampleDL; + double previousTrendDL; - long double previousSampleAR; - long double previousTrendAR; - long double previousSampleBR; - long double previousTrendBR; - long double previousSampleCR; - long double previousTrendCR; - long double previousSampleDR; - long double previousTrendDR; + double previousSampleAR; + double previousTrendAR; + double previousSampleBR; + double previousTrendBR; + double previousSampleCR; + double previousTrendCR; + double previousSampleDR; + double previousTrendDR; float A; diff --git a/plugins/LinuxVST/src/Holt/HoltProc.cpp b/plugins/LinuxVST/src/Holt/HoltProc.cpp index efe13495a..ca90811ad 100755 --- a/plugins/LinuxVST/src/Holt/HoltProc.cpp +++ b/plugins/LinuxVST/src/Holt/HoltProc.cpp @@ -20,8 +20,8 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -42,14 +42,14 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); @@ -157,8 +157,8 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -179,14 +179,14 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); diff --git a/plugins/LinuxVST/src/Hombre/Hombre.cpp b/plugins/LinuxVST/src/Hombre/Hombre.cpp index 8b03ed124..ebf3e4b36 100755 --- a/plugins/LinuxVST/src/Hombre/Hombre.cpp +++ b/plugins/LinuxVST/src/Hombre/Hombre.cpp @@ -17,8 +17,8 @@ Hombre::Hombre(audioMasterCallback audioMaster) : for(int count = 0; count < 4000; count++) {pL[count] = 0.0; pR[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Hombre/Hombre.h b/plugins/LinuxVST/src/Hombre/Hombre.h index e23f6f323..af14c14ed 100755 --- a/plugins/LinuxVST/src/Hombre/Hombre.h +++ b/plugins/LinuxVST/src/Hombre/Hombre.h @@ -58,8 +58,8 @@ private: double slide; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Hombre/HombreProc.cpp b/plugins/LinuxVST/src/Hombre/HombreProc.cpp index 16bf51377..5a24dde58 100755 --- a/plugins/LinuxVST/src/Hombre/HombreProc.cpp +++ b/plugins/LinuxVST/src/Hombre/HombreProc.cpp @@ -29,8 +29,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -38,44 +38,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -131,14 +95,14 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -172,8 +136,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -181,44 +145,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -274,16 +202,14 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Hull/Hull.h b/plugins/LinuxVST/src/Hull/Hull.h index bee68e58b..1d9df9e4d 100644 --- a/plugins/LinuxVST/src/Hull/Hull.h +++ b/plugins/LinuxVST/src/Hull/Hull.h @@ -53,11 +53,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bL[4005]; - long double bR[4005]; + double bL[4005]; + double bR[4005]; int bPointer; - long double cL[105]; - long double cR[105]; + double cL[105]; + double cR[105]; int cPointer; uint32_t fpdL; diff --git a/plugins/LinuxVST/src/Hull/HullProc.cpp b/plugins/LinuxVST/src/Hull/HullProc.cpp index ed19ddc25..4cdbe2d03 100644 --- a/plugins/LinuxVST/src/Hull/HullProc.cpp +++ b/plugins/LinuxVST/src/Hull/HullProc.cpp @@ -21,31 +21,31 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -69,8 +69,8 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -120,31 +120,31 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -168,8 +168,8 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -187,12 +187,12 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/HypersonX/HypersonXProc.cpp b/plugins/LinuxVST/src/HypersonX/HypersonXProc.cpp index 43ed3ec33..bd88aeefa 100644 --- a/plugins/LinuxVST/src/HypersonX/HypersonXProc.cpp +++ b/plugins/LinuxVST/src/HypersonX/HypersonXProc.cpp @@ -149,7 +149,7 @@ void HypersonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Hypersonic/HypersonicProc.cpp b/plugins/LinuxVST/src/Hypersonic/HypersonicProc.cpp index 7e914e796..d3361986c 100644 --- a/plugins/LinuxVST/src/Hypersonic/HypersonicProc.cpp +++ b/plugins/LinuxVST/src/Hypersonic/HypersonicProc.cpp @@ -319,7 +319,7 @@ void Hypersonic::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Infinity/Infinity.h b/plugins/LinuxVST/src/Infinity/Infinity.h index e17c3a139..6a3a0b593 100755 --- a/plugins/LinuxVST/src/Infinity/Infinity.h +++ b/plugins/LinuxVST/src/Infinity/Infinity.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/LinuxVST/src/Infinity/InfinityProc.cpp b/plugins/LinuxVST/src/Infinity/InfinityProc.cpp index 67dce7467..70c57ee1b 100755 --- a/plugins/LinuxVST/src/Infinity/InfinityProc.cpp +++ b/plugins/LinuxVST/src/Infinity/InfinityProc.cpp @@ -65,19 +65,19 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -88,15 +88,15 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -350,19 +350,19 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -373,15 +373,15 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -559,12 +559,12 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Infinity2/Infinity2.h b/plugins/LinuxVST/src/Infinity2/Infinity2.h index 2304eb777..60c0f9004 100644 --- a/plugins/LinuxVST/src/Infinity2/Infinity2.h +++ b/plugins/LinuxVST/src/Infinity2/Infinity2.h @@ -57,9 +57,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/LinuxVST/src/Infinity2/Infinity2Proc.cpp b/plugins/LinuxVST/src/Infinity2/Infinity2Proc.cpp index 81b745fab..cf8e5f6f8 100644 --- a/plugins/LinuxVST/src/Infinity2/Infinity2Proc.cpp +++ b/plugins/LinuxVST/src/Infinity2/Infinity2Proc.cpp @@ -65,32 +65,32 @@ void Infinity2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -366,32 +366,32 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -591,12 +591,12 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Infrasonic/Infrasonic.h b/plugins/LinuxVST/src/Infrasonic/Infrasonic.h index 940f13fc4..ef33b30ed 100755 --- a/plugins/LinuxVST/src/Infrasonic/Infrasonic.h +++ b/plugins/LinuxVST/src/Infrasonic/Infrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Infrasonic/InfrasonicProc.cpp b/plugins/LinuxVST/src/Infrasonic/InfrasonicProc.cpp index 0ebfbc7d0..135fd5e33 100755 --- a/plugins/LinuxVST/src/Infrasonic/InfrasonicProc.cpp +++ b/plugins/LinuxVST/src/Infrasonic/InfrasonicProc.cpp @@ -63,12 +63,12 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/LinuxVST/src/Interstage/Interstage.h b/plugins/LinuxVST/src/Interstage/Interstage.h index 146b84c0a..bb23c5c57 100755 --- a/plugins/LinuxVST/src/Interstage/Interstage.h +++ b/plugins/LinuxVST/src/Interstage/Interstage.h @@ -57,14 +57,14 @@ private: double iirSampleDL; double iirSampleEL; double iirSampleFL; - long double lastSampleL; + double lastSampleL; double iirSampleAR; double iirSampleBR; double iirSampleCR; double iirSampleDR; double iirSampleER; double iirSampleFR; - long double lastSampleR; + double lastSampleR; uint32_t fpd; bool flip; }; diff --git a/plugins/LinuxVST/src/Interstage/InterstageProc.cpp b/plugins/LinuxVST/src/Interstage/InterstageProc.cpp index df5bb385c..181983f57 100755 --- a/plugins/LinuxVST/src/Interstage/InterstageProc.cpp +++ b/plugins/LinuxVST/src/Interstage/InterstageProc.cpp @@ -24,12 +24,12 @@ void Interstage::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average @@ -111,12 +111,12 @@ void Interstage::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average diff --git a/plugins/LinuxVST/src/IronOxide5/IronOxide5.cpp b/plugins/LinuxVST/src/IronOxide5/IronOxide5.cpp index 914f53b5c..9d720380d 100755 --- a/plugins/LinuxVST/src/IronOxide5/IronOxide5.cpp +++ b/plugins/LinuxVST/src/IronOxide5/IronOxide5.cpp @@ -45,8 +45,8 @@ IronOxide5::IronOxide5(audioMasterCallback audioMaster) : rateof = 0.5; nextmax = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/IronOxide5/IronOxide5.h b/plugins/LinuxVST/src/IronOxide5/IronOxide5.h index 82d4c9ae3..8e1173796 100755 --- a/plugins/LinuxVST/src/IronOxide5/IronOxide5.h +++ b/plugins/LinuxVST/src/IronOxide5/IronOxide5.h @@ -101,8 +101,8 @@ private: double nextmax; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/IronOxide5/IronOxide5Proc.cpp b/plugins/LinuxVST/src/IronOxide5/IronOxide5Proc.cpp index e42d69f49..a79d2d315 100755 --- a/plugins/LinuxVST/src/IronOxide5/IronOxide5Proc.cpp +++ b/plugins/LinuxVST/src/IronOxide5/IronOxide5Proc.cpp @@ -62,8 +62,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -71,44 +71,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -419,14 +383,14 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp } //end invdrywet block with outputgain - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -493,8 +457,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -502,44 +466,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -850,16 +778,14 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn } //end invdrywet block with outputgain - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.cpp b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.cpp index 8ce7103db..a52227101 100755 --- a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.cpp +++ b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.cpp @@ -23,8 +23,8 @@ IronOxideClassic::IronOxideClassic(audioMasterCallback audioMaster) : fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; iirSampleAR = iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.h b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.h index bafb457f3..118b6fd9d 100755 --- a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.h +++ b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassic.h @@ -72,8 +72,8 @@ private: int gcount; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassicProc.cpp b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassicProc.cpp index 97bbacae1..8f7d52f98 100755 --- a/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassicProc.cpp +++ b/plugins/LinuxVST/src/IronOxideClassic/IronOxideClassicProc.cpp @@ -41,51 +41,15 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -342,14 +306,14 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,51 +359,15 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -696,16 +624,14 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2.h b/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2.h index 6d0a6b3ae..816678bb0 100644 --- a/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2.h +++ b/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2.h @@ -72,8 +72,8 @@ private: double slowIIRBR; double lastRefR[7]; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; int cycle; int gcount; diff --git a/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2Proc.cpp b/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2Proc.cpp index 1b4d68ec4..cbd05ac5f 100644 --- a/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2Proc.cpp +++ b/plugins/LinuxVST/src/IronOxideClassic2/IronOxideClassic2Proc.cpp @@ -67,11 +67,11 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -107,14 +107,14 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -129,7 +129,7 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -479,11 +479,11 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -519,14 +519,14 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -541,7 +541,7 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -813,12 +813,12 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs flip = !flip; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Isolator/Isolator.h b/plugins/LinuxVST/src/Isolator/Isolator.h index 36bb24290..c353897e0 100755 --- a/plugins/LinuxVST/src/Isolator/Isolator.h +++ b/plugins/LinuxVST/src/Isolator/Isolator.h @@ -54,9 +54,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Isolator/IsolatorProc.cpp b/plugins/LinuxVST/src/Isolator/IsolatorProc.cpp index ec083b419..ca777d947 100755 --- a/plugins/LinuxVST/src/Isolator/IsolatorProc.cpp +++ b/plugins/LinuxVST/src/Isolator/IsolatorProc.cpp @@ -62,18 +62,18 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -82,7 +82,7 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -182,18 +182,18 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -202,7 +202,7 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/LinuxVST/src/Logical4/Logical4.cpp b/plugins/LinuxVST/src/Logical4/Logical4.cpp index 15d185bea..72da4ad93 100755 --- a/plugins/LinuxVST/src/Logical4/Logical4.cpp +++ b/plugins/LinuxVST/src/Logical4/Logical4.cpp @@ -78,8 +78,8 @@ Logical4::Logical4(audioMasterCallback audioMaster) : gcount = 0; //end Power Sags fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Logical4/Logical4Proc.cpp b/plugins/LinuxVST/src/Logical4/Logical4Proc.cpp index 5d079f36b..df5c110f4 100755 --- a/plugins/LinuxVST/src/Logical4/Logical4Proc.cpp +++ b/plugins/LinuxVST/src/Logical4/Logical4Proc.cpp @@ -17,8 +17,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -119,44 +119,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -871,14 +835,14 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -900,8 +864,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -1001,44 +965,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1752,16 +1680,14 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Loud/LoudProc.cpp b/plugins/LinuxVST/src/Loud/LoudProc.cpp index 85d98996d..906f51dbd 100755 --- a/plugins/LinuxVST/src/Loud/LoudProc.cpp +++ b/plugins/LinuxVST/src/Loud/LoudProc.cpp @@ -21,8 +21,8 @@ void Loud::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; @@ -138,8 +138,8 @@ void Loud::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; diff --git a/plugins/LinuxVST/src/Lowpass/Lowpass.cpp b/plugins/LinuxVST/src/Lowpass/Lowpass.cpp index 18064fcae..9b6a6f4eb 100755 --- a/plugins/LinuxVST/src/Lowpass/Lowpass.cpp +++ b/plugins/LinuxVST/src/Lowpass/Lowpass.cpp @@ -19,8 +19,8 @@ Lowpass::Lowpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/Lowpass/Lowpass.h b/plugins/LinuxVST/src/Lowpass/Lowpass.h index 40ac45681..f9d4ec8c7 100755 --- a/plugins/LinuxVST/src/Lowpass/Lowpass.h +++ b/plugins/LinuxVST/src/Lowpass/Lowpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Lowpass/LowpassProc.cpp b/plugins/LinuxVST/src/Lowpass/LowpassProc.cpp index bcc369049..ea450b239 100755 --- a/plugins/LinuxVST/src/Lowpass/LowpassProc.cpp +++ b/plugins/LinuxVST/src/Lowpass/LowpassProc.cpp @@ -41,44 +41,8 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -120,14 +84,14 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -173,44 +137,8 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -252,16 +180,14 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/LinuxVST/src/Lowpass2/Lowpass2Proc.cpp b/plugins/LinuxVST/src/Lowpass2/Lowpass2Proc.cpp index e46b16e75..1dd3af06f 100755 --- a/plugins/LinuxVST/src/Lowpass2/Lowpass2Proc.cpp +++ b/plugins/LinuxVST/src/Lowpass2/Lowpass2Proc.cpp @@ -38,8 +38,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -209,8 +209,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -248,8 +248,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/LinuxVST/src/Luxor/LuxorProc.cpp b/plugins/LinuxVST/src/Luxor/LuxorProc.cpp index 086b1741e..c8d0add39 100755 --- a/plugins/LinuxVST/src/Luxor/LuxorProc.cpp +++ b/plugins/LinuxVST/src/Luxor/LuxorProc.cpp @@ -37,8 +37,8 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/MV/MVProc.cpp b/plugins/LinuxVST/src/MV/MVProc.cpp index 00082b487..11da2fce9 100755 --- a/plugins/LinuxVST/src/MV/MVProc.cpp +++ b/plugins/LinuxVST/src/MV/MVProc.cpp @@ -31,8 +31,8 @@ void MV::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -827,8 +827,8 @@ void MV::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; diff --git a/plugins/LinuxVST/src/MackEQ/MackEQ.h b/plugins/LinuxVST/src/MackEQ/MackEQ.h index 9447e67f3..d413503b3 100644 --- a/plugins/LinuxVST/src/MackEQ/MackEQ.h +++ b/plugins/LinuxVST/src/MackEQ/MackEQ.h @@ -56,22 +56,22 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleCL; - long double iirSampleDL; - long double iirSampleEL; - long double iirSampleFL; - long double iirSampleAR; - long double iirSampleBR; - long double iirSampleCR; - long double iirSampleDR; - long double iirSampleER; - long double iirSampleFR; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/MackEQ/MackEQProc.cpp b/plugins/LinuxVST/src/MackEQ/MackEQProc.cpp index 6713aed49..00466fda1 100644 --- a/plugins/LinuxVST/src/MackEQ/MackEQProc.cpp +++ b/plugins/LinuxVST/src/MackEQ/MackEQProc.cpp @@ -73,12 +73,12 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -90,10 +90,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -123,10 +123,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -149,11 +149,11 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -294,12 +294,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -311,10 +311,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -344,10 +344,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -370,11 +370,11 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -431,12 +431,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Mackity/Mackity.h b/plugins/LinuxVST/src/Mackity/Mackity.h index f6ecb608a..338df8de9 100755 --- a/plugins/LinuxVST/src/Mackity/Mackity.h +++ b/plugins/LinuxVST/src/Mackity/Mackity.h @@ -54,12 +54,12 @@ private: std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; - long double biquadA[15]; - long double biquadB[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Mackity/MackityProc.cpp b/plugins/LinuxVST/src/Mackity/MackityProc.cpp index 97a9b7fb6..ff7c1631a 100755 --- a/plugins/LinuxVST/src/Mackity/MackityProc.cpp +++ b/plugins/LinuxVST/src/Mackity/MackityProc.cpp @@ -47,10 +47,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -61,10 +61,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -148,10 +148,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -162,10 +162,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -191,12 +191,12 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (outPad != 1.0) {inputSampleL *= outPad; inputSampleR *= outPad;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/MatrixVerb/MatrixVerb.h b/plugins/LinuxVST/src/MatrixVerb/MatrixVerb.h index 3b2c0a62b..3f3b8298c 100755 --- a/plugins/LinuxVST/src/MatrixVerb/MatrixVerb.h +++ b/plugins/LinuxVST/src/MatrixVerb/MatrixVerb.h @@ -58,9 +58,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/LinuxVST/src/MatrixVerb/MatrixVerbProc.cpp b/plugins/LinuxVST/src/MatrixVerb/MatrixVerbProc.cpp index 15ee2871e..4099a1853 100755 --- a/plugins/LinuxVST/src/MatrixVerb/MatrixVerbProc.cpp +++ b/plugins/LinuxVST/src/MatrixVerb/MatrixVerbProc.cpp @@ -77,12 +77,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -91,12 +91,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -108,15 +108,15 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -470,12 +470,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -484,12 +484,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -501,15 +501,15 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -775,12 +775,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Melt/Melt.cpp b/plugins/LinuxVST/src/Melt/Melt.cpp index 35ede1e0d..b2f8301bc 100755 --- a/plugins/LinuxVST/src/Melt/Melt.cpp +++ b/plugins/LinuxVST/src/Melt/Melt.cpp @@ -26,8 +26,8 @@ Melt::Melt(audioMasterCallback audioMaster) : slowCount = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Melt/Melt.h b/plugins/LinuxVST/src/Melt/Melt.h index af11f0fc5..07cf0075c 100755 --- a/plugins/LinuxVST/src/Melt/Melt.h +++ b/plugins/LinuxVST/src/Melt/Melt.h @@ -70,8 +70,8 @@ private: int slowCount; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Melt/MeltProc.cpp b/plugins/LinuxVST/src/Melt/MeltProc.cpp index 8a55732df..c990386b6 100755 --- a/plugins/LinuxVST/src/Melt/MeltProc.cpp +++ b/plugins/LinuxVST/src/Melt/MeltProc.cpp @@ -22,10 +22,10 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -63,44 +63,8 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -268,14 +232,14 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -302,10 +266,10 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -343,44 +307,8 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -548,16 +476,14 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/MidSide/MidSide.cpp b/plugins/LinuxVST/src/MidSide/MidSide.cpp index 8f61cffda..4bb31183d 100755 --- a/plugins/LinuxVST/src/MidSide/MidSide.cpp +++ b/plugins/LinuxVST/src/MidSide/MidSide.cpp @@ -13,8 +13,8 @@ MidSide::MidSide(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/MidSide/MidSide.h b/plugins/LinuxVST/src/MidSide/MidSide.h index 4d139c874..086fbea98 100755 --- a/plugins/LinuxVST/src/MidSide/MidSide.h +++ b/plugins/LinuxVST/src/MidSide/MidSide.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/MidSide/MidSideProc.cpp b/plugins/LinuxVST/src/MidSide/MidSideProc.cpp index cca7a5cda..46fb1397e 100755 --- a/plugins/LinuxVST/src/MidSide/MidSideProc.cpp +++ b/plugins/LinuxVST/src/MidSide/MidSideProc.cpp @@ -15,11 +15,11 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -28,44 +28,8 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -75,7 +39,7 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -100,11 +64,11 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -113,44 +77,8 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -160,7 +88,7 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/LinuxVST/src/MoNoam/MoNoamProc.cpp b/plugins/LinuxVST/src/MoNoam/MoNoamProc.cpp index 105d34b15..64cc63a99 100755 --- a/plugins/LinuxVST/src/MoNoam/MoNoamProc.cpp +++ b/plugins/LinuxVST/src/MoNoam/MoNoamProc.cpp @@ -18,13 +18,13 @@ void MoNoam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; @@ -69,13 +69,13 @@ void MoNoam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/LinuxVST/src/Mojo/MojoProc.cpp b/plugins/LinuxVST/src/Mojo/MojoProc.cpp index 60f986d64..6687feea8 100755 --- a/plugins/LinuxVST/src/Mojo/MojoProc.cpp +++ b/plugins/LinuxVST/src/Mojo/MojoProc.cpp @@ -18,8 +18,8 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); @@ -65,8 +65,8 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); diff --git a/plugins/LinuxVST/src/Monitoring/Monitoring.h b/plugins/LinuxVST/src/Monitoring/Monitoring.h index f92a46b42..8dd0210fc 100755 --- a/plugins/LinuxVST/src/Monitoring/Monitoring.h +++ b/plugins/LinuxVST/src/Monitoring/Monitoring.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD double aL[1503], bL[1503], cL[1503], dL[1503]; double aR[1503], bR[1503], cR[1503], dR[1503]; @@ -73,8 +73,8 @@ private: double iirSampleTR, iirSampleUR, iirSampleVR; double iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquadL[11]; - long double biquadR[11]; + double biquadL[11]; + double biquadR[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/LinuxVST/src/Monitoring/MonitoringProc.cpp b/plugins/LinuxVST/src/Monitoring/MonitoringProc.cpp index ddb1f6f98..397d31b12 100755 --- a/plugins/LinuxVST/src/Monitoring/MonitoringProc.cpp +++ b/plugins/LinuxVST/src/Monitoring/MonitoringProc.cpp @@ -48,8 +48,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -116,7 +116,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -289,8 +289,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -305,17 +305,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -337,9 +337,9 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -396,7 +396,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -415,17 +415,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -439,7 +439,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -448,7 +448,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -565,8 +565,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -633,7 +633,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -806,8 +806,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -822,17 +822,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -854,9 +854,9 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -913,7 +913,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -932,17 +932,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -956,7 +956,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -965,7 +965,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/LinuxVST/src/Monitoring2/Monitoring2.h b/plugins/LinuxVST/src/Monitoring2/Monitoring2.h index 34e9aac76..a1d6c5e4b 100644 --- a/plugins/LinuxVST/src/Monitoring2/Monitoring2.h +++ b/plugins/LinuxVST/src/Monitoring2/Monitoring2.h @@ -87,7 +87,7 @@ private: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/LinuxVST/src/Monitoring2/Monitoring2Proc.cpp b/plugins/LinuxVST/src/Monitoring2/Monitoring2Proc.cpp index d9af88b6a..82325d164 100644 --- a/plugins/LinuxVST/src/Monitoring2/Monitoring2Proc.cpp +++ b/plugins/LinuxVST/src/Monitoring2/Monitoring2Proc.cpp @@ -42,8 +42,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -113,7 +113,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -286,8 +286,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -302,17 +302,17 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -334,9 +334,9 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -393,7 +393,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -525,8 +525,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -596,7 +596,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -769,8 +769,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -785,17 +785,17 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -817,9 +817,9 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -876,7 +876,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/LinuxVST/src/MultiBandDistortion/MultiBandDistortionProc.cpp b/plugins/LinuxVST/src/MultiBandDistortion/MultiBandDistortionProc.cpp index c2e097a11..0336c96dc 100644 --- a/plugins/LinuxVST/src/MultiBandDistortion/MultiBandDistortionProc.cpp +++ b/plugins/LinuxVST/src/MultiBandDistortion/MultiBandDistortionProc.cpp @@ -51,10 +51,10 @@ void MultiBandDistortion::processReplacing(float **inputs, float **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -296,10 +296,10 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -479,12 +479,12 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu inputSampleR *= outputGlobal; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.cpp b/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.cpp index 409f98398..a0a9a061d 100755 --- a/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.cpp +++ b/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.cpp @@ -31,8 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.h b/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.h index b3ecd9486..100f02bdb 100755 --- a/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.h +++ b/plugins/LinuxVST/src/NCSeventeen/NCSeventeen.h @@ -70,8 +70,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/NCSeventeen/NCSeventeenProc.cpp b/plugins/LinuxVST/src/NCSeventeen/NCSeventeenProc.cpp index e124cb5ff..aebc1ba49 100755 --- a/plugins/LinuxVST/src/NCSeventeen/NCSeventeenProc.cpp +++ b/plugins/LinuxVST/src/NCSeventeen/NCSeventeenProc.cpp @@ -39,13 +39,13 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -59,44 +59,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -344,14 +308,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,13 +359,13 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -414,44 +378,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -699,16 +627,14 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/NaturalizeDither/NaturalizeDitherProc.cpp b/plugins/LinuxVST/src/NaturalizeDither/NaturalizeDitherProc.cpp index e0b2d86d0..ffc731e21 100755 --- a/plugins/LinuxVST/src/NaturalizeDither/NaturalizeDitherProc.cpp +++ b/plugins/LinuxVST/src/NaturalizeDither/NaturalizeDitherProc.cpp @@ -14,8 +14,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -27,44 +27,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -248,8 +212,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -261,44 +225,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/LinuxVST/src/Neverland/NeverlandProc.cpp b/plugins/LinuxVST/src/Neverland/NeverlandProc.cpp index de15a19fa..58493f8a3 100755 --- a/plugins/LinuxVST/src/Neverland/NeverlandProc.cpp +++ b/plugins/LinuxVST/src/Neverland/NeverlandProc.cpp @@ -37,8 +37,8 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -214,8 +214,8 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; inputSampleL *= indrive; diff --git a/plugins/LinuxVST/src/Nikola/NikolaProc.cpp b/plugins/LinuxVST/src/Nikola/NikolaProc.cpp index 1b439c6e8..59738686d 100755 --- a/plugins/LinuxVST/src/Nikola/NikolaProc.cpp +++ b/plugins/LinuxVST/src/Nikola/NikolaProc.cpp @@ -20,12 +20,12 @@ void Nikola::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; @@ -1040,12 +1040,12 @@ void Nikola::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; else outlevelL = ((outlevelL * decay) + bridgerectifier) / (decay+1.0); diff --git a/plugins/LinuxVST/src/NodeDither/NodeDitherProc.cpp b/plugins/LinuxVST/src/NodeDither/NodeDitherProc.cpp index 3d6046485..50f3e85f9 100755 --- a/plugins/LinuxVST/src/NodeDither/NodeDitherProc.cpp +++ b/plugins/LinuxVST/src/NodeDither/NodeDitherProc.cpp @@ -25,8 +25,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -34,44 +34,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -135,8 +99,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -144,44 +108,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/LinuxVST/src/Noise/Noise.cpp b/plugins/LinuxVST/src/Noise/Noise.cpp index d955a290a..ebb384dbe 100755 --- a/plugins/LinuxVST/src/Noise/Noise.cpp +++ b/plugins/LinuxVST/src/Noise/Noise.cpp @@ -36,8 +36,8 @@ Noise::Noise(audioMasterCallback audioMaster) : flipR = false; filterflip = false; for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Noise/Noise.h b/plugins/LinuxVST/src/Noise/Noise.h index 67c32bcf5..d14ef6305 100755 --- a/plugins/LinuxVST/src/Noise/Noise.h +++ b/plugins/LinuxVST/src/Noise/Noise.h @@ -81,8 +81,8 @@ private: double f[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Noise/NoiseProc.cpp b/plugins/LinuxVST/src/Noise/NoiseProc.cpp index 31cba201a..0f75966cc 100755 --- a/plugins/LinuxVST/src/Noise/NoiseProc.cpp +++ b/plugins/LinuxVST/src/Noise/NoiseProc.cpp @@ -22,8 +22,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -111,44 +111,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -296,14 +260,14 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -330,8 +294,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -417,44 +381,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -602,16 +530,14 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.cpp b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.cpp index eb05bc33a..48eac47c8 100755 --- a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.cpp +++ b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.cpp @@ -195,8 +195,8 @@ NonlinearSpace::NonlinearSpace(audioMasterCallback audioMaster) : countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.h b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.h index dbaa0b3a4..b75c7a51d 100755 --- a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.h +++ b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpace.h @@ -208,8 +208,8 @@ private: double nonlin; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpaceProc.cpp b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpaceProc.cpp index f9df9fcc2..c7efecbc4 100755 --- a/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpaceProc.cpp +++ b/plugins/LinuxVST/src/NonlinearSpace/NonlinearSpaceProc.cpp @@ -17,10 +17,10 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -99,44 +99,8 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -743,14 +707,14 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; @@ -773,10 +737,10 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -855,44 +819,8 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1499,16 +1427,14 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCD.h b/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCD.h index 39f785e9e..d27f0cc5c 100755 --- a/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCD.h +++ b/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCD.h @@ -53,8 +53,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; }; diff --git a/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCDProc.cpp b/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCDProc.cpp index af4320013..f129dda8f 100755 --- a/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCDProc.cpp +++ b/plugins/LinuxVST/src/NotJustAnotherCD/NotJustAnotherCDProc.cpp @@ -14,8 +14,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -29,44 +29,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -263,8 +227,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -278,44 +242,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; diff --git a/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDither.h b/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDither.h index 5ca0c0a85..184a9269e 100755 --- a/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDither.h +++ b/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDither.h @@ -55,8 +55,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDitherProc.cpp b/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDitherProc.cpp index 1a8071115..7e38de75c 100755 --- a/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDitherProc.cpp +++ b/plugins/LinuxVST/src/NotJustAnotherDither/NotJustAnotherDitherProc.cpp @@ -29,8 +29,8 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -43,18 +43,18 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -70,7 +70,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -81,7 +81,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -183,8 +183,8 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -197,18 +197,18 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -224,7 +224,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -235,7 +235,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleL; + double outputSampleL; if (totalA < totalB) {bynL[hotbinA] += 1; outputSampleL = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSampleL = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -282,7 +282,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleR; + double outputSampleR; if (totalA < totalB) {bynR[hotbinA] += 1; outputSampleR = floor(inputSampleR);} else {bynR[hotbinB] += 1; outputSampleR = floor(inputSampleR+1);} //assign the relevant one to the delay line diff --git a/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.cpp b/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.cpp index 59e28246f..ea15e1fe2 100755 --- a/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.cpp +++ b/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.cpp @@ -25,8 +25,8 @@ OneCornerClip::OneCornerClip(audioMasterCallback audioMaster) : limitPosR = 0.0; limitNegR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.h b/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.h index 4f039fa00..a69f185b2 100755 --- a/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.h +++ b/plugins/LinuxVST/src/OneCornerClip/OneCornerClip.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/LinuxVST/src/OneCornerClip/OneCornerClipProc.cpp b/plugins/LinuxVST/src/OneCornerClip/OneCornerClipProc.cpp index c45c69b91..194cab890 100755 --- a/plugins/LinuxVST/src/OneCornerClip/OneCornerClipProc.cpp +++ b/plugins/LinuxVST/src/OneCornerClip/OneCornerClipProc.cpp @@ -41,51 +41,15 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -154,14 +118,14 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither if (clipEngage == false) { @@ -214,52 +178,16 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -328,16 +256,14 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither if (clipEngage == false) { diff --git a/plugins/LinuxVST/src/PDBuss/PDBuss.cpp b/plugins/LinuxVST/src/PDBuss/PDBuss.cpp index 8b31d8b58..60bdec0bd 100755 --- a/plugins/LinuxVST/src/PDBuss/PDBuss.cpp +++ b/plugins/LinuxVST/src/PDBuss/PDBuss.cpp @@ -21,8 +21,8 @@ PDBuss::PDBuss(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PDBuss/PDBuss.h b/plugins/LinuxVST/src/PDBuss/PDBuss.h index 3e6d9b8da..0b962dcfb 100755 --- a/plugins/LinuxVST/src/PDBuss/PDBuss.h +++ b/plugins/LinuxVST/src/PDBuss/PDBuss.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/LinuxVST/src/PDBuss/PDBussProc.cpp b/plugins/LinuxVST/src/PDBuss/PDBussProc.cpp index 6da8fa0c4..00b05af39 100755 --- a/plugins/LinuxVST/src/PDBuss/PDBussProc.cpp +++ b/plugins/LinuxVST/src/PDBuss/PDBussProc.cpp @@ -21,8 +21,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -152,8 +116,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -166,44 +130,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -250,16 +178,14 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PDChannel/PDChannel.cpp b/plugins/LinuxVST/src/PDChannel/PDChannel.cpp index aef639d5e..6cf15db30 100755 --- a/plugins/LinuxVST/src/PDChannel/PDChannel.cpp +++ b/plugins/LinuxVST/src/PDChannel/PDChannel.cpp @@ -21,8 +21,8 @@ PDChannel::PDChannel(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PDChannel/PDChannel.h b/plugins/LinuxVST/src/PDChannel/PDChannel.h index ea233e26b..cd7c14fb7 100755 --- a/plugins/LinuxVST/src/PDChannel/PDChannel.h +++ b/plugins/LinuxVST/src/PDChannel/PDChannel.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/LinuxVST/src/PDChannel/PDChannelProc.cpp b/plugins/LinuxVST/src/PDChannel/PDChannelProc.cpp index fb5932de6..2277acc7d 100755 --- a/plugins/LinuxVST/src/PDChannel/PDChannelProc.cpp +++ b/plugins/LinuxVST/src/PDChannel/PDChannelProc.cpp @@ -21,8 +21,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -112,14 +76,14 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -145,8 +109,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -159,44 +123,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -236,16 +164,14 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Pafnuty/Pafnuty.cpp b/plugins/LinuxVST/src/Pafnuty/Pafnuty.cpp index 8c6f42d09..14eb30129 100755 --- a/plugins/LinuxVST/src/Pafnuty/Pafnuty.cpp +++ b/plugins/LinuxVST/src/Pafnuty/Pafnuty.cpp @@ -25,8 +25,8 @@ Pafnuty::Pafnuty(audioMasterCallback audioMaster) : K = 0.5; L = 0.5; M = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Pafnuty/Pafnuty.h b/plugins/LinuxVST/src/Pafnuty/Pafnuty.h index 3a832b773..80eba3e36 100755 --- a/plugins/LinuxVST/src/Pafnuty/Pafnuty.h +++ b/plugins/LinuxVST/src/Pafnuty/Pafnuty.h @@ -64,8 +64,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Pafnuty/PafnutyProc.cpp b/plugins/LinuxVST/src/Pafnuty/PafnutyProc.cpp index 710bcdc8f..79d2326a1 100755 --- a/plugins/LinuxVST/src/Pafnuty/PafnutyProc.cpp +++ b/plugins/LinuxVST/src/Pafnuty/PafnutyProc.cpp @@ -14,52 +14,52 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out1 = outputs[0]; float* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,14 +258,14 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -284,52 +284,52 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -528,16 +528,14 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PaulDither/PaulDitherProc.cpp b/plugins/LinuxVST/src/PaulDither/PaulDitherProc.cpp index 759c49820..476bfd332 100755 --- a/plugins/LinuxVST/src/PaulDither/PaulDitherProc.cpp +++ b/plugins/LinuxVST/src/PaulDither/PaulDitherProc.cpp @@ -31,8 +31,8 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -103,8 +103,8 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/PaulWide/PaulWideProc.cpp b/plugins/LinuxVST/src/PaulWide/PaulWideProc.cpp index c8ba4a921..13cd58f79 100644 --- a/plugins/LinuxVST/src/PaulWide/PaulWideProc.cpp +++ b/plugins/LinuxVST/src/PaulWide/PaulWideProc.cpp @@ -28,8 +28,8 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -46,14 +46,14 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises @@ -116,8 +116,8 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -134,14 +134,14 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/LinuxVST/src/PeaksOnly/PeaksOnlyProc.cpp b/plugins/LinuxVST/src/PeaksOnly/PeaksOnlyProc.cpp index 89aa62f35..39a49e8c1 100755 --- a/plugins/LinuxVST/src/PeaksOnly/PeaksOnlyProc.cpp +++ b/plugins/LinuxVST/src/PeaksOnly/PeaksOnlyProc.cpp @@ -26,8 +26,8 @@ void PeaksOnly::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -165,8 +165,8 @@ void PeaksOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.cpp b/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.cpp index e9e5c8d6d..7c200bd4d 100755 --- a/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.cpp +++ b/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.cpp @@ -16,8 +16,8 @@ PhaseNudge::PhaseNudge(audioMasterCallback audioMaster) : B = 1.0; for(int count = 0; count < 1502; count++) {dL[count] = 0.0; dR[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.h b/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.h index 2926ccbea..a2f0dedbc 100755 --- a/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.h +++ b/plugins/LinuxVST/src/PhaseNudge/PhaseNudge.h @@ -57,8 +57,8 @@ private: double dR[1503]; int one, maxdelay; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/PhaseNudge/PhaseNudgeProc.cpp b/plugins/LinuxVST/src/PhaseNudge/PhaseNudgeProc.cpp index 150ecd567..449d1f224 100755 --- a/plugins/LinuxVST/src/PhaseNudge/PhaseNudgeProc.cpp +++ b/plugins/LinuxVST/src/PhaseNudge/PhaseNudgeProc.cpp @@ -23,53 +23,17 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,53 +132,17 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PitchDelay/PitchDelay.h b/plugins/LinuxVST/src/PitchDelay/PitchDelay.h index b5c0fc1b2..2c6f52ffc 100644 --- a/plugins/LinuxVST/src/PitchDelay/PitchDelay.h +++ b/plugins/LinuxVST/src/PitchDelay/PitchDelay.h @@ -63,8 +63,8 @@ private: double regenSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; @@ -72,8 +72,8 @@ private: double regenSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/LinuxVST/src/PitchDelay/PitchDelayProc.cpp b/plugins/LinuxVST/src/PitchDelay/PitchDelayProc.cpp index 4dcdcbafe..be0bb419f 100644 --- a/plugins/LinuxVST/src/PitchDelay/PitchDelayProc.cpp +++ b/plugins/LinuxVST/src/PitchDelay/PitchDelayProc.cpp @@ -64,12 +64,12 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -294,12 +294,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -309,7 +309,7 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -449,12 +449,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/PocketVerbs/PocketVerbsProc.cpp b/plugins/LinuxVST/src/PocketVerbs/PocketVerbsProc.cpp index 4ea8f5120..c6ab00834 100755 --- a/plugins/LinuxVST/src/PocketVerbs/PocketVerbsProc.cpp +++ b/plugins/LinuxVST/src/PocketVerbs/PocketVerbsProc.cpp @@ -469,14 +469,14 @@ void PocketVerbs::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); @@ -9645,14 +9645,14 @@ void PocketVerbs::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); diff --git a/plugins/LinuxVST/src/Podcast/PodcastProc.cpp b/plugins/LinuxVST/src/Podcast/PodcastProc.cpp index e8fd9949a..4a4c4fdd6 100755 --- a/plugins/LinuxVST/src/Podcast/PodcastProc.cpp +++ b/plugins/LinuxVST/src/Podcast/PodcastProc.cpp @@ -30,12 +30,12 @@ void Podcast::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; @@ -189,12 +189,12 @@ void Podcast::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; diff --git a/plugins/LinuxVST/src/PodcastDeluxe/PodcastDeluxeProc.cpp b/plugins/LinuxVST/src/PodcastDeluxe/PodcastDeluxeProc.cpp index 5349f2eb0..eafe49669 100755 --- a/plugins/LinuxVST/src/PodcastDeluxe/PodcastDeluxeProc.cpp +++ b/plugins/LinuxVST/src/PodcastDeluxe/PodcastDeluxeProc.cpp @@ -45,8 +45,8 @@ void PodcastDeluxe::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -371,8 +371,8 @@ void PodcastDeluxe::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Point/Point.cpp b/plugins/LinuxVST/src/Point/Point.cpp index f79547099..636dec5f7 100755 --- a/plugins/LinuxVST/src/Point/Point.cpp +++ b/plugins/LinuxVST/src/Point/Point.cpp @@ -24,8 +24,8 @@ Point::Point(audioMasterCallback audioMaster) : nibBR = 0.0; nobBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/Point/Point.h b/plugins/LinuxVST/src/Point/Point.h index ff898cb39..046c81f6b 100755 --- a/plugins/LinuxVST/src/Point/Point.h +++ b/plugins/LinuxVST/src/Point/Point.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double nibAL; diff --git a/plugins/LinuxVST/src/Point/PointProc.cpp b/plugins/LinuxVST/src/Point/PointProc.cpp index a3bbe3cf2..70173909f 100755 --- a/plugins/LinuxVST/src/Point/PointProc.cpp +++ b/plugins/LinuxVST/src/Point/PointProc.cpp @@ -27,51 +27,15 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -127,14 +91,14 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,51 +130,15 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -266,16 +194,14 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Pop/Pop.h b/plugins/LinuxVST/src/Pop/Pop.h index c598dfcaa..9784b4ee5 100755 --- a/plugins/LinuxVST/src/Pop/Pop.h +++ b/plugins/LinuxVST/src/Pop/Pop.h @@ -64,12 +64,12 @@ private: double muSpeedBL; double muCoefficientAL; double muCoefficientBL; - long double thickenL; - long double previousL; - long double previous2L; - long double previous3L; - long double previous4L; - long double previous5L; + double thickenL; + double previousL; + double previous2L; + double previous3L; + double previous4L; + double previous5L; double dL[10001]; double muVaryR; @@ -79,12 +79,12 @@ private: double muSpeedBR; double muCoefficientAR; double muCoefficientBR; - long double thickenR; - long double previousR; - long double previous2R; - long double previous3R; - long double previous4R; - long double previous5R; + double thickenR; + double previousR; + double previous2R; + double previous3R; + double previous4R; + double previous5R; double dR[10001]; int delay; diff --git a/plugins/LinuxVST/src/Pop/PopProc.cpp b/plugins/LinuxVST/src/Pop/PopProc.cpp index a7174cf46..44e7efd3a 100755 --- a/plugins/LinuxVST/src/Pop/PopProc.cpp +++ b/plugins/LinuxVST/src/Pop/PopProc.cpp @@ -34,14 +34,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -51,7 +51,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -66,7 +66,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -195,14 +195,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -211,7 +211,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm @@ -281,14 +281,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -298,7 +298,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -313,7 +313,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -442,14 +442,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -458,7 +458,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/LinuxVST/src/PowerSag/PowerSag.cpp b/plugins/LinuxVST/src/PowerSag/PowerSag.cpp index d1d0745bc..12c46489a 100755 --- a/plugins/LinuxVST/src/PowerSag/PowerSag.cpp +++ b/plugins/LinuxVST/src/PowerSag/PowerSag.cpp @@ -18,8 +18,8 @@ PowerSag::PowerSag(audioMasterCallback audioMaster) : gcount = 0; A = 0.0; B = 0.3; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PowerSag/PowerSag.h b/plugins/LinuxVST/src/PowerSag/PowerSag.h index 38839b650..106a02c34 100755 --- a/plugins/LinuxVST/src/PowerSag/PowerSag.h +++ b/plugins/LinuxVST/src/PowerSag/PowerSag.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double dL[9000]; double dR[9000]; diff --git a/plugins/LinuxVST/src/PowerSag/PowerSagProc.cpp b/plugins/LinuxVST/src/PowerSag/PowerSagProc.cpp index de43be625..61c9be8c7 100755 --- a/plugins/LinuxVST/src/PowerSag/PowerSagProc.cpp +++ b/plugins/LinuxVST/src/PowerSag/PowerSagProc.cpp @@ -23,51 +23,15 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -120,14 +84,14 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -155,51 +119,15 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -252,16 +180,14 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PowerSag2/PowerSag2Proc.cpp b/plugins/LinuxVST/src/PowerSag2/PowerSag2Proc.cpp index 645d7b259..69e12f697 100755 --- a/plugins/LinuxVST/src/PowerSag2/PowerSag2Proc.cpp +++ b/plugins/LinuxVST/src/PowerSag2/PowerSag2Proc.cpp @@ -20,12 +20,12 @@ void PowerSag2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); @@ -89,12 +89,12 @@ void PowerSag2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); diff --git a/plugins/LinuxVST/src/Precious/PreciousProc.cpp b/plugins/LinuxVST/src/Precious/PreciousProc.cpp index 01aeef35c..d15680a95 100755 --- a/plugins/LinuxVST/src/Precious/PreciousProc.cpp +++ b/plugins/LinuxVST/src/Precious/PreciousProc.cpp @@ -37,8 +37,8 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Preponderant/Preponderant.h b/plugins/LinuxVST/src/Preponderant/Preponderant.h index dd7949024..731430fb8 100755 --- a/plugins/LinuxVST/src/Preponderant/Preponderant.h +++ b/plugins/LinuxVST/src/Preponderant/Preponderant.h @@ -56,25 +56,25 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; - long double bassBalanceL; - long double midBalanceL; - long double highBalanceL; - long double bassTrackL; - long double midTrackL; - long double highTrackL; - long double quicknessL; + double bassBalanceL; + double midBalanceL; + double highBalanceL; + double bassTrackL; + double midTrackL; + double highTrackL; + double quicknessL; - long double bassBalanceR; - long double midBalanceR; - long double highBalanceR; - long double bassTrackR; - long double midTrackR; - long double highTrackR; - long double quicknessR; + double bassBalanceR; + double midBalanceR; + double highBalanceR; + double bassTrackR; + double midTrackR; + double highTrackR; + double quicknessR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Preponderant/PreponderantProc.cpp b/plugins/LinuxVST/src/Preponderant/PreponderantProc.cpp index d1956b1a6..9ea118e03 100755 --- a/plugins/LinuxVST/src/Preponderant/PreponderantProc.cpp +++ b/plugins/LinuxVST/src/Preponderant/PreponderantProc.cpp @@ -62,43 +62,43 @@ void Preponderant::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -258,43 +258,43 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -381,12 +381,12 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Pressure4/Pressure4.cpp b/plugins/LinuxVST/src/Pressure4/Pressure4.cpp index 10ed5facf..cdfc41d8b 100755 --- a/plugins/LinuxVST/src/Pressure4/Pressure4.cpp +++ b/plugins/LinuxVST/src/Pressure4/Pressure4.cpp @@ -16,8 +16,8 @@ Pressure4::Pressure4(audioMasterCallback audioMaster) : B = 0.2; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/LinuxVST/src/Pressure4/Pressure4.h b/plugins/LinuxVST/src/Pressure4/Pressure4.h index 6cf344845..1e30c3f88 100755 --- a/plugins/LinuxVST/src/Pressure4/Pressure4.h +++ b/plugins/LinuxVST/src/Pressure4/Pressure4.h @@ -62,8 +62,8 @@ private: double muSpeedB; double muCoefficientA; double muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/LinuxVST/src/Pressure4/Pressure4Proc.cpp b/plugins/LinuxVST/src/Pressure4/Pressure4Proc.cpp index 7e285df60..2c1445a6b 100755 --- a/plugins/LinuxVST/src/Pressure4/Pressure4Proc.cpp +++ b/plugins/LinuxVST/src/Pressure4/Pressure4Proc.cpp @@ -24,7 +24,7 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -44,51 +44,15 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -192,14 +156,14 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; @@ -228,7 +192,7 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -248,52 +212,16 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -397,16 +325,14 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; diff --git a/plugins/LinuxVST/src/Pressure5/Pressure5.h b/plugins/LinuxVST/src/Pressure5/Pressure5.h index de0e13480..479d94b12 100644 --- a/plugins/LinuxVST/src/Pressure5/Pressure5.h +++ b/plugins/LinuxVST/src/Pressure5/Pressure5.h @@ -82,15 +82,15 @@ private: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/LinuxVST/src/Pressure5/Pressure5Proc.cpp b/plugins/LinuxVST/src/Pressure5/Pressure5Proc.cpp index 42d8fe532..41fbf6480 100644 --- a/plugins/LinuxVST/src/Pressure5/Pressure5Proc.cpp +++ b/plugins/LinuxVST/src/Pressure5/Pressure5Proc.cpp @@ -49,18 +49,18 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -160,7 +160,7 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -276,18 +276,18 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -387,7 +387,7 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -443,12 +443,12 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt //final clip runs AFTER the Dry/Wet. It serves as a safety clip even if you're not full wet //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/PurestAir/PurestAir.h b/plugins/LinuxVST/src/PurestAir/PurestAir.h index 5b592c3b4..d077af8c5 100755 --- a/plugins/LinuxVST/src/PurestAir/PurestAir.h +++ b/plugins/LinuxVST/src/PurestAir/PurestAir.h @@ -56,23 +56,23 @@ private: uint32_t fpd; //default stuff - long double last1SampleL; - long double halfwaySampleL; - long double halfDrySampleL; - long double halfDiffSampleL; - long double diffSampleL; - long double lastSampleL; + double last1SampleL; + double halfwaySampleL; + double halfDrySampleL; + double halfDiffSampleL; + double diffSampleL; + double lastSampleL; double s1L; double s2L; double s3L; double applyL; - long double last1SampleR; - long double halfwaySampleR; - long double halfDrySampleR; - long double halfDiffSampleR; - long double diffSampleR; - long double lastSampleR; + double last1SampleR; + double halfwaySampleR; + double halfDrySampleR; + double halfDiffSampleR; + double diffSampleR; + double lastSampleR; double s1R; double s2R; double s3R; diff --git a/plugins/LinuxVST/src/PurestAir/PurestAirProc.cpp b/plugins/LinuxVST/src/PurestAir/PurestAirProc.cpp index 73939a77e..362e27217 100755 --- a/plugins/LinuxVST/src/PurestAir/PurestAirProc.cpp +++ b/plugins/LinuxVST/src/PurestAir/PurestAirProc.cpp @@ -23,12 +23,12 @@ void PurestAir::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; @@ -128,12 +128,12 @@ void PurestAir::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; diff --git a/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2Buss.h b/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2Buss.h index b65aa472f..d625c7545 100755 --- a/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2Buss.h +++ b/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2Buss.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2BussProc.cpp b/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2BussProc.cpp index 346bf2ae8..08b4a4904 100755 --- a/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2BussProc.cpp +++ b/plugins/LinuxVST/src/PurestConsole2Buss/PurestConsole2BussProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Buss::processReplacing(float **inputs, float **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -90,13 +90,13 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -115,12 +115,12 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2Channel.h b/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2Channel.h index ac89c047d..6c7a2753e 100755 --- a/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2Channel.h +++ b/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2Channel.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2ChannelProc.cpp b/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2ChannelProc.cpp index 124b27f16..127c7910b 100755 --- a/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2ChannelProc.cpp +++ b/plugins/LinuxVST/src/PurestConsole2Channel/PurestConsole2ChannelProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Channel::processReplacing(float **inputs, float **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -89,13 +89,13 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -113,12 +113,12 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.cpp b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.cpp index 2d8e61900..c7b1ee68e 100755 --- a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.cpp +++ b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleBuss::PurestConsoleBuss(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.h b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.h index 51495fcc9..2c49190a0 100755 --- a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.h +++ b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBuss.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBussProc.cpp b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBussProc.cpp index 6211eeb29..95223c51e 100755 --- a/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBussProc.cpp +++ b/plugins/LinuxVST/src/PurestConsoleBuss/PurestConsoleBussProc.cpp @@ -15,51 +15,15 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -71,14 +35,14 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -98,51 +62,15 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -154,16 +82,14 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.cpp b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.cpp index 35649a6f6..909f43b68 100755 --- a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.cpp +++ b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleChannel::PurestConsoleChannel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.h b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.h index 51e728f59..aa984365d 100755 --- a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.h +++ b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannel.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannelProc.cpp b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannelProc.cpp index 2fc513aa3..4a500fadf 100755 --- a/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannelProc.cpp +++ b/plugins/LinuxVST/src/PurestConsoleChannel/PurestConsoleChannelProc.cpp @@ -15,64 +15,28 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -92,66 +56,28 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PurestDrive/PurestDrive.cpp b/plugins/LinuxVST/src/PurestDrive/PurestDrive.cpp index a1d926444..08c592079 100755 --- a/plugins/LinuxVST/src/PurestDrive/PurestDrive.cpp +++ b/plugins/LinuxVST/src/PurestDrive/PurestDrive.cpp @@ -17,8 +17,8 @@ PurestDrive::PurestDrive(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestDrive/PurestDrive.h b/plugins/LinuxVST/src/PurestDrive/PurestDrive.h index abcd65bb4..2b84c79e1 100755 --- a/plugins/LinuxVST/src/PurestDrive/PurestDrive.h +++ b/plugins/LinuxVST/src/PurestDrive/PurestDrive.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double previousSampleL; diff --git a/plugins/LinuxVST/src/PurestDrive/PurestDriveProc.cpp b/plugins/LinuxVST/src/PurestDrive/PurestDriveProc.cpp index f5cc80477..39c9096f5 100755 --- a/plugins/LinuxVST/src/PurestDrive/PurestDriveProc.cpp +++ b/plugins/LinuxVST/src/PurestDrive/PurestDriveProc.cpp @@ -18,52 +18,16 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -87,14 +51,14 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -117,8 +81,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; @@ -126,44 +90,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -187,16 +115,14 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PurestEcho/PurestEcho.cpp b/plugins/LinuxVST/src/PurestEcho/PurestEcho.cpp index 6bcaa3f69..d54d53c1e 100755 --- a/plugins/LinuxVST/src/PurestEcho/PurestEcho.cpp +++ b/plugins/LinuxVST/src/PurestEcho/PurestEcho.cpp @@ -19,8 +19,8 @@ PurestEcho::PurestEcho(audioMasterCallback audioMaster) : E = 0.0; for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestEcho/PurestEcho.h b/plugins/LinuxVST/src/PurestEcho/PurestEcho.h index 870e15822..e16cde658 100755 --- a/plugins/LinuxVST/src/PurestEcho/PurestEcho.h +++ b/plugins/LinuxVST/src/PurestEcho/PurestEcho.h @@ -62,8 +62,8 @@ private: int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/PurestEcho/PurestEchoProc.cpp b/plugins/LinuxVST/src/PurestEcho/PurestEchoProc.cpp index e8e141cd4..a64daf546 100755 --- a/plugins/LinuxVST/src/PurestEcho/PurestEchoProc.cpp +++ b/plugins/LinuxVST/src/PurestEcho/PurestEchoProc.cpp @@ -77,51 +77,15 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -174,14 +138,14 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -263,51 +227,15 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -360,16 +288,14 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/PurestFade/PurestFadeProc.cpp b/plugins/LinuxVST/src/PurestFade/PurestFadeProc.cpp index ef2f9fc09..31f0a9d17 100755 --- a/plugins/LinuxVST/src/PurestFade/PurestFadeProc.cpp +++ b/plugins/LinuxVST/src/PurestFade/PurestFadeProc.cpp @@ -31,24 +31,24 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -119,24 +119,24 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/PurestGain/PurestGain.cpp b/plugins/LinuxVST/src/PurestGain/PurestGain.cpp index b1b77fe18..d068d7fac 100755 --- a/plugins/LinuxVST/src/PurestGain/PurestGain.cpp +++ b/plugins/LinuxVST/src/PurestGain/PurestGain.cpp @@ -18,8 +18,8 @@ PurestGain::PurestGain(audioMasterCallback audioMaster) : settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestGain/PurestGain.h b/plugins/LinuxVST/src/PurestGain/PurestGain.h index 9e2baeab4..b9d3a2d47 100755 --- a/plugins/LinuxVST/src/PurestGain/PurestGain.h +++ b/plugins/LinuxVST/src/PurestGain/PurestGain.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/LinuxVST/src/PurestGain/PurestGainProc.cpp b/plugins/LinuxVST/src/PurestGain/PurestGainProc.cpp index 4aa6d96fb..2ca5b8478 100755 --- a/plugins/LinuxVST/src/PurestGain/PurestGainProc.cpp +++ b/plugins/LinuxVST/src/PurestGain/PurestGainProc.cpp @@ -44,8 +44,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; //A is 0-1 (you can't feed other values to VST hosts, it's always 0-1 internally) //B is 0-1 and you need to multiply it by 100 if you want to use the 'percent' @@ -74,44 +74,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -122,7 +86,7 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= outputgain; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -176,8 +140,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { @@ -200,44 +164,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -248,7 +176,7 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/LinuxVST/src/PurestSquish/PurestSquishProc.cpp b/plugins/LinuxVST/src/PurestSquish/PurestSquishProc.cpp index 1be853713..946d23963 100755 --- a/plugins/LinuxVST/src/PurestSquish/PurestSquishProc.cpp +++ b/plugins/LinuxVST/src/PurestSquish/PurestSquishProc.cpp @@ -18,10 +18,10 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -29,8 +29,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); @@ -522,10 +522,10 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -533,8 +533,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -572,8 +572,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/LinuxVST/src/PurestWarm/PurestWarm.cpp b/plugins/LinuxVST/src/PurestWarm/PurestWarm.cpp index eeee37b58..13dbe8bd6 100755 --- a/plugins/LinuxVST/src/PurestWarm/PurestWarm.cpp +++ b/plugins/LinuxVST/src/PurestWarm/PurestWarm.cpp @@ -13,8 +13,8 @@ PurestWarm::PurestWarm(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/PurestWarm/PurestWarm.h b/plugins/LinuxVST/src/PurestWarm/PurestWarm.h index 98bb0ce4e..83fd9c336 100755 --- a/plugins/LinuxVST/src/PurestWarm/PurestWarm.h +++ b/plugins/LinuxVST/src/PurestWarm/PurestWarm.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/PurestWarm/PurestWarmProc.cpp b/plugins/LinuxVST/src/PurestWarm/PurestWarmProc.cpp index 101c9319d..b34bfb596 100755 --- a/plugins/LinuxVST/src/PurestWarm/PurestWarmProc.cpp +++ b/plugins/LinuxVST/src/PurestWarm/PurestWarmProc.cpp @@ -17,51 +17,15 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -70,7 +34,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -82,7 +46,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -95,7 +59,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -108,7 +72,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -138,51 +102,15 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -191,7 +119,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -206,7 +134,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -221,7 +149,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -235,7 +163,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/LinuxVST/src/Pyewacket/Pyewacket.cpp b/plugins/LinuxVST/src/Pyewacket/Pyewacket.cpp index d500e7449..2be4313fe 100755 --- a/plugins/LinuxVST/src/Pyewacket/Pyewacket.cpp +++ b/plugins/LinuxVST/src/Pyewacket/Pyewacket.cpp @@ -18,8 +18,8 @@ Pyewacket::Pyewacket(audioMasterCallback audioMaster) : chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Pyewacket/Pyewacket.h b/plugins/LinuxVST/src/Pyewacket/Pyewacket.h index 087a198ee..5624c4b93 100755 --- a/plugins/LinuxVST/src/Pyewacket/Pyewacket.h +++ b/plugins/LinuxVST/src/Pyewacket/Pyewacket.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double chase; double lastrectifierL; diff --git a/plugins/LinuxVST/src/Pyewacket/PyewacketProc.cpp b/plugins/LinuxVST/src/Pyewacket/PyewacketProc.cpp index 8b3021a9e..8b21a91fb 100755 --- a/plugins/LinuxVST/src/Pyewacket/PyewacketProc.cpp +++ b/plugins/LinuxVST/src/Pyewacket/PyewacketProc.cpp @@ -17,12 +17,12 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -41,44 +41,8 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -133,14 +97,14 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,12 +126,12 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -186,44 +150,8 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -278,16 +206,14 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp b/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp index 4ee485fa4..a4414634e 100755 --- a/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp +++ b/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp @@ -27,8 +27,8 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -84,8 +84,8 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp b/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp index 78e012e26..0a1b401c3 100755 --- a/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp +++ b/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp @@ -28,8 +28,8 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -87,8 +87,8 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Recurve/Recurve.h b/plugins/LinuxVST/src/Recurve/Recurve.h index 52a507738..bb90e4bac 100755 --- a/plugins/LinuxVST/src/Recurve/Recurve.h +++ b/plugins/LinuxVST/src/Recurve/Recurve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/Recurve/RecurveProc.cpp b/plugins/LinuxVST/src/Recurve/RecurveProc.cpp index 8a0b85d85..fc20e5b25 100755 --- a/plugins/LinuxVST/src/Recurve/RecurveProc.cpp +++ b/plugins/LinuxVST/src/Recurve/RecurveProc.cpp @@ -16,8 +16,8 @@ void Recurve::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -71,8 +71,8 @@ void Recurve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Remap/RemapProc.cpp b/plugins/LinuxVST/src/Remap/RemapProc.cpp index 594800c96..b9227743f 100755 --- a/plugins/LinuxVST/src/Remap/RemapProc.cpp +++ b/plugins/LinuxVST/src/Remap/RemapProc.cpp @@ -21,18 +21,18 @@ void Remap::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; @@ -95,18 +95,18 @@ void Remap::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; diff --git a/plugins/LinuxVST/src/ResEQ/ResEQProc.cpp b/plugins/LinuxVST/src/ResEQ/ResEQProc.cpp index 99fa31999..c9c21c0dd 100755 --- a/plugins/LinuxVST/src/ResEQ/ResEQProc.cpp +++ b/plugins/LinuxVST/src/ResEQ/ResEQProc.cpp @@ -128,12 +128,12 @@ void ResEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; @@ -422,14 +422,14 @@ void ResEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; diff --git a/plugins/LinuxVST/src/Reverb/Reverb.h b/plugins/LinuxVST/src/Reverb/Reverb.h index a7b966d93..5d6f36229 100755 --- a/plugins/LinuxVST/src/Reverb/Reverb.h +++ b/plugins/LinuxVST/src/Reverb/Reverb.h @@ -53,9 +53,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/LinuxVST/src/Reverb/ReverbProc.cpp b/plugins/LinuxVST/src/Reverb/ReverbProc.cpp index 7140d1781..3dce2d8af 100755 --- a/plugins/LinuxVST/src/Reverb/ReverbProc.cpp +++ b/plugins/LinuxVST/src/Reverb/ReverbProc.cpp @@ -68,12 +68,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -82,12 +82,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -99,15 +99,15 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -446,12 +446,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -460,12 +460,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -477,15 +477,15 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -745,12 +745,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Righteous4/Righteous4.cpp b/plugins/LinuxVST/src/Righteous4/Righteous4.cpp index 3c50a7493..ffedc9292 100755 --- a/plugins/LinuxVST/src/Righteous4/Righteous4.cpp +++ b/plugins/LinuxVST/src/Righteous4/Righteous4.cpp @@ -105,8 +105,8 @@ Righteous4::Righteous4(audioMasterCallback audioMaster) : gwAR = 0.0; gwBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Righteous4/Righteous4.h b/plugins/LinuxVST/src/Righteous4/Righteous4.h index 8b9e44b57..4ddd61ec9 100755 --- a/plugins/LinuxVST/src/Righteous4/Righteous4.h +++ b/plugins/LinuxVST/src/Righteous4/Righteous4.h @@ -108,7 +108,7 @@ private: double rightSampleZ; double bynL[13]; - long double noiseShapingL; + double noiseShapingL; double lastSampleL; double IIRsampleL; double gwPrevL; @@ -116,15 +116,15 @@ private: double gwBL; double bynR[13]; - long double noiseShapingR; + double noiseShapingR; double lastSampleR; double IIRsampleR; double gwPrevR; double gwAR; double gwBR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Righteous4/Righteous4Proc.cpp b/plugins/LinuxVST/src/Righteous4/Righteous4Proc.cpp index feff69b52..3b330cb6d 100755 --- a/plugins/LinuxVST/src/Righteous4/Righteous4Proc.cpp +++ b/plugins/LinuxVST/src/Righteous4/Righteous4Proc.cpp @@ -13,8 +13,8 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); @@ -42,46 +42,10 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -95,7 +59,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -300,14 +264,14 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp //output dither section if (bitDepth == 3) { - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out @@ -523,8 +487,8 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0002597;//scaleback of harmonic avg IIRscaleback /= overallscale; IIRscaleback = 1.0 - IIRscaleback; @@ -549,46 +513,10 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -602,7 +530,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -807,16 +735,14 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn //output dither section if (bitDepth == 3) { - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out diff --git a/plugins/LinuxVST/src/SideDull/SideDull.cpp b/plugins/LinuxVST/src/SideDull/SideDull.cpp index 479bdfd5d..1153e90bc 100755 --- a/plugins/LinuxVST/src/SideDull/SideDull.cpp +++ b/plugins/LinuxVST/src/SideDull/SideDull.cpp @@ -16,8 +16,8 @@ SideDull::SideDull(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/SideDull/SideDull.h b/plugins/LinuxVST/src/SideDull/SideDull.h index ef5e892c8..36950fd08 100755 --- a/plugins/LinuxVST/src/SideDull/SideDull.h +++ b/plugins/LinuxVST/src/SideDull/SideDull.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; float A; }; diff --git a/plugins/LinuxVST/src/SideDull/SideDullProc.cpp b/plugins/LinuxVST/src/SideDull/SideDullProc.cpp index 7b777444b..06f8ec15b 100755 --- a/plugins/LinuxVST/src/SideDull/SideDullProc.cpp +++ b/plugins/LinuxVST/src/SideDull/SideDullProc.cpp @@ -18,9 +18,9 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -28,44 +28,8 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -85,14 +49,14 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -115,9 +79,9 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -125,44 +89,8 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -182,16 +110,14 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Sidepass/Sidepass.cpp b/plugins/LinuxVST/src/Sidepass/Sidepass.cpp index a28c21233..8dc84167f 100755 --- a/plugins/LinuxVST/src/Sidepass/Sidepass.cpp +++ b/plugins/LinuxVST/src/Sidepass/Sidepass.cpp @@ -16,8 +16,8 @@ Sidepass::Sidepass(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Sidepass/Sidepass.h b/plugins/LinuxVST/src/Sidepass/Sidepass.h index 1b31b911e..4755073ea 100755 --- a/plugins/LinuxVST/src/Sidepass/Sidepass.h +++ b/plugins/LinuxVST/src/Sidepass/Sidepass.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/Sidepass/SidepassProc.cpp b/plugins/LinuxVST/src/Sidepass/SidepassProc.cpp index 834ae3e26..b6b664d3f 100755 --- a/plugins/LinuxVST/src/Sidepass/SidepassProc.cpp +++ b/plugins/LinuxVST/src/Sidepass/SidepassProc.cpp @@ -18,53 +18,17 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -84,14 +48,14 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -114,53 +78,17 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -180,16 +108,14 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.cpp b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.cpp index fd8a06a35..28ba08c34 100755 --- a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.cpp +++ b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.cpp @@ -19,8 +19,8 @@ SingleEndedTriode::SingleEndedTriode(audioMasterCallback audioMaster) : postsine = sin(0.5); - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.h b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.h index c162512f3..340d8dbd8 100755 --- a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.h +++ b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriode.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double postsine; diff --git a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriodeProc.cpp b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriodeProc.cpp index ef6694c21..882fca727 100755 --- a/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriodeProc.cpp +++ b/plugins/LinuxVST/src/SingleEndedTriode/SingleEndedTriodeProc.cpp @@ -23,46 +23,10 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -73,7 +37,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -93,7 +57,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -109,7 +73,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -127,14 +91,14 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,46 +126,10 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -212,7 +140,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -232,7 +160,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -248,7 +176,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -266,16 +194,14 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Slew/SlewProc.cpp b/plugins/LinuxVST/src/Slew/SlewProc.cpp index 5618bb793..480beb3fd 100755 --- a/plugins/LinuxVST/src/Slew/SlewProc.cpp +++ b/plugins/LinuxVST/src/Slew/SlewProc.cpp @@ -33,44 +33,8 @@ void Slew::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; @@ -122,44 +86,8 @@ void Slew::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; diff --git a/plugins/LinuxVST/src/Slew2/Slew2Proc.cpp b/plugins/LinuxVST/src/Slew2/Slew2Proc.cpp index 07b1bb9d3..cea1b98e8 100755 --- a/plugins/LinuxVST/src/Slew2/Slew2Proc.cpp +++ b/plugins/LinuxVST/src/Slew2/Slew2Proc.cpp @@ -26,44 +26,8 @@ void Slew2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -173,44 +137,8 @@ void Slew2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/LinuxVST/src/Slew3/Slew3Proc.cpp b/plugins/LinuxVST/src/Slew3/Slew3Proc.cpp index eacd1386f..18177c5ea 100755 --- a/plugins/LinuxVST/src/Slew3/Slew3Proc.cpp +++ b/plugins/LinuxVST/src/Slew3/Slew3Proc.cpp @@ -22,8 +22,8 @@ void Slew3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void Slew3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/SlewOnly/SlewOnlyProc.cpp b/plugins/LinuxVST/src/SlewOnly/SlewOnlyProc.cpp index 5fc12c3a8..5676a6f91 100755 --- a/plugins/LinuxVST/src/SlewOnly/SlewOnlyProc.cpp +++ b/plugins/LinuxVST/src/SlewOnly/SlewOnlyProc.cpp @@ -14,54 +14,18 @@ void SlewOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; outputSampleR = (inputSampleR - lastSampleR)*trim; @@ -89,54 +53,18 @@ void SlewOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; diff --git a/plugins/LinuxVST/src/Smooth/SmoothProc.cpp b/plugins/LinuxVST/src/Smooth/SmoothProc.cpp index 1fb135570..81df54143 100755 --- a/plugins/LinuxVST/src/Smooth/SmoothProc.cpp +++ b/plugins/LinuxVST/src/Smooth/SmoothProc.cpp @@ -28,8 +28,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); @@ -214,8 +214,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -253,8 +253,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); diff --git a/plugins/LinuxVST/src/SoftGate/SoftGateProc.cpp b/plugins/LinuxVST/src/SoftGate/SoftGateProc.cpp index a09429bfc..ba8d6358c 100755 --- a/plugins/LinuxVST/src/SoftGate/SoftGateProc.cpp +++ b/plugins/LinuxVST/src/SoftGate/SoftGateProc.cpp @@ -26,8 +26,8 @@ void SoftGate::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void SoftGate::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/SpatializeDither/SpatializeDitherProc.cpp b/plugins/LinuxVST/src/SpatializeDither/SpatializeDitherProc.cpp index 4a611e8fa..bf9da7ef7 100755 --- a/plugins/LinuxVST/src/SpatializeDither/SpatializeDitherProc.cpp +++ b/plugins/LinuxVST/src/SpatializeDither/SpatializeDitherProc.cpp @@ -34,8 +34,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -125,8 +125,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Spiral/SpiralProc.cpp b/plugins/LinuxVST/src/Spiral/SpiralProc.cpp index 0ad97429c..f672d63d1 100755 --- a/plugins/LinuxVST/src/Spiral/SpiralProc.cpp +++ b/plugins/LinuxVST/src/Spiral/SpiralProc.cpp @@ -16,8 +16,8 @@ void Spiral::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -55,8 +55,8 @@ void Spiral::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/Spiral2/Spiral2.h b/plugins/LinuxVST/src/Spiral2/Spiral2.h index a65051eab..7da43323c 100755 --- a/plugins/LinuxVST/src/Spiral2/Spiral2.h +++ b/plugins/LinuxVST/src/Spiral2/Spiral2.h @@ -56,14 +56,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double prevSampleL; + double iirSampleAL; + double iirSampleBL; + double prevSampleL; uint32_t fpd; - long double iirSampleAR; - long double iirSampleBR; - long double prevSampleR; + double iirSampleAR; + double iirSampleBR; + double prevSampleR; bool flip; //default stuff diff --git a/plugins/LinuxVST/src/Spiral2/Spiral2Proc.cpp b/plugins/LinuxVST/src/Spiral2/Spiral2Proc.cpp index 2655f678a..36f15560c 100755 --- a/plugins/LinuxVST/src/Spiral2/Spiral2Proc.cpp +++ b/plugins/LinuxVST/src/Spiral2/Spiral2Proc.cpp @@ -26,14 +26,14 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -58,8 +58,8 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); @@ -124,14 +124,14 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -156,8 +156,8 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); diff --git a/plugins/LinuxVST/src/Srsly/Srsly.h b/plugins/LinuxVST/src/Srsly/Srsly.h index 0f1654320..6d1dcc7d9 100644 --- a/plugins/LinuxVST/src/Srsly/Srsly.h +++ b/plugins/LinuxVST/src/Srsly/Srsly.h @@ -56,17 +56,17 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Srsly/SrslyProc.cpp b/plugins/LinuxVST/src/Srsly/SrslyProc.cpp index 9ecc01cd1..066119dac 100644 --- a/plugins/LinuxVST/src/Srsly/SrslyProc.cpp +++ b/plugins/LinuxVST/src/Srsly/SrslyProc.cpp @@ -16,7 +16,7 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -127,81 +127,81 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -254,7 +254,7 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -365,81 +365,81 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -465,12 +465,12 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Srsly2/Srsly2.h b/plugins/LinuxVST/src/Srsly2/Srsly2.h index 78d5df5f7..f8c2bdbef 100755 --- a/plugins/LinuxVST/src/Srsly2/Srsly2.h +++ b/plugins/LinuxVST/src/Srsly2/Srsly2.h @@ -57,17 +57,17 @@ private: std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Srsly2/Srsly2Proc.cpp b/plugins/LinuxVST/src/Srsly2/Srsly2Proc.cpp index a1eb1ce15..13306512c 100755 --- a/plugins/LinuxVST/src/Srsly2/Srsly2Proc.cpp +++ b/plugins/LinuxVST/src/Srsly2/Srsly2Proc.cpp @@ -16,7 +16,7 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -132,81 +132,81 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -273,7 +273,7 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -389,81 +389,81 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -503,12 +503,12 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/StarChild/StarChild.cpp b/plugins/LinuxVST/src/StarChild/StarChild.cpp index 6e4bf3e9a..610c87efc 100755 --- a/plugins/LinuxVST/src/StarChild/StarChild.cpp +++ b/plugins/LinuxVST/src/StarChild/StarChild.cpp @@ -66,8 +66,8 @@ StarChild::StarChild(audioMasterCallback audioMaster) : increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/StarChild/StarChild.h b/plugins/LinuxVST/src/StarChild/StarChild.h index 630be3c82..157454b92 100755 --- a/plugins/LinuxVST/src/StarChild/StarChild.h +++ b/plugins/LinuxVST/src/StarChild/StarChild.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double d[45102]; diff --git a/plugins/LinuxVST/src/StarChild/StarChildProc.cpp b/plugins/LinuxVST/src/StarChild/StarChildProc.cpp index 047948abe..608c93157 100755 --- a/plugins/LinuxVST/src/StarChild/StarChildProc.cpp +++ b/plugins/LinuxVST/src/StarChild/StarChildProc.cpp @@ -76,44 +76,8 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -389,14 +353,14 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,44 +440,8 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -790,16 +718,14 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/StereoFX/StereoFX.cpp b/plugins/LinuxVST/src/StereoFX/StereoFX.cpp index 704cbf375..8531bcdbe 100755 --- a/plugins/LinuxVST/src/StereoFX/StereoFX.cpp +++ b/plugins/LinuxVST/src/StereoFX/StereoFX.cpp @@ -17,8 +17,8 @@ StereoFX::StereoFX(audioMasterCallback audioMaster) : C = 0.0; iirSampleA = 0.0; iirSampleB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = false; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/StereoFX/StereoFX.h b/plugins/LinuxVST/src/StereoFX/StereoFX.h index 7a3605921..04d34a587 100755 --- a/plugins/LinuxVST/src/StereoFX/StereoFX.h +++ b/plugins/LinuxVST/src/StereoFX/StereoFX.h @@ -56,8 +56,8 @@ private: double iirSampleA; double iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff diff --git a/plugins/LinuxVST/src/StereoFX/StereoFXProc.cpp b/plugins/LinuxVST/src/StereoFX/StereoFXProc.cpp index 0e9de7478..0c3ae4962 100755 --- a/plugins/LinuxVST/src/StereoFX/StereoFXProc.cpp +++ b/plugins/LinuxVST/src/StereoFX/StereoFXProc.cpp @@ -17,10 +17,10 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -40,44 +40,8 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -135,14 +99,14 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -164,10 +128,10 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -187,44 +151,8 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -282,16 +210,14 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/StudioTan/StudioTan.h b/plugins/LinuxVST/src/StudioTan/StudioTan.h index 66caf4866..9e17ad768 100755 --- a/plugins/LinuxVST/src/StudioTan/StudioTan.h +++ b/plugins/LinuxVST/src/StudioTan/StudioTan.h @@ -52,15 +52,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13]; - long double noiseShapingL; - long double lastSampleL; - long double lastSample2L; + double bynL[13]; + double noiseShapingL; + double lastSampleL; + double lastSample2L; - long double bynR[13]; - long double noiseShapingR; - long double lastSampleR; - long double lastSample2R; + double bynR[13]; + double noiseShapingR; + double lastSampleR; + double lastSample2R; float A; diff --git a/plugins/LinuxVST/src/StudioTan/StudioTanProc.cpp b/plugins/LinuxVST/src/StudioTan/StudioTanProc.cpp index 3258f7b4f..de2418d10 100755 --- a/plugins/LinuxVST/src/StudioTan/StudioTanProc.cpp +++ b/plugins/LinuxVST/src/StudioTan/StudioTanProc.cpp @@ -30,12 +30,12 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -54,7 +54,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -66,7 +66,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -93,7 +93,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -252,11 +252,11 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; @@ -308,12 +308,12 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -332,7 +332,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -344,7 +344,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -371,7 +371,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -530,11 +530,11 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; diff --git a/plugins/LinuxVST/src/SubsOnly/SubsOnlyProc.cpp b/plugins/LinuxVST/src/SubsOnly/SubsOnlyProc.cpp index 23e79231f..3a7df87a0 100755 --- a/plugins/LinuxVST/src/SubsOnly/SubsOnlyProc.cpp +++ b/plugins/LinuxVST/src/SubsOnly/SubsOnlyProc.cpp @@ -22,51 +22,15 @@ void SubsOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; @@ -306,51 +270,15 @@ void SubsOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; diff --git a/plugins/LinuxVST/src/Surge/Surge.cpp b/plugins/LinuxVST/src/Surge/Surge.cpp index 222fbcf96..e330af883 100755 --- a/plugins/LinuxVST/src/Surge/Surge.cpp +++ b/plugins/LinuxVST/src/Surge/Surge.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new S Surge::Surge(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/LinuxVST/src/Surge/Surge.h b/plugins/LinuxVST/src/Surge/Surge.h index 7f42c9f74..18d47a94a 100755 --- a/plugins/LinuxVST/src/Surge/Surge.h +++ b/plugins/LinuxVST/src/Surge/Surge.h @@ -53,14 +53,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; float A; float B; diff --git a/plugins/LinuxVST/src/Surge/SurgeProc.cpp b/plugins/LinuxVST/src/Surge/SurgeProc.cpp index cd82badfb..53cac6996 100755 --- a/plugins/LinuxVST/src/Surge/SurgeProc.cpp +++ b/plugins/LinuxVST/src/Surge/SurgeProc.cpp @@ -18,10 +18,10 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -36,44 +36,8 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -117,14 +81,14 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -147,10 +111,10 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -164,44 +128,8 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -245,16 +173,14 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/SurgeTide/SurgeTide.cpp b/plugins/LinuxVST/src/SurgeTide/SurgeTide.cpp index 494e886b8..ba28ed38f 100755 --- a/plugins/LinuxVST/src/SurgeTide/SurgeTide.cpp +++ b/plugins/LinuxVST/src/SurgeTide/SurgeTide.cpp @@ -15,8 +15,8 @@ SurgeTide::SurgeTide(audioMasterCallback audioMaster) : A = 0.5; B = 0.3; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/LinuxVST/src/SurgeTide/SurgeTide.h b/plugins/LinuxVST/src/SurgeTide/SurgeTide.h index 8f8cd4241..f6a2b7cbf 100755 --- a/plugins/LinuxVST/src/SurgeTide/SurgeTide.h +++ b/plugins/LinuxVST/src/SurgeTide/SurgeTide.h @@ -54,12 +54,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; + double chaseA; + double chaseB; + double chaseC; float A; float B; diff --git a/plugins/LinuxVST/src/SurgeTide/SurgeTideProc.cpp b/plugins/LinuxVST/src/SurgeTide/SurgeTideProc.cpp index 59a92aa02..ea08259c9 100755 --- a/plugins/LinuxVST/src/SurgeTide/SurgeTideProc.cpp +++ b/plugins/LinuxVST/src/SurgeTide/SurgeTideProc.cpp @@ -18,10 +18,10 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -34,44 +34,8 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -107,14 +71,14 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -137,10 +101,10 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -153,44 +117,8 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,16 +154,14 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Swell/Swell.cpp b/plugins/LinuxVST/src/Swell/Swell.cpp index e197cfb5f..f1b5da9a3 100755 --- a/plugins/LinuxVST/src/Swell/Swell.cpp +++ b/plugins/LinuxVST/src/Swell/Swell.cpp @@ -21,8 +21,8 @@ Swell::Swell(audioMasterCallback audioMaster) : louderL = false; louderR = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Swell/Swell.h b/plugins/LinuxVST/src/Swell/Swell.h index 7c108b728..1acfaf86c 100755 --- a/plugins/LinuxVST/src/Swell/Swell.h +++ b/plugins/LinuxVST/src/Swell/Swell.h @@ -54,13 +54,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double swellL; - long double swellR; + double swellL; + double swellR; bool louderL; bool louderR; diff --git a/plugins/LinuxVST/src/Swell/SwellProc.cpp b/plugins/LinuxVST/src/Swell/SwellProc.cpp index 3ab1e9b43..447613b50 100755 --- a/plugins/LinuxVST/src/Swell/SwellProc.cpp +++ b/plugins/LinuxVST/src/Swell/SwellProc.cpp @@ -25,53 +25,17 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -94,14 +58,14 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,53 +95,17 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -200,16 +128,14 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TPDFDither/TPDFDitherProc.cpp b/plugins/LinuxVST/src/TPDFDither/TPDFDitherProc.cpp index 865cd643d..e51504299 100755 --- a/plugins/LinuxVST/src/TPDFDither/TPDFDitherProc.cpp +++ b/plugins/LinuxVST/src/TPDFDither/TPDFDitherProc.cpp @@ -28,8 +28,8 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -86,8 +86,8 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/TPDFWide/TPDFWideProc.cpp b/plugins/LinuxVST/src/TPDFWide/TPDFWideProc.cpp index 810a8ebac..45b831dac 100644 --- a/plugins/LinuxVST/src/TPDFWide/TPDFWideProc.cpp +++ b/plugins/LinuxVST/src/TPDFWide/TPDFWideProc.cpp @@ -28,8 +28,8 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -39,12 +39,12 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises @@ -104,8 +104,8 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -115,12 +115,12 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/LinuxVST/src/Tape/Tape.h b/plugins/LinuxVST/src/Tape/Tape.h index 932247bac..1ab35bd88 100755 --- a/plugins/LinuxVST/src/Tape/Tape.h +++ b/plugins/LinuxVST/src/Tape/Tape.h @@ -63,19 +63,19 @@ private: double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/Tape/TapeProc.cpp b/plugins/LinuxVST/src/Tape/TapeProc.cpp index 961a1c1e4..4d498b2cd 100755 --- a/plugins/LinuxVST/src/Tape/TapeProc.cpp +++ b/plugins/LinuxVST/src/Tape/TapeProc.cpp @@ -45,18 +45,18 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -158,15 +158,15 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain != 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -324,8 +324,8 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -334,14 +334,14 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= inputgain; } //gain cut before anything, even dry - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -443,15 +443,15 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; diff --git a/plugins/LinuxVST/src/TapeDelay/TapeDelay.cpp b/plugins/LinuxVST/src/TapeDelay/TapeDelay.cpp index f7690dbd9..345f06d58 100755 --- a/plugins/LinuxVST/src/TapeDelay/TapeDelay.cpp +++ b/plugins/LinuxVST/src/TapeDelay/TapeDelay.cpp @@ -26,8 +26,8 @@ TapeDelay::TapeDelay(audioMasterCallback audioMaster) : gcount = 0; chase = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/TapeDelay/TapeDelay.h b/plugins/LinuxVST/src/TapeDelay/TapeDelay.h index f5fcb6ce3..d1708fa60 100755 --- a/plugins/LinuxVST/src/TapeDelay/TapeDelay.h +++ b/plugins/LinuxVST/src/TapeDelay/TapeDelay.h @@ -66,8 +66,8 @@ private: int maxdelay; int chase; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/TapeDelay/TapeDelayProc.cpp b/plugins/LinuxVST/src/TapeDelay/TapeDelayProc.cpp index e2f1ade22..ef32867b9 100755 --- a/plugins/LinuxVST/src/TapeDelay/TapeDelayProc.cpp +++ b/plugins/LinuxVST/src/TapeDelay/TapeDelayProc.cpp @@ -35,8 +35,8 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -156,14 +156,14 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -202,8 +202,8 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -323,16 +323,14 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TapeDelay2/TapeDelay2.h b/plugins/LinuxVST/src/TapeDelay2/TapeDelay2.h index 5f9d9e7a3..178d356fb 100644 --- a/plugins/LinuxVST/src/TapeDelay2/TapeDelay2.h +++ b/plugins/LinuxVST/src/TapeDelay2/TapeDelay2.h @@ -62,16 +62,16 @@ private: double prevSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; double prevSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/LinuxVST/src/TapeDelay2/TapeDelay2Proc.cpp b/plugins/LinuxVST/src/TapeDelay2/TapeDelay2Proc.cpp index 3fbb9d938..a6b4e4b2d 100644 --- a/plugins/LinuxVST/src/TapeDelay2/TapeDelay2Proc.cpp +++ b/plugins/LinuxVST/src/TapeDelay2/TapeDelay2Proc.cpp @@ -62,12 +62,12 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -266,12 +266,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -283,7 +283,7 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -397,12 +397,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/TapeDither/TapeDitherProc.cpp b/plugins/LinuxVST/src/TapeDither/TapeDitherProc.cpp index 9011c04d9..4bf9003fd 100755 --- a/plugins/LinuxVST/src/TapeDither/TapeDitherProc.cpp +++ b/plugins/LinuxVST/src/TapeDither/TapeDitherProc.cpp @@ -30,8 +30,8 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -99,8 +99,8 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/TapeDust/TapeDust.cpp b/plugins/LinuxVST/src/TapeDust/TapeDust.cpp index 0ce16e093..11ff21768 100755 --- a/plugins/LinuxVST/src/TapeDust/TapeDust.cpp +++ b/plugins/LinuxVST/src/TapeDust/TapeDust.cpp @@ -22,8 +22,8 @@ TapeDust::TapeDust(audioMasterCallback audioMaster) : fR[count] = 0.0; } - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/LinuxVST/src/TapeDust/TapeDust.h b/plugins/LinuxVST/src/TapeDust/TapeDust.h index facbf408f..4918fdcb3 100755 --- a/plugins/LinuxVST/src/TapeDust/TapeDust.h +++ b/plugins/LinuxVST/src/TapeDust/TapeDust.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff diff --git a/plugins/LinuxVST/src/TapeDust/TapeDustProc.cpp b/plugins/LinuxVST/src/TapeDust/TapeDustProc.cpp index 429a3667f..9d7aceff9 100755 --- a/plugins/LinuxVST/src/TapeDust/TapeDustProc.cpp +++ b/plugins/LinuxVST/src/TapeDust/TapeDustProc.cpp @@ -13,8 +13,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -32,44 +32,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -118,14 +82,14 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -143,8 +107,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* in2 = inputs[1]; double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -162,44 +126,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -248,16 +176,14 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TapeFat/TapeFat.cpp b/plugins/LinuxVST/src/TapeFat/TapeFat.cpp index 26478dfe6..bcb1927b5 100755 --- a/plugins/LinuxVST/src/TapeFat/TapeFat.cpp +++ b/plugins/LinuxVST/src/TapeFat/TapeFat.cpp @@ -18,8 +18,8 @@ TapeFat::TapeFat(audioMasterCallback audioMaster) : for(int count = 0; count < 257; count++) {pL[count] = 0;pR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/TapeFat/TapeFat.h b/plugins/LinuxVST/src/TapeFat/TapeFat.h index 614ee47ff..0ce30222f 100755 --- a/plugins/LinuxVST/src/TapeFat/TapeFat.h +++ b/plugins/LinuxVST/src/TapeFat/TapeFat.h @@ -57,8 +57,8 @@ private: int pR[258]; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/TapeFat/TapeFatProc.cpp b/plugins/LinuxVST/src/TapeFat/TapeFatProc.cpp index 8eb0e98e9..7d0e52a57 100755 --- a/plugins/LinuxVST/src/TapeFat/TapeFatProc.cpp +++ b/plugins/LinuxVST/src/TapeFat/TapeFatProc.cpp @@ -25,8 +25,8 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -119,14 +119,14 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -156,8 +156,8 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -250,16 +250,14 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Thunder/Thunder.cpp b/plugins/LinuxVST/src/Thunder/Thunder.cpp index 7bc8226ab..b206dace5 100755 --- a/plugins/LinuxVST/src/Thunder/Thunder.cpp +++ b/plugins/LinuxVST/src/Thunder/Thunder.cpp @@ -15,8 +15,8 @@ Thunder::Thunder(audioMasterCallback audioMaster) : A = 0.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/LinuxVST/src/Thunder/Thunder.h b/plugins/LinuxVST/src/Thunder/Thunder.h index 9e49054f5..fc8bf411e 100755 --- a/plugins/LinuxVST/src/Thunder/Thunder.h +++ b/plugins/LinuxVST/src/Thunder/Thunder.h @@ -69,8 +69,8 @@ private: double iirSampleAM; double iirSampleBM; double iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/LinuxVST/src/Thunder/ThunderProc.cpp b/plugins/LinuxVST/src/Thunder/ThunderProc.cpp index 2cf454d35..ce6b41c13 100755 --- a/plugins/LinuxVST/src/Thunder/ThunderProc.cpp +++ b/plugins/LinuxVST/src/Thunder/ThunderProc.cpp @@ -40,51 +40,15 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -222,14 +186,14 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -275,51 +239,15 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -457,16 +385,14 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ToTape5/ToTape5.cpp b/plugins/LinuxVST/src/ToTape5/ToTape5.cpp index 6136aafb5..509c70874 100755 --- a/plugins/LinuxVST/src/ToTape5/ToTape5.cpp +++ b/plugins/LinuxVST/src/ToTape5/ToTape5.cpp @@ -98,8 +98,8 @@ ToTape5::ToTape5(audioMasterCallback audioMaster) : hcount = 0; flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ToTape5/ToTape5.h b/plugins/LinuxVST/src/ToTape5/ToTape5.h index d049014d6..b35426a07 100755 --- a/plugins/LinuxVST/src/ToTape5/ToTape5.h +++ b/plugins/LinuxVST/src/ToTape5/ToTape5.h @@ -140,8 +140,8 @@ private: double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ToTape5/ToTape5Proc.cpp b/plugins/LinuxVST/src/ToTape5/ToTape5Proc.cpp index 5824f8030..3db88a2ec 100755 --- a/plugins/LinuxVST/src/ToTape5/ToTape5Proc.cpp +++ b/plugins/LinuxVST/src/ToTape5/ToTape5Proc.cpp @@ -17,7 +17,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -63,52 +63,16 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -355,14 +319,14 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -384,7 +348,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -429,51 +393,15 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifierR; double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -720,16 +648,14 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ToTape6/ToTape6.h b/plugins/LinuxVST/src/ToTape6/ToTape6.h index fba651fd1..a613c4812 100755 --- a/plugins/LinuxVST/src/ToTape6/ToTape6.h +++ b/plugins/LinuxVST/src/ToTape6/ToTape6.h @@ -73,19 +73,19 @@ private: double iirMidRollerBR; double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/ToTape6/ToTape6Proc.cpp b/plugins/LinuxVST/src/ToTape6/ToTape6Proc.cpp index 1b4ff7de7..49e72323b 100755 --- a/plugins/LinuxVST/src/ToTape6/ToTape6Proc.cpp +++ b/plugins/LinuxVST/src/ToTape6/ToTape6Proc.cpp @@ -54,12 +54,12 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -74,7 +74,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -93,13 +93,13 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -201,15 +201,15 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -241,7 +241,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding @@ -388,12 +388,12 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -408,7 +408,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -427,13 +427,13 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -535,15 +535,15 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -575,7 +575,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.cpp b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.cpp index 429187cf3..3d46fd518 100755 --- a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.cpp +++ b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.cpp @@ -87,8 +87,8 @@ ToVinyl4::ToVinyl4(audioMasterCallback audioMaster) : B = 0.3424051; //44.0 hz = ((B*B)*290)+10 (B*B)*290 = 34 (B*B) = 0.1172413 sqrt() = 0.3424051 C = 0.32; D = 0.064; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.h b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.h index 6a2dc26ed..d1a7363eb 100755 --- a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.h +++ b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4.h @@ -142,8 +142,8 @@ private: double bMidPrev; double bSidePrev; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4Proc.cpp b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4Proc.cpp index a67af995f..1bb4c1841 100755 --- a/plugins/LinuxVST/src/ToVinyl4/ToVinyl4Proc.cpp +++ b/plugins/LinuxVST/src/ToVinyl4/ToVinyl4Proc.cpp @@ -217,44 +217,8 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -461,14 +425,14 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -689,44 +653,8 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -933,16 +861,14 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/ToneSlant/ToneSlant.cpp b/plugins/LinuxVST/src/ToneSlant/ToneSlant.cpp index d99fa60a7..6bc494340 100755 --- a/plugins/LinuxVST/src/ToneSlant/ToneSlant.cpp +++ b/plugins/LinuxVST/src/ToneSlant/ToneSlant.cpp @@ -15,8 +15,8 @@ ToneSlant::ToneSlant(audioMasterCallback audioMaster) : A = 0.0; B = 0.0; for(int count = 0; count < 102; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/ToneSlant/ToneSlant.h b/plugins/LinuxVST/src/ToneSlant/ToneSlant.h index 7c52bca20..ca55bbf14 100755 --- a/plugins/LinuxVST/src/ToneSlant/ToneSlant.h +++ b/plugins/LinuxVST/src/ToneSlant/ToneSlant.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/ToneSlant/ToneSlantProc.cpp b/plugins/LinuxVST/src/ToneSlant/ToneSlantProc.cpp index d78cfb574..7397d8aa4 100755 --- a/plugins/LinuxVST/src/ToneSlant/ToneSlantProc.cpp +++ b/plugins/LinuxVST/src/ToneSlant/ToneSlantProc.cpp @@ -48,44 +48,8 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -106,14 +70,14 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -165,44 +129,8 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -223,16 +151,14 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TransDesk/TransDesk.cpp b/plugins/LinuxVST/src/TransDesk/TransDesk.cpp index 3f352f7fe..d26434509 100755 --- a/plugins/LinuxVST/src/TransDesk/TransDesk.cpp +++ b/plugins/LinuxVST/src/TransDesk/TransDesk.cpp @@ -25,8 +25,8 @@ TransDesk::TransDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/TransDesk/TransDesk.h b/plugins/LinuxVST/src/TransDesk/TransDesk.h index 5729b4c4e..4657525a2 100755 --- a/plugins/LinuxVST/src/TransDesk/TransDesk.h +++ b/plugins/LinuxVST/src/TransDesk/TransDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[20]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[20]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/LinuxVST/src/TransDesk/TransDeskProc.cpp b/plugins/LinuxVST/src/TransDesk/TransDeskProc.cpp index c8b45c2d5..9768c73fb 100755 --- a/plugins/LinuxVST/src/TransDesk/TransDeskProc.cpp +++ b/plugins/LinuxVST/src/TransDesk/TransDeskProc.cpp @@ -40,53 +40,17 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -197,14 +161,14 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,53 +213,17 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -406,16 +334,14 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TremoSquare/TremoSquareProc.cpp b/plugins/LinuxVST/src/TremoSquare/TremoSquareProc.cpp index ef99feb16..1c627a8e6 100755 --- a/plugins/LinuxVST/src/TremoSquare/TremoSquareProc.cpp +++ b/plugins/LinuxVST/src/TremoSquare/TremoSquareProc.cpp @@ -23,12 +23,12 @@ void TremoSquare::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code @@ -92,12 +92,12 @@ void TremoSquare::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code diff --git a/plugins/LinuxVST/src/Tremolo/Tremolo.cpp b/plugins/LinuxVST/src/Tremolo/Tremolo.cpp index f0b649d78..b57f9ec20 100755 --- a/plugins/LinuxVST/src/Tremolo/Tremolo.cpp +++ b/plugins/LinuxVST/src/Tremolo/Tremolo.cpp @@ -21,8 +21,8 @@ Tremolo::Tremolo(audioMasterCallback audioMaster) : depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Tremolo/Tremolo.h b/plugins/LinuxVST/src/Tremolo/Tremolo.h index 11fc718fb..1f1d00675 100755 --- a/plugins/LinuxVST/src/Tremolo/Tremolo.h +++ b/plugins/LinuxVST/src/Tremolo/Tremolo.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sweep; diff --git a/plugins/LinuxVST/src/Tremolo/TremoloProc.cpp b/plugins/LinuxVST/src/Tremolo/TremoloProc.cpp index d27dc86c7..e63f0b044 100755 --- a/plugins/LinuxVST/src/Tremolo/TremoloProc.cpp +++ b/plugins/LinuxVST/src/Tremolo/TremoloProc.cpp @@ -38,53 +38,17 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -198,53 +162,17 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -309,16 +237,14 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/TripleSpread/TripleSpreadProc.cpp b/plugins/LinuxVST/src/TripleSpread/TripleSpreadProc.cpp index 09b8dd534..6bd70e790 100755 --- a/plugins/LinuxVST/src/TripleSpread/TripleSpreadProc.cpp +++ b/plugins/LinuxVST/src/TripleSpread/TripleSpreadProc.cpp @@ -21,12 +21,12 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -291,8 +291,8 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; @@ -340,12 +340,12 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -610,8 +610,8 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/LinuxVST/src/Tube/Tube.h b/plugins/LinuxVST/src/Tube/Tube.h index d44d0e3ab..c423e2802 100644 --- a/plugins/LinuxVST/src/Tube/Tube.h +++ b/plugins/LinuxVST/src/Tube/Tube.h @@ -52,10 +52,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Tube/TubeProc.cpp b/plugins/LinuxVST/src/Tube/TubeProc.cpp index 8952b4238..068a6ea5e 100644 --- a/plugins/LinuxVST/src/Tube/TubeProc.cpp +++ b/plugins/LinuxVST/src/Tube/TubeProc.cpp @@ -33,13 +33,13 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -87,7 +87,7 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -138,13 +138,13 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -192,19 +192,19 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Tube2/Tube2.h b/plugins/LinuxVST/src/Tube2/Tube2.h index 24f7f73cd..80bfcc84b 100644 --- a/plugins/LinuxVST/src/Tube2/Tube2.h +++ b/plugins/LinuxVST/src/Tube2/Tube2.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; - long double previousSampleE; - long double previousSampleF; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; + double previousSampleE; + double previousSampleF; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/Tube2/Tube2Proc.cpp b/plugins/LinuxVST/src/Tube2/Tube2Proc.cpp index 33dc4d827..e3c528b96 100644 --- a/plugins/LinuxVST/src/Tube2/Tube2Proc.cpp +++ b/plugins/LinuxVST/src/Tube2/Tube2Proc.cpp @@ -27,10 +27,10 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -38,7 +38,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -51,7 +51,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -84,7 +84,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -92,9 +92,9 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -107,7 +107,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -158,10 +158,10 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -169,7 +169,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -182,7 +182,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -215,7 +215,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -223,9 +223,9 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -238,7 +238,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -251,12 +251,12 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end hysteresis and spiky fuzz section //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/TubeDesk/TubeDesk.cpp b/plugins/LinuxVST/src/TubeDesk/TubeDesk.cpp index 5a7465c3b..5a42bb4aa 100755 --- a/plugins/LinuxVST/src/TubeDesk/TubeDesk.cpp +++ b/plugins/LinuxVST/src/TubeDesk/TubeDesk.cpp @@ -25,8 +25,8 @@ TubeDesk::TubeDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/TubeDesk/TubeDesk.h b/plugins/LinuxVST/src/TubeDesk/TubeDesk.h index fb15768fb..7ef3e35be 100755 --- a/plugins/LinuxVST/src/TubeDesk/TubeDesk.h +++ b/plugins/LinuxVST/src/TubeDesk/TubeDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[5000]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[5000]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/LinuxVST/src/TubeDesk/TubeDeskProc.cpp b/plugins/LinuxVST/src/TubeDesk/TubeDeskProc.cpp index cccf6e2cc..72b8fe2c7 100755 --- a/plugins/LinuxVST/src/TubeDesk/TubeDeskProc.cpp +++ b/plugins/LinuxVST/src/TubeDesk/TubeDeskProc.cpp @@ -39,53 +39,17 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -196,14 +160,14 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,53 +211,17 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -404,16 +332,14 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/UltrasonX/UltrasonX.h b/plugins/LinuxVST/src/UltrasonX/UltrasonX.h index 439c12866..dccd0df88 100644 --- a/plugins/LinuxVST/src/UltrasonX/UltrasonX.h +++ b/plugins/LinuxVST/src/UltrasonX/UltrasonX.h @@ -66,7 +66,7 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/UltrasonX/UltrasonXProc.cpp b/plugins/LinuxVST/src/UltrasonX/UltrasonXProc.cpp index 8a0955704..09a93d0a6 100644 --- a/plugins/LinuxVST/src/UltrasonX/UltrasonXProc.cpp +++ b/plugins/LinuxVST/src/UltrasonX/UltrasonXProc.cpp @@ -34,8 +34,8 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -45,12 +45,12 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -105,8 +105,8 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -116,12 +116,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -131,12 +131,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = temp; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Ultrasonic/Ultrasonic.h b/plugins/LinuxVST/src/Ultrasonic/Ultrasonic.h index 929c3c8aa..f853b70e2 100755 --- a/plugins/LinuxVST/src/Ultrasonic/Ultrasonic.h +++ b/plugins/LinuxVST/src/Ultrasonic/Ultrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/LinuxVST/src/Ultrasonic/UltrasonicProc.cpp b/plugins/LinuxVST/src/Ultrasonic/UltrasonicProc.cpp index 7049da762..0bb52e5e0 100755 --- a/plugins/LinuxVST/src/Ultrasonic/UltrasonicProc.cpp +++ b/plugins/LinuxVST/src/Ultrasonic/UltrasonicProc.cpp @@ -63,12 +63,12 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLite.h b/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLite.h index 73fb675ad..59fd77310 100644 --- a/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLite.h +++ b/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLite.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLiteProc.cpp b/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLiteProc.cpp index bd62ec460..8bf48c273 100644 --- a/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLiteProc.cpp +++ b/plugins/LinuxVST/src/UltrasonicLite/UltrasonicLiteProc.cpp @@ -28,15 +28,15 @@ void UltrasonicLite::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 32 bit stereo floating point dither @@ -79,15 +79,15 @@ void UltrasonicLite::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 64 bit stereo floating point dither diff --git a/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMed.h b/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMed.h index ca6b4f9d1..0a3552480 100644 --- a/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMed.h +++ b/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMed.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpd; //default stuff diff --git a/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMedProc.cpp b/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMedProc.cpp index 9c584ac7c..152e5b0ce 100644 --- a/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMedProc.cpp +++ b/plugins/LinuxVST/src/UltrasonicMed/UltrasonicMedProc.cpp @@ -41,18 +41,18 @@ void UltrasonicMed::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -111,18 +111,18 @@ void UltrasonicMed::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/LinuxVST/src/UnBox/UnBox.h b/plugins/LinuxVST/src/UnBox/UnBox.h index 73cb40f6b..0de78a63d 100755 --- a/plugins/LinuxVST/src/UnBox/UnBox.h +++ b/plugins/LinuxVST/src/UnBox/UnBox.h @@ -56,18 +56,18 @@ private: uint32_t fpd; //default stuff - long double aL[5]; - long double bL[5]; - long double cL[11]; - long double aR[5]; - long double bR[5]; - long double cR[11]; - long double e[5]; - long double f[11]; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; + double aL[5]; + double bL[5]; + double cL[11]; + double aR[5]; + double bR[5]; + double cR[11]; + double e[5]; + double f[11]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; float A; diff --git a/plugins/LinuxVST/src/UnBox/UnBoxProc.cpp b/plugins/LinuxVST/src/UnBox/UnBoxProc.cpp index 40585b3ce..e45e21e08 100755 --- a/plugins/LinuxVST/src/UnBox/UnBoxProc.cpp +++ b/plugins/LinuxVST/src/UnBox/UnBoxProc.cpp @@ -68,16 +68,16 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -130,7 +130,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -146,7 +146,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; @@ -265,16 +265,16 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -327,7 +327,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -343,7 +343,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; diff --git a/plugins/LinuxVST/src/VariMu/VariMu.cpp b/plugins/LinuxVST/src/VariMu/VariMu.cpp index c4d63b29e..e71b73000 100755 --- a/plugins/LinuxVST/src/VariMu/VariMu.cpp +++ b/plugins/LinuxVST/src/VariMu/VariMu.cpp @@ -32,8 +32,8 @@ VariMu::VariMu(audioMasterCallback audioMaster) : B = 0.5; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/VariMu/VariMu.h b/plugins/LinuxVST/src/VariMu/VariMu.h index d79dff11b..d06ae8cfc 100755 --- a/plugins/LinuxVST/src/VariMu/VariMu.h +++ b/plugins/LinuxVST/src/VariMu/VariMu.h @@ -74,8 +74,8 @@ private: double previousR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/VariMu/VariMuProc.cpp b/plugins/LinuxVST/src/VariMu/VariMuProc.cpp index 323b5e490..a4482761f 100755 --- a/plugins/LinuxVST/src/VariMu/VariMuProc.cpp +++ b/plugins/LinuxVST/src/VariMu/VariMuProc.cpp @@ -31,15 +31,15 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -233,14 +233,14 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -276,15 +276,15 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -322,8 +322,8 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -478,16 +478,14 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/Verbity/VerbityProc.cpp b/plugins/LinuxVST/src/Verbity/VerbityProc.cpp index 9a719ea4d..286a798c8 100644 --- a/plugins/LinuxVST/src/Verbity/VerbityProc.cpp +++ b/plugins/LinuxVST/src/Verbity/VerbityProc.cpp @@ -56,12 +56,12 @@ void Verbity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -292,12 +292,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -461,12 +461,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/Vibrato/VibratoProc.cpp b/plugins/LinuxVST/src/Vibrato/VibratoProc.cpp index 551fb2d09..150da0987 100755 --- a/plugins/LinuxVST/src/Vibrato/VibratoProc.cpp +++ b/plugins/LinuxVST/src/Vibrato/VibratoProc.cpp @@ -22,8 +22,8 @@ void Vibrato::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; double drySampleL = inputSampleL; @@ -120,8 +120,8 @@ void Vibrato::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; double drySampleL = inputSampleL; diff --git a/plugins/LinuxVST/src/VinylDither/VinylDitherProc.cpp b/plugins/LinuxVST/src/VinylDither/VinylDitherProc.cpp index f6cd4e85b..d73eece2d 100755 --- a/plugins/LinuxVST/src/VinylDither/VinylDitherProc.cpp +++ b/plugins/LinuxVST/src/VinylDither/VinylDitherProc.cpp @@ -30,8 +30,8 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -169,8 +169,8 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.cpp b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.cpp index 19f1d9493..ac1ed8939 100755 --- a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.cpp +++ b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.cpp @@ -28,8 +28,8 @@ VoiceOfTheStarship::VoiceOfTheStarship(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.h b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.h index 519923b71..51c66c043 100755 --- a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.h +++ b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarship.h @@ -73,8 +73,8 @@ private: int lastAlgorithm; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp index bbb14faf6..dda1805dc 100755 --- a/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp +++ b/plugins/LinuxVST/src/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp @@ -178,14 +178,14 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn filterflip = !filterflip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -367,16 +367,14 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output flipR = !flipR; filterflip = !filterflip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/VoiceTrick/VoiceTrickProc.cpp b/plugins/LinuxVST/src/VoiceTrick/VoiceTrickProc.cpp index b57b695de..0de1f49ae 100755 --- a/plugins/LinuxVST/src/VoiceTrick/VoiceTrickProc.cpp +++ b/plugins/LinuxVST/src/VoiceTrick/VoiceTrickProc.cpp @@ -23,8 +23,8 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -32,7 +32,7 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) @@ -126,8 +126,8 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -135,7 +135,7 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/LinuxVST/src/Wider/Wider.cpp b/plugins/LinuxVST/src/Wider/Wider.cpp index 26d4d47d5..a7cb54608 100755 --- a/plugins/LinuxVST/src/Wider/Wider.cpp +++ b/plugins/LinuxVST/src/Wider/Wider.cpp @@ -17,8 +17,8 @@ Wider::Wider(audioMasterCallback audioMaster) : C = 1.0; for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/Wider/Wider.h b/plugins/LinuxVST/src/Wider/Wider.h index 6a6a2dfc5..a79fa43f0 100755 --- a/plugins/LinuxVST/src/Wider/Wider.h +++ b/plugins/LinuxVST/src/Wider/Wider.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double p[4099]; diff --git a/plugins/LinuxVST/src/Wider/WiderProc.cpp b/plugins/LinuxVST/src/Wider/WiderProc.cpp index f90fa210c..d860ce370 100755 --- a/plugins/LinuxVST/src/Wider/WiderProc.cpp +++ b/plugins/LinuxVST/src/Wider/WiderProc.cpp @@ -18,12 +18,12 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -46,44 +46,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -138,14 +102,14 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,12 +132,12 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -196,44 +160,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -288,16 +216,14 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/XBandpass/XBandpass.h b/plugins/LinuxVST/src/XBandpass/XBandpass.h index 144855c8b..d03811383 100644 --- a/plugins/LinuxVST/src/XBandpass/XBandpass.h +++ b/plugins/LinuxVST/src/XBandpass/XBandpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/XBandpass/XBandpassProc.cpp b/plugins/LinuxVST/src/XBandpass/XBandpassProc.cpp index 4540db0df..53f7c5f2a 100644 --- a/plugins/LinuxVST/src/XBandpass/XBandpassProc.cpp +++ b/plugins/LinuxVST/src/XBandpass/XBandpassProc.cpp @@ -46,24 +46,24 @@ void XBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -221,24 +221,24 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -339,12 +339,12 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/XHighpass/XHighpass.h b/plugins/LinuxVST/src/XHighpass/XHighpass.h index 54165b3e0..8001ab17b 100644 --- a/plugins/LinuxVST/src/XHighpass/XHighpass.h +++ b/plugins/LinuxVST/src/XHighpass/XHighpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/XHighpass/XHighpassProc.cpp b/plugins/LinuxVST/src/XHighpass/XHighpassProc.cpp index 7fb2f3100..dd6a8d08e 100644 --- a/plugins/LinuxVST/src/XHighpass/XHighpassProc.cpp +++ b/plugins/LinuxVST/src/XHighpass/XHighpassProc.cpp @@ -44,24 +44,24 @@ void XHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -197,24 +197,24 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -295,12 +295,12 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/XLowpass/XLowpass.h b/plugins/LinuxVST/src/XLowpass/XLowpass.h index 928e6d0b4..dac60bc2a 100644 --- a/plugins/LinuxVST/src/XLowpass/XLowpass.h +++ b/plugins/LinuxVST/src/XLowpass/XLowpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/XLowpass/XLowpassProc.cpp b/plugins/LinuxVST/src/XLowpass/XLowpassProc.cpp index a2b71cb1b..48ea9f36b 100644 --- a/plugins/LinuxVST/src/XLowpass/XLowpassProc.cpp +++ b/plugins/LinuxVST/src/XLowpass/XLowpassProc.cpp @@ -47,24 +47,24 @@ void XLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -223,24 +223,24 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -341,12 +341,12 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/XNotch/XNotch.h b/plugins/LinuxVST/src/XNotch/XNotch.h index e83b2c356..85a0781d7 100644 --- a/plugins/LinuxVST/src/XNotch/XNotch.h +++ b/plugins/LinuxVST/src/XNotch/XNotch.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/XNotch/XNotchProc.cpp b/plugins/LinuxVST/src/XNotch/XNotchProc.cpp index efccb1de8..3e867df7b 100644 --- a/plugins/LinuxVST/src/XNotch/XNotchProc.cpp +++ b/plugins/LinuxVST/src/XNotch/XNotchProc.cpp @@ -44,24 +44,24 @@ void XNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -223,24 +223,24 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -347,12 +347,12 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/XRegion/XRegion.h b/plugins/LinuxVST/src/XRegion/XRegion.h index e42abe2b3..5234fc31c 100644 --- a/plugins/LinuxVST/src/XRegion/XRegion.h +++ b/plugins/LinuxVST/src/XRegion/XRegion.h @@ -56,11 +56,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/LinuxVST/src/XRegion/XRegionProc.cpp b/plugins/LinuxVST/src/XRegion/XRegionProc.cpp index 3c7f95e46..a65f234e8 100644 --- a/plugins/LinuxVST/src/XRegion/XRegionProc.cpp +++ b/plugins/LinuxVST/src/XRegion/XRegionProc.cpp @@ -96,24 +96,24 @@ void XRegion::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -338,24 +338,24 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -473,12 +473,12 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/YBandpass/YBandpass.h b/plugins/LinuxVST/src/YBandpass/YBandpass.h index 903d563dc..e72e50d43 100644 --- a/plugins/LinuxVST/src/YBandpass/YBandpass.h +++ b/plugins/LinuxVST/src/YBandpass/YBandpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/YBandpass/YBandpassProc.cpp b/plugins/LinuxVST/src/YBandpass/YBandpassProc.cpp index bf9b2aa2b..efdf576b5 100644 --- a/plugins/LinuxVST/src/YBandpass/YBandpassProc.cpp +++ b/plugins/LinuxVST/src/YBandpass/YBandpassProc.cpp @@ -66,23 +66,23 @@ void YBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/YHighpass/YHighpass.h b/plugins/LinuxVST/src/YHighpass/YHighpass.h index 05eb71a64..079d3bc00 100644 --- a/plugins/LinuxVST/src/YHighpass/YHighpass.h +++ b/plugins/LinuxVST/src/YHighpass/YHighpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/YHighpass/YHighpassProc.cpp b/plugins/LinuxVST/src/YHighpass/YHighpassProc.cpp index 3333b4158..60626324f 100644 --- a/plugins/LinuxVST/src/YHighpass/YHighpassProc.cpp +++ b/plugins/LinuxVST/src/YHighpass/YHighpassProc.cpp @@ -66,23 +66,23 @@ void YHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/YLowpass/YLowpass.h b/plugins/LinuxVST/src/YLowpass/YLowpass.h index ac52c3738..564336a3b 100644 --- a/plugins/LinuxVST/src/YLowpass/YLowpass.h +++ b/plugins/LinuxVST/src/YLowpass/YLowpass.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/YLowpass/YLowpassProc.cpp b/plugins/LinuxVST/src/YLowpass/YLowpassProc.cpp index 86343995d..a4c489f53 100644 --- a/plugins/LinuxVST/src/YLowpass/YLowpassProc.cpp +++ b/plugins/LinuxVST/src/YLowpass/YLowpassProc.cpp @@ -66,23 +66,23 @@ void YLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/YNotch/YNotch.h b/plugins/LinuxVST/src/YNotch/YNotch.h index 3a7074bec..e699edb1f 100644 --- a/plugins/LinuxVST/src/YNotch/YNotch.h +++ b/plugins/LinuxVST/src/YNotch/YNotch.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/YNotch/YNotchProc.cpp b/plugins/LinuxVST/src/YNotch/YNotchProc.cpp index ef6b9c773..f3535a645 100644 --- a/plugins/LinuxVST/src/YNotch/YNotchProc.cpp +++ b/plugins/LinuxVST/src/YNotch/YNotchProc.cpp @@ -65,23 +65,23 @@ void YNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -218,23 +218,23 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -295,12 +295,12 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZBandpass/ZBandpass.h b/plugins/LinuxVST/src/ZBandpass/ZBandpass.h index febc1562b..6dd973ab7 100644 --- a/plugins/LinuxVST/src/ZBandpass/ZBandpass.h +++ b/plugins/LinuxVST/src/ZBandpass/ZBandpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZBandpass/ZBandpassProc.cpp b/plugins/LinuxVST/src/ZBandpass/ZBandpassProc.cpp index 1345861c0..ab264eb48 100644 --- a/plugins/LinuxVST/src/ZBandpass/ZBandpassProc.cpp +++ b/plugins/LinuxVST/src/ZBandpass/ZBandpassProc.cpp @@ -63,18 +63,18 @@ void ZBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -254,18 +254,18 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -371,12 +371,12 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZBandpass2/ZBandpass2.h b/plugins/LinuxVST/src/ZBandpass2/ZBandpass2.h index 8aae72342..35e06499f 100644 --- a/plugins/LinuxVST/src/ZBandpass2/ZBandpass2.h +++ b/plugins/LinuxVST/src/ZBandpass2/ZBandpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZBandpass2/ZBandpass2Proc.cpp b/plugins/LinuxVST/src/ZBandpass2/ZBandpass2Proc.cpp index 641a5634a..60ec7317e 100644 --- a/plugins/LinuxVST/src/ZBandpass2/ZBandpass2Proc.cpp +++ b/plugins/LinuxVST/src/ZBandpass2/ZBandpass2Proc.cpp @@ -62,16 +62,16 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZHighpass/ZHighpass.h b/plugins/LinuxVST/src/ZHighpass/ZHighpass.h index 3985b75ae..fc00f8ff8 100644 --- a/plugins/LinuxVST/src/ZHighpass/ZHighpass.h +++ b/plugins/LinuxVST/src/ZHighpass/ZHighpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZHighpass/ZHighpassProc.cpp b/plugins/LinuxVST/src/ZHighpass/ZHighpassProc.cpp index 43ed909bb..09a18cfb2 100644 --- a/plugins/LinuxVST/src/ZHighpass/ZHighpassProc.cpp +++ b/plugins/LinuxVST/src/ZHighpass/ZHighpassProc.cpp @@ -61,18 +61,18 @@ void ZHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -243,18 +243,18 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -355,12 +355,12 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZHighpass2/ZHighpass2.h b/plugins/LinuxVST/src/ZHighpass2/ZHighpass2.h index d5bb73f3a..7c8d3a52f 100644 --- a/plugins/LinuxVST/src/ZHighpass2/ZHighpass2.h +++ b/plugins/LinuxVST/src/ZHighpass2/ZHighpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZHighpass2/ZHighpass2Proc.cpp b/plugins/LinuxVST/src/ZHighpass2/ZHighpass2Proc.cpp index 7bb5b9a99..5add1560b 100644 --- a/plugins/LinuxVST/src/ZHighpass2/ZHighpass2Proc.cpp +++ b/plugins/LinuxVST/src/ZHighpass2/ZHighpass2Proc.cpp @@ -62,16 +62,16 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZLowpass/ZLowpass.h b/plugins/LinuxVST/src/ZLowpass/ZLowpass.h index d32901e01..3939e781b 100644 --- a/plugins/LinuxVST/src/ZLowpass/ZLowpass.h +++ b/plugins/LinuxVST/src/ZLowpass/ZLowpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZLowpass/ZLowpassProc.cpp b/plugins/LinuxVST/src/ZLowpass/ZLowpassProc.cpp index 728f25dde..c5df9e840 100644 --- a/plugins/LinuxVST/src/ZLowpass/ZLowpassProc.cpp +++ b/plugins/LinuxVST/src/ZLowpass/ZLowpassProc.cpp @@ -63,18 +63,18 @@ void ZLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZLowpass2/ZLowpass2.h b/plugins/LinuxVST/src/ZLowpass2/ZLowpass2.h index b093df0e7..1f51c3c2e 100644 --- a/plugins/LinuxVST/src/ZLowpass2/ZLowpass2.h +++ b/plugins/LinuxVST/src/ZLowpass2/ZLowpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZLowpass2/ZLowpass2Proc.cpp b/plugins/LinuxVST/src/ZLowpass2/ZLowpass2Proc.cpp index 61bc55947..415ca5f47 100644 --- a/plugins/LinuxVST/src/ZLowpass2/ZLowpass2Proc.cpp +++ b/plugins/LinuxVST/src/ZLowpass2/ZLowpass2Proc.cpp @@ -62,16 +62,16 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZNotch/ZNotch.h b/plugins/LinuxVST/src/ZNotch/ZNotch.h index 603ffa4ec..e493e40f6 100644 --- a/plugins/LinuxVST/src/ZNotch/ZNotch.h +++ b/plugins/LinuxVST/src/ZNotch/ZNotch.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZNotch/ZNotchProc.cpp b/plugins/LinuxVST/src/ZNotch/ZNotchProc.cpp index a5eaba61e..37871fa0e 100644 --- a/plugins/LinuxVST/src/ZNotch/ZNotchProc.cpp +++ b/plugins/LinuxVST/src/ZNotch/ZNotchProc.cpp @@ -63,18 +63,18 @@ void ZNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/ZNotch2/ZNotch2.h b/plugins/LinuxVST/src/ZNotch2/ZNotch2.h index 3dde478ea..f23bf7b0d 100644 --- a/plugins/LinuxVST/src/ZNotch2/ZNotch2.h +++ b/plugins/LinuxVST/src/ZNotch2/ZNotch2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/LinuxVST/src/ZNotch2/ZNotch2Proc.cpp b/plugins/LinuxVST/src/ZNotch2/ZNotch2Proc.cpp index 9e9443722..1e2f92745 100644 --- a/plugins/LinuxVST/src/ZNotch2/ZNotch2Proc.cpp +++ b/plugins/LinuxVST/src/ZNotch2/ZNotch2Proc.cpp @@ -62,16 +62,16 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/LinuxVST/src/curve/curve.h b/plugins/LinuxVST/src/curve/curve.h index b1c313eec..4dd52f8e7 100755 --- a/plugins/LinuxVST/src/curve/curve.h +++ b/plugins/LinuxVST/src/curve/curve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff }; diff --git a/plugins/LinuxVST/src/curve/curveProc.cpp b/plugins/LinuxVST/src/curve/curveProc.cpp index d7739b806..3a3f18b86 100755 --- a/plugins/LinuxVST/src/curve/curveProc.cpp +++ b/plugins/LinuxVST/src/curve/curveProc.cpp @@ -16,8 +16,8 @@ void curve::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -65,8 +65,8 @@ void curve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/LinuxVST/src/uLawDecode/uLawDecode.cpp b/plugins/LinuxVST/src/uLawDecode/uLawDecode.cpp index 234bc6cff..e1dd5cc6e 100755 --- a/plugins/LinuxVST/src/uLawDecode/uLawDecode.cpp +++ b/plugins/LinuxVST/src/uLawDecode/uLawDecode.cpp @@ -14,8 +14,8 @@ uLawDecode::uLawDecode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/uLawDecode/uLawDecode.h b/plugins/LinuxVST/src/uLawDecode/uLawDecode.h index ec3f23285..fb74bcdba 100755 --- a/plugins/LinuxVST/src/uLawDecode/uLawDecode.h +++ b/plugins/LinuxVST/src/uLawDecode/uLawDecode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/uLawDecode/uLawDecodeProc.cpp b/plugins/LinuxVST/src/uLawDecode/uLawDecodeProc.cpp index 18356232c..0c0ee1f1f 100755 --- a/plugins/LinuxVST/src/uLawDecode/uLawDecodeProc.cpp +++ b/plugins/LinuxVST/src/uLawDecode/uLawDecodeProc.cpp @@ -24,8 +24,8 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/LinuxVST/src/uLawEncode/uLawEncode.cpp b/plugins/LinuxVST/src/uLawEncode/uLawEncode.cpp index 0c062b676..e4f3de546 100755 --- a/plugins/LinuxVST/src/uLawEncode/uLawEncode.cpp +++ b/plugins/LinuxVST/src/uLawEncode/uLawEncode.cpp @@ -14,8 +14,8 @@ uLawEncode::uLawEncode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/LinuxVST/src/uLawEncode/uLawEncode.h b/plugins/LinuxVST/src/uLawEncode/uLawEncode.h index a8c6858f7..41d0d6008 100755 --- a/plugins/LinuxVST/src/uLawEncode/uLawEncode.h +++ b/plugins/LinuxVST/src/uLawEncode/uLawEncode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/LinuxVST/src/uLawEncode/uLawEncodeProc.cpp b/plugins/LinuxVST/src/uLawEncode/uLawEncodeProc.cpp index c5dd74d76..7f0eb12cd 100755 --- a/plugins/LinuxVST/src/uLawEncode/uLawEncodeProc.cpp +++ b/plugins/LinuxVST/src/uLawEncode/uLawEncodeProc.cpp @@ -24,8 +24,8 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacAU/ADClip7/ADClip7.cpp b/plugins/MacAU/ADClip7/ADClip7.cpp index 4835b0fd2..3e0496713 100755 --- a/plugins/MacAU/ADClip7/ADClip7.cpp +++ b/plugins/MacAU/ADClip7/ADClip7.cpp @@ -205,7 +205,7 @@ void ADClip7::ADClip7Kernel::Reset() refclip = 0.99; iirLowsA = 0.0; iirLowsB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -235,7 +235,7 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, Float64 calibsubs = subslift/53; Float64 invcalibsubs = 1.0 - calibsubs; Float64 subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) GetParameter( kParam_Four ); Float64 overshoot; Float64 offsetH1 = 1.84; @@ -259,35 +259,12 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, Float64 minusH3 = 1.0 - fractionH3; Float64 highs = 0.0; int count = 0; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputGain != 1.0) { inputSample *= inputGain; @@ -476,11 +453,11 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, if (inputSample < -refclip) inputSample = -refclip; //final iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/ADClip7/ADClip7.h b/plugins/MacAU/ADClip7/ADClip7.h index 215cc2c4c..0750b6057 100755 --- a/plugins/MacAU/ADClip7/ADClip7.h +++ b/plugins/MacAU/ADClip7/ADClip7.h @@ -141,14 +141,14 @@ public: virtual void Reset(); private: - long double lastSample; + double lastSample; Float32 b[22200]; int gcount; Float64 lows; Float64 iirLowsA; Float64 iirLowsB; - long double refclip; - long double fpNShape; + double refclip; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/ADT/ADT.cpp b/plugins/MacAU/ADT/ADT.cpp index dc49b37f1..2a267050d 100755 --- a/plugins/MacAU/ADT/ADT.cpp +++ b/plugins/MacAU/ADT/ADT.cpp @@ -234,9 +234,9 @@ void ADT::ADTKernel::Process( const Float32 *inSourceP, int count; Float64 temp; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fabs(offsetA - targetA) > 1000) offsetA = targetA; diff --git a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp index 8d935577f..365c61814 100755 --- a/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp +++ b/plugins/MacAU/AQuickVoiceClip/AQuickVoiceClip.cpp @@ -181,7 +181,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Reset() iirSampleC = 0.0; iirSampleD = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -227,30 +227,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; passThrough = ataDrySample = inputSample; @@ -433,11 +410,11 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP if (inputSample < -cliplevel) inputSample = -cliplevel; //final iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Acceleration/Acceleration.cpp b/plugins/MacAU/Acceleration/Acceleration.cpp index a099b7a8d..a616f79ff 100755 --- a/plugins/MacAU/Acceleration/Acceleration.cpp +++ b/plugins/MacAU/Acceleration/Acceleration.cpp @@ -170,7 +170,7 @@ void Acceleration::AccelerationKernel::Reset() s1L = s2L = s3L = 0.0; o1L = o2L = o3L = 0.0; m1L = m2L = desL = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,7 +185,7 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -198,35 +198,11 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, Float64 accumulatorSample; double drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this antique declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - //This file's now been modified by all dev machines, using commandline git - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -258,11 +234,11 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Acceleration/Acceleration.h b/plugins/MacAU/Acceleration/Acceleration.h index ba5bfd437..e54b35ed4 100755 --- a/plugins/MacAU/Acceleration/Acceleration.h +++ b/plugins/MacAU/Acceleration/Acceleration.h @@ -138,7 +138,7 @@ public: Float64 m1L; Float64 m2L; Float64 desL; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Acceleration2/Acceleration2.cpp b/plugins/MacAU/Acceleration2/Acceleration2.cpp index d274ef6db..3f2168163 100755 --- a/plugins/MacAU/Acceleration2/Acceleration2.cpp +++ b/plugins/MacAU/Acceleration2/Acceleration2.cpp @@ -185,7 +185,7 @@ void Acceleration2::Acceleration2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -216,11 +216,11 @@ void Acceleration2::Acceleration2Kernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; Float64 smooth = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = smooth; //DF1 diff --git a/plugins/MacAU/Acceleration2/Acceleration2.h b/plugins/MacAU/Acceleration2/Acceleration2.h index 1245e4b89..510b69012 100755 --- a/plugins/MacAU/Acceleration2/Acceleration2.h +++ b/plugins/MacAU/Acceleration2/Acceleration2.h @@ -132,8 +132,8 @@ public: Float64 s[34]; Float64 m1; Float64 m2; - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Air/Air.cpp b/plugins/MacAU/Air/Air.cpp index fc36eafbe..02b0f7e24 100755 --- a/plugins/MacAU/Air/Air.cpp +++ b/plugins/MacAU/Air/Air.cpp @@ -222,7 +222,7 @@ void Air::AirKernel::Reset() tripletC = 0.0; tripletFactor = 0.0; count = 1; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -250,37 +250,14 @@ void Air::AirKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Six ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 correction; //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; @@ -404,7 +381,7 @@ void Air::AirKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/Air/Air.h b/plugins/MacAU/Air/Air.h index 6dcd06ca8..32fe255c1 100755 --- a/plugins/MacAU/Air/Air.h +++ b/plugins/MacAU/Air/Air.h @@ -164,7 +164,7 @@ public: Float64 tripletC; Float64 tripletFactor; int count; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Air2/Air2.cpp b/plugins/MacAU/Air2/Air2.cpp index 5434080e5..e45995019 100644 --- a/plugins/MacAU/Air2/Air2.cpp +++ b/plugins/MacAU/Air2/Air2.cpp @@ -232,7 +232,7 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -261,13 +261,13 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correction = 0.0; + double correction = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorC = airPrevC - inputSample; if (flop) @@ -356,7 +356,7 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, correction *= intensity; correction -= 1.0; - long double bridgerectifier = fabs(correction); + double bridgerectifier = fabs(correction); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correction > 0) correction = bridgerectifier; diff --git a/plugins/MacAU/Air2/Air2.h b/plugins/MacAU/Air2/Air2.h index dea89d48e..af1b3efae 100644 --- a/plugins/MacAU/Air2/Air2.h +++ b/plugins/MacAU/Air2/Air2.h @@ -159,7 +159,7 @@ public: Float64 tripletC; Float64 tripletFactor; int count; - long double postsine; + double postsine; double lastRef[10]; int cycle; diff --git a/plugins/MacAU/Apicolypse/Apicolypse.cpp b/plugins/MacAU/Apicolypse/Apicolypse.cpp index 983200ca9..9d5d20932 100755 --- a/plugins/MacAU/Apicolypse/Apicolypse.cpp +++ b/plugins/MacAU/Apicolypse/Apicolypse.cpp @@ -223,8 +223,8 @@ void Apicolypse::ApicolypseKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp index c68d1eed2..6f3569894 100755 --- a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp +++ b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.cpp @@ -162,7 +162,7 @@ void AtmosphereBuss::AtmosphereBussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -206,9 +206,9 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; - long double clamp; + double inputSample; + double drySample; + double clamp; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -234,24 +234,7 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - //for Atmopshere, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -341,11 +324,11 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, lastSampleA = drySample; //store the raw input sample again for use next time - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.h b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.h index f8db61ac7..f39f90abd 100755 --- a/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.h +++ b/plugins/MacAU/AtmosphereBuss/AtmosphereBuss.h @@ -128,33 +128,33 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + uint32_t fpd; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; }; }; diff --git a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp index 6ca913188..9acc701d0 100755 --- a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp +++ b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.cpp @@ -162,7 +162,7 @@ void AtmosphereChannel::AtmosphereChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -206,9 +206,9 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; - long double clamp; + double inputSample; + double drySample; + double clamp; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -234,25 +234,7 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -338,11 +320,11 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou lastSampleA = drySample; //store the raw input sample again for use next time - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.h b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.h index 30ec000e7..09ea65997 100755 --- a/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.h +++ b/plugins/MacAU/AtmosphereChannel/AtmosphereChannel.h @@ -128,33 +128,33 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + uint32_t fpd; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; }; }; diff --git a/plugins/MacAU/Aura/Aura.cpp b/plugins/MacAU/Aura/Aura.cpp index 48fd28391..9f677bd43 100755 --- a/plugins/MacAU/Aura/Aura.cpp +++ b/plugins/MacAU/Aura/Aura.cpp @@ -169,7 +169,7 @@ void Aura::AuraKernel::Reset() for(int count = 0; count < 21; count++) {b[count] = 0.0; f[count] = 0.0;} lastSample = 0.0; previousVelocity = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,7 +193,7 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, Float64 overallscale = trim * 10.0; Float64 gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSample; + double inputSample; Float64 drySample; if (gain < 1.0) gain = 1.0; @@ -245,30 +245,7 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; velocity = lastSample - inputSample; @@ -314,11 +291,11 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Aura/Aura.h b/plugins/MacAU/Aura/Aura.h index 56ef4921b..9df735780 100755 --- a/plugins/MacAU/Aura/Aura.h +++ b/plugins/MacAU/Aura/Aura.h @@ -127,11 +127,11 @@ public: virtual void Reset(); private: - long double lastSample; + double lastSample; Float64 previousVelocity; Float64 b[21]; Float64 f[21]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/AutoPan/AutoPan.cpp b/plugins/MacAU/AutoPan/AutoPan.cpp index 31421b49d..6605d2318 100644 --- a/plugins/MacAU/AutoPan/AutoPan.cpp +++ b/plugins/MacAU/AutoPan/AutoPan.cpp @@ -219,7 +219,7 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -229,10 +229,10 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags double wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -248,8 +248,8 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; diff --git a/plugins/MacAU/AverMatrix/AverMatrix.cpp b/plugins/MacAU/AverMatrix/AverMatrix.cpp index f6c294f1c..bf2cc7eec 100755 --- a/plugins/MacAU/AverMatrix/AverMatrix.cpp +++ b/plugins/MacAU/AverMatrix/AverMatrix.cpp @@ -231,12 +231,12 @@ void AverMatrix::AverMatrixKernel::Process( const Float32 *inSourceP, } //and now it's neatly scaled, too while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - long double previousPole = 0; + double previousPole = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) b[x+1][y] = b[x][y]; b[0][y] = previousPole = inputSample; diff --git a/plugins/MacAU/Average/Average.cpp b/plugins/MacAU/Average/Average.cpp index d2ee078ad..3e975226f 100755 --- a/plugins/MacAU/Average/Average.cpp +++ b/plugins/MacAU/Average/Average.cpp @@ -170,7 +170,7 @@ void Average::AverageKernel::Reset() { register UInt32 count; for(count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,30 +221,7 @@ void Average::AverageKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; b[9] = b[8]; b[8] = b[7]; b[7] = b[6]; b[6] = b[5]; @@ -279,11 +256,11 @@ void Average::AverageKernel::Process( const Float32 *inSourceP, //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/BassAmp/BassAmp.cpp b/plugins/MacAU/BassAmp/BassAmp.cpp index b0dd3348e..b72ec0275 100755 --- a/plugins/MacAU/BassAmp/BassAmp.cpp +++ b/plugins/MacAU/BassAmp/BassAmp.cpp @@ -254,7 +254,7 @@ void BassAmp::BassAmpKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -277,8 +277,8 @@ void BassAmp::BassAmpKernel::Process( const Float32 *inSourceP, Float64 altHPAmount = 1.0 - iirHPAmount; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample = *sourceP; ataHalfDrySample = ataHalfwaySample = (inputSample + ataLast1Sample + (ataLast2Sample*ataK1) + (ataLast3Sample*ataK2) + (ataLast4Sample*ataK6) + (ataLast5Sample*ataK7) + (ataLast6Sample*ataK8)) / 2.0; diff --git a/plugins/MacAU/BassDrive/BassDrive.cpp b/plugins/MacAU/BassDrive/BassDrive.cpp index 4e96d70d1..abf9ae6ca 100755 --- a/plugins/MacAU/BassDrive/BassDrive.cpp +++ b/plugins/MacAU/BassDrive/BassDrive.cpp @@ -234,8 +234,8 @@ void BassDrive::BassDriveKernel::Process( const Float32 *inSourceP, Float64 bridgerectifier; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sum = 0.0; diff --git a/plugins/MacAU/BassKit/BassKit.cpp b/plugins/MacAU/BassKit/BassKit.cpp index da7a49f5a..670541a23 100755 --- a/plugins/MacAU/BassKit/BassKit.cpp +++ b/plugins/MacAU/BassKit/BassKit.cpp @@ -248,8 +248,8 @@ ComponentResult BassKit::Reset(AudioUnitScope inScope, AudioUnitElement inEleme oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -266,7 +266,7 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -284,8 +284,8 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float64 fuzz = 0.111; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -455,7 +455,7 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/BassKit/BassKit.h b/plugins/MacAU/BassKit/BassKit.h index fbe851080..b6bffd8fb 100755 --- a/plugins/MacAU/BassKit/BassKit.h +++ b/plugins/MacAU/BassKit/BassKit.h @@ -168,8 +168,8 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/Baxandall/Baxandall.cpp b/plugins/MacAU/Baxandall/Baxandall.cpp index aefc66f65..dafc1145d 100755 --- a/plugins/MacAU/Baxandall/Baxandall.cpp +++ b/plugins/MacAU/Baxandall/Baxandall.cpp @@ -227,8 +227,8 @@ void Baxandall::BaxandallKernel::Process( const Float32 *inSourceP, bassB[6] = bassA[6] = (1.0 - K / bassA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (output != 1.0) { inputSample *= output; @@ -237,8 +237,8 @@ void Baxandall::BaxandallKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //encode Console5: good cleanness - long double trebleSample; - long double bassSample; + double trebleSample; + double bassSample; if (flip) { diff --git a/plugins/MacAU/Baxandall/Baxandall.h b/plugins/MacAU/Baxandall/Baxandall.h index 54d78b2b8..0bf754baf 100755 --- a/plugins/MacAU/Baxandall/Baxandall.h +++ b/plugins/MacAU/Baxandall/Baxandall.h @@ -131,10 +131,10 @@ public: virtual void Reset(); private: - long double trebleA[9]; - long double trebleB[9]; - long double bassA[9]; - long double bassB[9]; + double trebleA[9]; + double trebleB[9]; + double bassA[9]; + double bassB[9]; bool flip; uint32_t fpd; }; diff --git a/plugins/MacAU/Beam/Beam.cpp b/plugins/MacAU/Beam/Beam.cpp index 25737f827..fd931872d 100755 --- a/plugins/MacAU/Beam/Beam.cpp +++ b/plugins/MacAU/Beam/Beam.cpp @@ -205,7 +205,7 @@ void Beam::BeamKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int depth = (int)(17.0*overallscale); @@ -225,7 +225,7 @@ void Beam::BeamKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float32 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacAU/Biquad/Biquad.cpp b/plugins/MacAU/Biquad/Biquad.cpp index 8932f0d52..53f02245a 100755 --- a/plugins/MacAU/Biquad/Biquad.cpp +++ b/plugins/MacAU/Biquad/Biquad.cpp @@ -200,7 +200,7 @@ void Biquad::BiquadKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -271,15 +271,15 @@ void Biquad::BiquadKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquad[2]) + biquad[7]; + double tempSample = (inputSample * biquad[2]) + biquad[7]; biquad[7] = (inputSample * biquad[3]) - (tempSample * biquad[5]) + biquad[8]; biquad[8] = (inputSample * biquad[4]) - (tempSample * biquad[6]); inputSample = tempSample; diff --git a/plugins/MacAU/Biquad/Biquad.h b/plugins/MacAU/Biquad/Biquad.h index 973ad1306..11922285e 100755 --- a/plugins/MacAU/Biquad/Biquad.h +++ b/plugins/MacAU/Biquad/Biquad.h @@ -134,7 +134,7 @@ public: virtual void Reset(); private: - long double biquad[9]; + double biquad[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Biquad2/Biquad2.cpp b/plugins/MacAU/Biquad2/Biquad2.cpp index 8e31e4689..a5e31165c 100755 --- a/plugins/MacAU/Biquad2/Biquad2.cpp +++ b/plugins/MacAU/Biquad2/Biquad2.cpp @@ -282,9 +282,9 @@ void Biquad2::Biquad2Kernel::Process( const Float32 *inSourceP, //finished setting up average while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; Float64 chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -333,7 +333,7 @@ void Biquad2::Biquad2Kernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //encode Console5: good cleanness - long double outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; inputSample = outSample; biquad[10] = biquad[9]; biquad[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; diff --git a/plugins/MacAU/Biquad2/Biquad2.h b/plugins/MacAU/Biquad2/Biquad2.h index 5025f76da..f7a63c78e 100755 --- a/plugins/MacAU/Biquad2/Biquad2.h +++ b/plugins/MacAU/Biquad2/Biquad2.h @@ -137,7 +137,7 @@ public: virtual void Reset(); private: - long double biquad[11]; + double biquad[11]; Float64 b[11]; Float64 f[11]; Float64 frequencychase; diff --git a/plugins/MacAU/BiquadDouble/BiquadDouble.cpp b/plugins/MacAU/BiquadDouble/BiquadDouble.cpp index e8eca5655..6d49a3382 100755 --- a/plugins/MacAU/BiquadDouble/BiquadDouble.cpp +++ b/plugins/MacAU/BiquadDouble/BiquadDouble.cpp @@ -200,7 +200,7 @@ void BiquadDouble::BiquadDoubleKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -274,15 +274,15 @@ void BiquadDouble::BiquadDoubleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSample * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; diff --git a/plugins/MacAU/BiquadDouble/BiquadDouble.h b/plugins/MacAU/BiquadDouble/BiquadDouble.h index ae50bfb6a..31b0da988 100755 --- a/plugins/MacAU/BiquadDouble/BiquadDouble.h +++ b/plugins/MacAU/BiquadDouble/BiquadDouble.h @@ -134,8 +134,8 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; + double biquadA[9]; + double biquadB[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.cpp b/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.cpp index b31fe92cc..8f426f1cc 100755 --- a/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.cpp +++ b/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.cpp @@ -201,7 +201,7 @@ void BiquadOneHalf::BiquadOneHalfKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -279,15 +279,15 @@ void BiquadOneHalf::BiquadOneHalfKernel::Process( const Float32 *inSourceP, for (int x = 0; x < 9; x++) {biquadB[x] = biquadA[x];} while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample; + double tempSample; if (flip) { tempSample = (inputSample * biquadA[2]) + biquadA[7]; diff --git a/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.h b/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.h index fc0a45ffb..ac9eb3197 100755 --- a/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.h +++ b/plugins/MacAU/BiquadOneHalf/BiquadOneHalf.h @@ -134,8 +134,8 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; + double biquadA[9]; + double biquadB[9]; bool flip; uint32_t fpd; }; diff --git a/plugins/MacAU/BiquadPlus/BiquadPlus.cpp b/plugins/MacAU/BiquadPlus/BiquadPlus.cpp index af1ff4b73..b69e95bad 100644 --- a/plugins/MacAU/BiquadPlus/BiquadPlus.cpp +++ b/plugins/MacAU/BiquadPlus/BiquadPlus.cpp @@ -199,7 +199,7 @@ void BiquadPlus::BiquadPlusKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -288,17 +288,17 @@ void BiquadPlus::BiquadPlusKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; - long double buf = (long double)nSampleFrames/inFramesToProcess; + double buf = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSample * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSample * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSample * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSample * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSample = tempSample; diff --git a/plugins/MacAU/BiquadPlus/BiquadPlus.h b/plugins/MacAU/BiquadPlus/BiquadPlus.h index f15918504..ba2304965 100644 --- a/plugins/MacAU/BiquadPlus/BiquadPlus.h +++ b/plugins/MacAU/BiquadPlus/BiquadPlus.h @@ -160,7 +160,7 @@ public: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/BiquadStereo/BiquadStereo.cpp b/plugins/MacAU/BiquadStereo/BiquadStereo.cpp index bbe132314..aea65ebc7 100755 --- a/plugins/MacAU/BiquadStereo/BiquadStereo.cpp +++ b/plugins/MacAU/BiquadStereo/BiquadStereo.cpp @@ -217,7 +217,7 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -290,12 +290,12 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction } while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -303,16 +303,16 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -322,12 +322,12 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacAU/BiquadStereo/BiquadStereo.h b/plugins/MacAU/BiquadStereo/BiquadStereo.h index ce3c3d4c4..c04f4fd87 100755 --- a/plugins/MacAU/BiquadStereo/BiquadStereo.h +++ b/plugins/MacAU/BiquadStereo/BiquadStereo.h @@ -118,7 +118,7 @@ public: virtual ComponentResult Version() { return kBiquadStereoVersion; } private: - long double biquad[11]; + double biquad[11]; uint32_t fpd; }; diff --git a/plugins/MacAU/BiquadTriple/BiquadTriple.cpp b/plugins/MacAU/BiquadTriple/BiquadTriple.cpp index baa0f3b35..4e35a96f5 100755 --- a/plugins/MacAU/BiquadTriple/BiquadTriple.cpp +++ b/plugins/MacAU/BiquadTriple/BiquadTriple.cpp @@ -200,7 +200,7 @@ void BiquadTriple::BiquadTripleKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -273,15 +273,15 @@ void BiquadTriple::BiquadTripleKernel::Process( const Float32 *inSourceP, for (int x = 0; x < 7; x++) {biquadC[x] = biquadB[x] = biquadA[x];} while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSample * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; diff --git a/plugins/MacAU/BiquadTriple/BiquadTriple.h b/plugins/MacAU/BiquadTriple/BiquadTriple.h index 5ce324812..2ba3cb6c1 100755 --- a/plugins/MacAU/BiquadTriple/BiquadTriple.h +++ b/plugins/MacAU/BiquadTriple/BiquadTriple.h @@ -134,9 +134,9 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/BitGlitter/BitGlitter.cpp b/plugins/MacAU/BitGlitter/BitGlitter.cpp index f0e63e1b0..99e194981 100755 --- a/plugins/MacAU/BitGlitter/BitGlitter.cpp +++ b/plugins/MacAU/BitGlitter/BitGlitter.cpp @@ -221,8 +221,8 @@ void BitGlitter::BitGlitterKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - long double drySample = inputSample; + double inputSample = *sourceP; + double drySample = inputSample; //first, the distortion section inputSample *= ingain; @@ -239,7 +239,7 @@ void BitGlitter::BitGlitterKernel::Process( const Float32 *inSourceP, //begin raw sample positionA += rateA; - long double outputSample = heldSampleA; + double outputSample = heldSampleA; if (positionA > 1.0) { positionA -= 1.0; diff --git a/plugins/MacAU/Bite/Bite.cpp b/plugins/MacAU/Bite/Bite.cpp index c34bb3d2f..5f71560d7 100755 --- a/plugins/MacAU/Bite/Bite.cpp +++ b/plugins/MacAU/Bite/Bite.cpp @@ -175,7 +175,7 @@ void Bite::BiteKernel::Reset() sampleG = 0.0; sampleH = 0.0; sampleI = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -200,7 +200,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, Float64 midC; Float64 midD; Float64 trigger; - long double result; + double result; while (nSampleFrames-- > 0) { sampleI = sampleH; @@ -212,30 +212,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, sampleC = sampleB; sampleB = sampleA; sampleA = *sourceP; - if (sampleA<1.2e-38 && -sampleA<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleA = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleA)<1.18e-23) sampleA = fpd * 1.18e-17; //rotate the buffer in primitive fashion @@ -269,7 +246,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)result, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); result += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/BlockParty/BlockParty.cpp b/plugins/MacAU/BlockParty/BlockParty.cpp index 401261637..2232224cf 100755 --- a/plugins/MacAU/BlockParty/BlockParty.cpp +++ b/plugins/MacAU/BlockParty/BlockParty.cpp @@ -201,7 +201,7 @@ void BlockParty::BlockPartyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -215,28 +215,10 @@ void BlockParty::BlockPartyKernel::Process( const Float32 *inSourceP, //some insanity checking while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 muMakeupGain = 1.0 / threshold; Float64 outMakeupGain = sqrt(muMakeupGain); diff --git a/plugins/MacAU/BrassRider/BrassRider.cpp b/plugins/MacAU/BrassRider/BrassRider.cpp index b11d7a61c..0a96b2f10 100755 --- a/plugins/MacAU/BrassRider/BrassRider.cpp +++ b/plugins/MacAU/BrassRider/BrassRider.cpp @@ -220,49 +220,13 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -271,7 +235,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -280,7 +244,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -303,7 +267,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/MacAU/BrightAmbience/BrightAmbience.cpp b/plugins/MacAU/BrightAmbience/BrightAmbience.cpp index e3bf8d38c..29deb877d 100755 --- a/plugins/MacAU/BrightAmbience/BrightAmbience.cpp +++ b/plugins/MacAU/BrightAmbience/BrightAmbience.cpp @@ -199,8 +199,8 @@ void BrightAmbience::BrightAmbienceKernel::Process( const Float32 *inSourceP, int temp; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; temp = 0; if (gcount < 0 || gcount > 12680) {gcount = 12680;} diff --git a/plugins/MacAU/BrightAmbience2/BrightAmbience2.cpp b/plugins/MacAU/BrightAmbience2/BrightAmbience2.cpp index 0aac3968a..6b91d7b1b 100755 --- a/plugins/MacAU/BrightAmbience2/BrightAmbience2.cpp +++ b/plugins/MacAU/BrightAmbience2/BrightAmbience2.cpp @@ -225,14 +225,14 @@ OSStatus BrightAmbience2::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/MacAU/BrightAmbience2/BrightAmbience2.h b/plugins/MacAU/BrightAmbience2/BrightAmbience2.h index 245f11da2..24e2d8087 100755 --- a/plugins/MacAU/BrightAmbience2/BrightAmbience2.h +++ b/plugins/MacAU/BrightAmbience2/BrightAmbience2.h @@ -125,9 +125,9 @@ public: int gcount; Float32 pL[32768]; Float32 pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; uint32_t fpd; }; diff --git a/plugins/MacAU/BrightAmbience3/BrightAmbience3.cpp b/plugins/MacAU/BrightAmbience3/BrightAmbience3.cpp index 425dd3e5f..b62fd9bee 100644 --- a/plugins/MacAU/BrightAmbience3/BrightAmbience3.cpp +++ b/plugins/MacAU/BrightAmbience3/BrightAmbience3.cpp @@ -221,7 +221,7 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -249,17 +249,17 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct figureL[6] = figureR[6] = (1.0 - K / figureR[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -273,7 +273,7 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; diff --git a/plugins/MacAU/BrightAmbience3/BrightAmbience3.h b/plugins/MacAU/BrightAmbience3/BrightAmbience3.h index c169cd303..e72eeddea 100644 --- a/plugins/MacAU/BrightAmbience3/BrightAmbience3.h +++ b/plugins/MacAU/BrightAmbience3/BrightAmbience3.h @@ -125,10 +125,10 @@ public: int gcount; Float32 pL[32768]; Float32 pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/MacAU/BuildATPDF/BuildATPDF.cpp b/plugins/MacAU/BuildATPDF/BuildATPDF.cpp index 8fd727b71..4968a7ebf 100755 --- a/plugins/MacAU/BuildATPDF/BuildATPDF.cpp +++ b/plugins/MacAU/BuildATPDF/BuildATPDF.cpp @@ -261,30 +261,7 @@ void BuildATPDF::BuildATPDFKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacAU/BussColors4/BussColors4.cpp b/plugins/MacAU/BussColors4/BussColors4.cpp index 35f793114..1c406f123 100755 --- a/plugins/MacAU/BussColors4/BussColors4.cpp +++ b/plugins/MacAU/BussColors4/BussColors4.cpp @@ -227,7 +227,7 @@ void BussColors4::BussColors4Kernel::Reset() control = 0; gcount = 0; slowdyn = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -243,7 +243,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); if (overallscale < 1.0) overallscale = 1.0; @@ -252,7 +252,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, const int maxConvolutionBufferSize = (int)(34.0 * overallscale); //we won't use more of the buffer than we have to for (int count = 0; count < 34; count++) c[count] = (int)(count * overallscale); //assign conv taps - long double inputSample; + double inputSample; Float64 drySample; Float64 applyconv; @@ -283,30 +283,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gain != 1.0) { @@ -657,11 +634,11 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/BussColors4/BussColors4.h b/plugins/MacAU/BussColors4/BussColors4.h index 321760e19..771bb1413 100755 --- a/plugins/MacAU/BussColors4/BussColors4.h +++ b/plugins/MacAU/BussColors4/BussColors4.h @@ -160,7 +160,7 @@ public: Float64 control; int gcount; Float64 slowdyn; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/ButterComp/ButterComp.cpp b/plugins/MacAU/ButterComp/ButterComp.cpp index 5280a58c1..c827d75d7 100755 --- a/plugins/MacAU/ButterComp/ButterComp.cpp +++ b/plugins/MacAU/ButterComp/ButterComp.cpp @@ -170,7 +170,7 @@ void ButterComp::ButterCompKernel::Reset() controlneg = 1.0; targetpos = 1.0; targetneg = 1.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -194,8 +194,8 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, Float64 calcneg; Float64 outputpos; Float64 outputneg; - long double totalmultiplier; - long double inputSample; + double totalmultiplier; + double inputSample; Float64 drySample; Float64 inputgain = pow(10.0,(GetParameter( kParam_One )*14.0)/20.0); Float64 wet = GetParameter( kParam_Two ); @@ -210,30 +210,7 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, divisor = 1.0 - divisor; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= inputgain; @@ -283,11 +260,11 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, inputSample /= outputgain; if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/ButterComp/ButterComp.h b/plugins/MacAU/ButterComp/ButterComp.h index 0008b7403..0e70cfe36 100755 --- a/plugins/MacAU/ButterComp/ButterComp.h +++ b/plugins/MacAU/ButterComp/ButterComp.h @@ -132,7 +132,7 @@ public: Float64 controlneg; Float64 targetpos; Float64 targetneg; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/ButterComp2/ButterComp2.cpp b/plugins/MacAU/ButterComp2/ButterComp2.cpp index ec459146a..b269a3604 100755 --- a/plugins/MacAU/ButterComp2/ButterComp2.cpp +++ b/plugins/MacAU/ButterComp2/ButterComp2.cpp @@ -182,7 +182,7 @@ void ButterComp2::ButterComp2Kernel::Reset() targetneg = 1.0; flip = false; lastOutput = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -212,55 +212,37 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, outputgain += 1.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutput)); + double divisor = compfactor / (1.0+fabs(lastOutput)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputpos = inputSample + 1.0; + double inputpos = inputSample + 1.0; if (inputpos < 0.0) inputpos = 0.0; - long double outputpos = inputpos / 2.0; + double outputpos = inputpos / 2.0; if (outputpos > 1.0) outputpos = 1.0; inputpos *= inputpos; targetpos *= divisor; targetpos += (inputpos * remainder); - long double calcpos = pow((1.0/targetpos),2); + double calcpos = pow((1.0/targetpos),2); - long double inputneg = (-inputSample) + 1.0; + double inputneg = (-inputSample) + 1.0; if (inputneg < 0.0) inputneg = 0.0; - long double outputneg = inputneg / 2.0; + double outputneg = inputneg / 2.0; if (outputneg > 1.0) outputneg = 1.0; inputneg *= inputneg; targetneg *= divisor; targetneg += (inputneg * remainder); - long double calcneg = pow((1.0/targetneg),2); + double calcneg = pow((1.0/targetneg),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -293,7 +275,7 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplier; + double totalmultiplier; if (flip) {totalmultiplier = (controlApos * outputpos) + (controlAneg * outputneg);} else @@ -317,11 +299,11 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/ButterComp2/ButterComp2.h b/plugins/MacAU/ButterComp2/ButterComp2.h index 068e00968..e91bba280 100755 --- a/plugins/MacAU/ButterComp2/ButterComp2.h +++ b/plugins/MacAU/ButterComp2/ButterComp2.h @@ -131,15 +131,15 @@ public: virtual void Reset(); private: - long double controlApos; - long double controlAneg; - long double controlBpos; - long double controlBneg; - long double targetpos; - long double targetneg; - long double lastOutput; + double controlApos; + double controlAneg; + double controlBpos; + double controlBneg; + double targetpos; + double targetneg; + double lastOutput; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.cpp b/plugins/MacAU/C5RawBuss/C5RawBuss.cpp index 9cca2dd2a..06a95e63f 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.cpp +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.cpp @@ -160,7 +160,7 @@ void C5RawBuss::C5RawBussKernel::Reset() { lastFXBuss = 0.0; lastSampleBuss = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,7 +176,7 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double centering = GetParameter( kParam_One ) * 0.5; + double centering = GetParameter( kParam_One ) * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -184,34 +184,11 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, //Xmas Morning bugged-out Console5, which is the default setting for Raw Console5. Float64 difference; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; @@ -232,11 +209,11 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, //build new signal off what was present in output last time //slew aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/C5RawBuss/C5RawBuss.h b/plugins/MacAU/C5RawBuss/C5RawBuss.h index 1d3209e9f..c2503f09b 100755 --- a/plugins/MacAU/C5RawBuss/C5RawBuss.h +++ b/plugins/MacAU/C5RawBuss/C5RawBuss.h @@ -127,7 +127,7 @@ public: private: Float64 lastFXBuss; Float64 lastSampleBuss; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/C5RawChannel/C5RawChannel.cpp b/plugins/MacAU/C5RawChannel/C5RawChannel.cpp index 2b2eb7959..dcfcf5813 100755 --- a/plugins/MacAU/C5RawChannel/C5RawChannel.cpp +++ b/plugins/MacAU/C5RawChannel/C5RawChannel.cpp @@ -160,7 +160,7 @@ void C5RawChannel::C5RawChannelKernel::Reset() { lastFXChannel = 0.0; lastSampleChannel = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,7 +176,7 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double centering = GetParameter( kParam_One ) * 0.5; + double centering = GetParameter( kParam_One ) * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -184,34 +184,11 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, //Xmas Morning bugged-out Console5, which is the default setting for Raw Console5. Float64 difference; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; difference = lastSampleChannel - inputSample; lastSampleChannel = inputSample; @@ -233,11 +210,11 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/C5RawChannel/C5RawChannel.h b/plugins/MacAU/C5RawChannel/C5RawChannel.h index c0bc73014..30993acef 100755 --- a/plugins/MacAU/C5RawChannel/C5RawChannel.h +++ b/plugins/MacAU/C5RawChannel/C5RawChannel.h @@ -127,7 +127,7 @@ public: private: Float64 lastSampleChannel; Float64 lastFXChannel; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/CStrip/CStrip.cpp b/plugins/MacAU/CStrip/CStrip.cpp index 494d6b589..ab77045ad 100755 --- a/plugins/MacAU/CStrip/CStrip.cpp +++ b/plugins/MacAU/CStrip/CStrip.cpp @@ -257,7 +257,7 @@ ComponentResult CStrip::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void CStrip::CStripKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSample = 0.0; last2Sample = 0.0; @@ -345,8 +345,8 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, overallscale = GetSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 inputSample; Float64 highSample = 0.0; @@ -427,30 +427,7 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; last2Sample = lastSample; lastSample = inputSample; @@ -764,11 +741,11 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, //built in output trim and dry/wet if desired if (outputgain != 1.0) inputSample *= outputgain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Calibre/Calibre.cpp b/plugins/MacAU/Calibre/Calibre.cpp index 61fa0ef26..b5dd59e1c 100755 --- a/plugins/MacAU/Calibre/Calibre.cpp +++ b/plugins/MacAU/Calibre/Calibre.cpp @@ -222,8 +222,8 @@ void Calibre::CalibreKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = *sourceP * indrive; diff --git a/plugins/MacAU/Capacitor/Capacitor.cpp b/plugins/MacAU/Capacitor/Capacitor.cpp index bfe38c2e9..39d6823af 100755 --- a/plugins/MacAU/Capacitor/Capacitor.cpp +++ b/plugins/MacAU/Capacitor/Capacitor.cpp @@ -196,7 +196,7 @@ void Capacitor::CapacitorKernel::Reset() lastLowpass = 1000.0; lastHighpass = 1000.0; lastWet = 1000.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -228,35 +228,12 @@ void Capacitor::CapacitorKernel::Process( const Float32 *inSourceP, Float64 invHighpass; Float64 dry; - long double inputSample; + double inputSample; Float32 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; lowpassAmount = (((lowpassAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); invLowpass = 1.0 - lowpassAmount; @@ -319,11 +296,11 @@ void Capacitor::CapacitorKernel::Process( const Float32 *inSourceP, inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Capacitor/Capacitor.h b/plugins/MacAU/Capacitor/Capacitor.h index 7608462c8..0cf166044 100755 --- a/plugins/MacAU/Capacitor/Capacitor.h +++ b/plugins/MacAU/Capacitor/Capacitor.h @@ -158,7 +158,7 @@ public: Float64 lastHighpass; Float64 lastWet; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Capacitor2/Capacitor2.cpp b/plugins/MacAU/Capacitor2/Capacitor2.cpp index 5bc680e12..7fd68d331 100755 --- a/plugins/MacAU/Capacitor2/Capacitor2.cpp +++ b/plugins/MacAU/Capacitor2/Capacitor2.cpp @@ -235,9 +235,9 @@ void Capacitor2::Capacitor2Kernel::Process( const Float32 *inSourceP, lastWet = wetChase; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 dielectricScale = fabs(2.0-((inputSample+nonLin)/nonLin)); lowpassBaseAmount = (((lowpassBaseAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); diff --git a/plugins/MacAU/Chamber/Chamber.cpp b/plugins/MacAU/Chamber/Chamber.cpp index 2e9cfe569..9343b804f 100644 --- a/plugins/MacAU/Chamber/Chamber.cpp +++ b/plugins/MacAU/Chamber/Chamber.cpp @@ -251,7 +251,7 @@ void Chamber::ChamberKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -294,7 +294,7 @@ void Chamber::ChamberKernel::Process( const Float32 *inSourceP, //sustain infinitely. while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; diff --git a/plugins/MacAU/Chamber/Chamber.h b/plugins/MacAU/Chamber/Chamber.h index 287a83d1d..6c9b02695 100644 --- a/plugins/MacAU/Chamber/Chamber.h +++ b/plugins/MacAU/Chamber/Chamber.h @@ -163,7 +163,7 @@ public: Float64 previousC; Float64 previousD; - long double lastRef[10]; + double lastRef[10]; int cycle; int countA, delayA; diff --git a/plugins/MacAU/Channel4/Channel4.cpp b/plugins/MacAU/Channel4/Channel4.cpp index 523b7bef9..3805b057f 100755 --- a/plugins/MacAU/Channel4/Channel4.cpp +++ b/plugins/MacAU/Channel4/Channel4.cpp @@ -207,11 +207,11 @@ void Channel4::Channel4Kernel::Process( const Float32 *inSourceP, overallscale *= GetSampleRate(); int console = (int) GetParameter( kParam_One ); Float64 density = pow(GetParameter( kParam_Two )/100.0,2); - long double bridgerectifier; + double bridgerectifier; Float64 iirAmount = 0.005832; Float64 threshold = 0.33362176; Float64 clamp; - long double inputSample; + double inputSample; Float32 fpTemp; Float64 fpOld = 0.618033988749894848204586; //golden ratio! Float64 fpNew = 1.0 - fpOld; @@ -227,30 +227,7 @@ void Channel4::Channel4Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { diff --git a/plugins/MacAU/Channel5/Channel5.cpp b/plugins/MacAU/Channel5/Channel5.cpp index 417b6c7ef..eeb02f391 100755 --- a/plugins/MacAU/Channel5/Channel5.cpp +++ b/plugins/MacAU/Channel5/Channel5.cpp @@ -190,7 +190,7 @@ ComponentResult Channel5::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Channel5::Channel5Kernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; iirSampleA = 0.0; iirSampleB = 0.0; flip = false; @@ -227,27 +227,9 @@ void Channel5::Channel5Kernel::Process( const Float32 *inSourceP, threshold /= overallscale; //now with 96K AND working selector! while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -260,7 +242,7 @@ void Channel5::Channel5Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double bridgerectifier = fabs(inputSample)*1.57079633; + double bridgerectifier = fabs(inputSample)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSample > 0) inputSample = (inputSample*(1-density))+(bridgerectifier*density); diff --git a/plugins/MacAU/Channel6/Channel6.cpp b/plugins/MacAU/Channel6/Channel6.cpp index b8e0f120a..781b0263b 100755 --- a/plugins/MacAU/Channel6/Channel6.cpp +++ b/plugins/MacAU/Channel6/Channel6.cpp @@ -227,9 +227,9 @@ void Channel6::Channel6Kernel::Process( const Float32 *inSourceP, threshold /= overallscale; //now with 96K AND working selector! while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -242,14 +242,14 @@ void Channel6::Channel6Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = (drySample*(1-density))+(distSample*density); //drive section diff --git a/plugins/MacAU/Channel6/Channel6.h b/plugins/MacAU/Channel6/Channel6.h index b6b2975e4..8f8cc8706 100755 --- a/plugins/MacAU/Channel6/Channel6.h +++ b/plugins/MacAU/Channel6/Channel6.h @@ -142,10 +142,10 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSample; + double lastSample; }; }; diff --git a/plugins/MacAU/Channel7/Channel7.cpp b/plugins/MacAU/Channel7/Channel7.cpp index 7e147ed2e..2aaa9011c 100755 --- a/plugins/MacAU/Channel7/Channel7.cpp +++ b/plugins/MacAU/Channel7/Channel7.cpp @@ -230,8 +230,8 @@ void Channel7::Channel7Kernel::Process( const Float32 *inSourceP, iirAmount /= overallscale; //we've learned not to try and adjust threshold for sample rate while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -244,15 +244,15 @@ void Channel7::Channel7Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect diff --git a/plugins/MacAU/Channel7/Channel7.h b/plugins/MacAU/Channel7/Channel7.h index 836e48943..eb3b5bb64 100755 --- a/plugins/MacAU/Channel7/Channel7.h +++ b/plugins/MacAU/Channel7/Channel7.h @@ -142,10 +142,10 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSample; + double lastSample; }; }; diff --git a/plugins/MacAU/Channel8/Channel8.cpp b/plugins/MacAU/Channel8/Channel8.cpp index 820f79007..0e75f929a 100755 --- a/plugins/MacAU/Channel8/Channel8.cpp +++ b/plugins/MacAU/Channel8/Channel8.cpp @@ -229,8 +229,8 @@ void Channel8::Channel8Kernel::Process( const Float32 *inSourceP, iirAmount /= overallscale; //we've learned not to try and adjust threshold for sample rate while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 dielectricScale = fabs(2.0-((inputSample+nonLin)/nonLin)); @@ -245,15 +245,15 @@ void Channel8::Channel8Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section including capacitor modeling nonlinearity - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect diff --git a/plugins/MacAU/Channel8/Channel8.h b/plugins/MacAU/Channel8/Channel8.h index 65e4c9933..c8e9ae070 100755 --- a/plugins/MacAU/Channel8/Channel8.h +++ b/plugins/MacAU/Channel8/Channel8.h @@ -142,12 +142,12 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; + double lastSampleA; + double lastSampleB; + double lastSampleC; }; }; diff --git a/plugins/MacAU/Channel9/Channel9.cpp b/plugins/MacAU/Channel9/Channel9.cpp index 41507e539..2e51fc384 100755 --- a/plugins/MacAU/Channel9/Channel9.cpp +++ b/plugins/MacAU/Channel9/Channel9.cpp @@ -257,11 +257,11 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; if (fabs(tempSample)<1.18e-37) tempSample = 0.0; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } @@ -281,15 +281,15 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section including capacitor modeling nonlinearity - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect @@ -318,7 +318,7 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, } if (biquadB[0] < 0.49999) { - long double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; + double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSample; if (fabs(tempSample)<1.18e-37) tempSample = 0.0; inputSample = tempSample; biquadB[10] = biquadB[9]; biquadB[9] = inputSample; //DF1 } diff --git a/plugins/MacAU/Channel9/Channel9.h b/plugins/MacAU/Channel9/Channel9.h index 4b46c7456..5fa4a8f25 100755 --- a/plugins/MacAU/Channel9/Channel9.h +++ b/plugins/MacAU/Channel9/Channel9.h @@ -145,14 +145,14 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double biquadA[11]; - long double biquadB[11]; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double biquadA[11]; + double biquadB[11]; }; }; diff --git a/plugins/MacAU/Chorus/Chorus.cpp b/plugins/MacAU/Chorus/Chorus.cpp index 6a4eb69ba..c680c6574 100755 --- a/plugins/MacAU/Chorus/Chorus.cpp +++ b/plugins/MacAU/Chorus/Chorus.cpp @@ -181,7 +181,7 @@ void Chorus::ChorusKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -214,35 +214,12 @@ void Chorus::ChorusKernel::Process( const Float32 *inSourceP, Float64 offset; //this is a double buffer so we will be splitting it in two - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -277,11 +254,11 @@ void Chorus::ChorusKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/Chorus/Chorus.h b/plugins/MacAU/Chorus/Chorus.h index ff1fdf2b1..07762c345 100755 --- a/plugins/MacAU/Chorus/Chorus.h +++ b/plugins/MacAU/Chorus/Chorus.h @@ -139,7 +139,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.cpp b/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.cpp index 4cc8f3657..63029e7f1 100755 --- a/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.cpp +++ b/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.cpp @@ -181,7 +181,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -214,7 +214,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, Float64 offset; Float64 start[4]; - long double inputSample; + double inputSample; Float64 drySample; //now we'll precalculate some stuff that needn't be in every sample start[0] = range; @@ -224,30 +224,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -307,11 +284,11 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.h b/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.h index 7012d5866..3e2117519 100755 --- a/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.h +++ b/plugins/MacAU/ChorusEnsemble/ChorusEnsemble.h @@ -139,7 +139,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/ChromeOxide/ChromeOxide.cpp b/plugins/MacAU/ChromeOxide/ChromeOxide.cpp index 14394ad58..2d4c84f1d 100755 --- a/plugins/MacAU/ChromeOxide/ChromeOxide.cpp +++ b/plugins/MacAU/ChromeOxide/ChromeOxide.cpp @@ -220,8 +220,8 @@ void ChromeOxide::ChromeOxideKernel::Process( const Float32 *inSourceP, //everything runs off Intensity now while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; bassSample = inputSample; diff --git a/plugins/MacAU/Cider/Cider.cpp b/plugins/MacAU/Cider/Cider.cpp index c27051920..6cf579741 100755 --- a/plugins/MacAU/Cider/Cider.cpp +++ b/plugins/MacAU/Cider/Cider.cpp @@ -222,8 +222,8 @@ void Cider::CiderKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacAU/ClipOnly2/ClipOnly2.cpp b/plugins/MacAU/ClipOnly2/ClipOnly2.cpp index a608467d2..ac8baba81 100644 --- a/plugins/MacAU/ClipOnly2/ClipOnly2.cpp +++ b/plugins/MacAU/ClipOnly2/ClipOnly2.cpp @@ -169,7 +169,7 @@ void ClipOnly2::ClipOnly2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); diff --git a/plugins/MacAU/Coils/Coils.cpp b/plugins/MacAU/Coils/Coils.cpp index 75cb6dbc9..d3c2fcd87 100755 --- a/plugins/MacAU/Coils/Coils.cpp +++ b/plugins/MacAU/Coils/Coils.cpp @@ -210,11 +210,11 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP, figure[6] = (1.0 - K / figure[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -225,7 +225,7 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP, //the full frequencies but distorts like a real transformer. Purest case, and since //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSample * figure[2]) + figure[7]; + double tempSample = (inputSample * figure[2]) + figure[7]; figure[7] = -(tempSample * figure[5]) + figure[8]; figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/MacAU/Coils/Coils.h b/plugins/MacAU/Coils/Coils.h index 733aabc4b..9d8c46a00 100755 --- a/plugins/MacAU/Coils/Coils.h +++ b/plugins/MacAU/Coils/Coils.h @@ -131,7 +131,7 @@ public: virtual void Reset(); private: - long double figure[9]; + double figure[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Coils2/Coils2.cpp b/plugins/MacAU/Coils2/Coils2.cpp index 6b8070ca4..49c63a084 100644 --- a/plugins/MacAU/Coils2/Coils2.cpp +++ b/plugins/MacAU/Coils2/Coils2.cpp @@ -191,7 +191,7 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -199,7 +199,7 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/GetSampleRate(); biquadA[1] = 0.01+(pow(GetParameter( kParam_Two ),2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -218,19 +218,19 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; //create bandpass of clean tone } - long double diffSample = (drySample-inputSample)/distScaling; //mids notched out + double diffSample = (drySample-inputSample)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSample * biquadB[2]) + biquadB[7]; + double tempSample = (diffSample * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSample * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSample * biquadB[4]) - (tempSample * biquadB[6]); diffSample = tempSample; //lowpass filter the notch content before distorting diff --git a/plugins/MacAU/Coils2/Coils2.h b/plugins/MacAU/Coils2/Coils2.h index 769fc0d7d..c7088c199 100644 --- a/plugins/MacAU/Coils2/Coils2.h +++ b/plugins/MacAU/Coils2/Coils2.h @@ -129,9 +129,9 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double hysteresis; + double biquadA[9]; + double biquadB[9]; + double hysteresis; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Cojones/Cojones.cpp b/plugins/MacAU/Cojones/Cojones.cpp index a92b51632..783cf4b60 100755 --- a/plugins/MacAU/Cojones/Cojones.cpp +++ b/plugins/MacAU/Cojones/Cojones.cpp @@ -192,7 +192,7 @@ void Cojones::CojonesKernel::Reset() { stored[0] = stored[1] = 0.0; diff[0] = diff[1] = diff[2] = diff[3] = diff[4] = diff[5] = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -216,28 +216,10 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, Float64 average[5]; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; stored[1] = stored[0]; stored[0] = inputSample; @@ -260,17 +242,17 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, average[3] /= 5.0; average[4] /= 6.0; - long double meanA = diff[0]; - long double meanB = diff[0]; + double meanA = diff[0]; + double meanB = diff[0]; if (fabs(average[4]) < fabs(meanB)) {meanA = meanB; meanB = average[4];} if (fabs(average[3]) < fabs(meanB)) {meanA = meanB; meanB = average[3];} if (fabs(average[2]) < fabs(meanB)) {meanA = meanB; meanB = average[2];} if (fabs(average[1]) < fabs(meanB)) {meanA = meanB; meanB = average[1];} if (fabs(average[0]) < fabs(meanB)) {meanA = meanB; meanB = average[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); stored[0] = (stored[1] + meanOut); - long double outputSample = stored[0]*body; + double outputSample = stored[0]*body; //presubtract cojones outputSample += (((inputSample - stored[0])-average[1])*cojones); @@ -286,11 +268,11 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * (1.0-wet)); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Cojones/Cojones.h b/plugins/MacAU/Cojones/Cojones.h index fba3b00c2..6424da7fa 100755 --- a/plugins/MacAU/Cojones/Cojones.h +++ b/plugins/MacAU/Cojones/Cojones.h @@ -137,9 +137,9 @@ public: virtual void Reset(); private: - long double stored[2]; - long double diff[6]; - long double fpNShape; + double stored[2]; + double diff[6]; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Compresaturator/Compresaturator.cpp b/plugins/MacAU/Compresaturator/Compresaturator.cpp index 158c64113..74a9593bf 100755 --- a/plugins/MacAU/Compresaturator/Compresaturator.cpp +++ b/plugins/MacAU/Compresaturator/Compresaturator.cpp @@ -221,29 +221,11 @@ void Compresaturator::CompresaturatorKernel::Process( const Float32 *inSourceP Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - long double temp = inputSample; + double inputSample = *sourceP; + double temp = inputSample; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (dCount < 1 || dCount > 5000) {dCount = 5000;} @@ -258,7 +240,7 @@ void Compresaturator::CompresaturatorKernel::Process( const Float32 *inSourceP } } - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); Float64 overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/MacAU/Console4Buss/Console4Buss.cpp b/plugins/MacAU/Console4Buss/Console4Buss.cpp index a37a7c5f8..2cdf4eb18 100755 --- a/plugins/MacAU/Console4Buss/Console4Buss.cpp +++ b/plugins/MacAU/Console4Buss/Console4Buss.cpp @@ -162,7 +162,7 @@ void Console4Buss::Console4BussKernel::Reset() gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -184,9 +184,9 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, overallscale /= 44100.0; // 1 for CD rate, more if it's a high sample rate - long double inputSample; - long double half; - long double falf; + double inputSample; + double half; + double falf; Float64 slewcompensation; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { @@ -200,30 +200,7 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; //if we're going to do a gain, we must apply it to everything here - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; @@ -258,11 +235,11 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Console4Buss/Console4Buss.h b/plugins/MacAU/Console4Buss/Console4Buss.h index dc7e15fbe..9001f3adb 100755 --- a/plugins/MacAU/Console4Buss/Console4Buss.h +++ b/plugins/MacAU/Console4Buss/Console4Buss.h @@ -131,7 +131,7 @@ public: Float64 gainchase; Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console4Channel/Console4Channel.cpp b/plugins/MacAU/Console4Channel/Console4Channel.cpp index 865b3b0b5..7c2466c31 100755 --- a/plugins/MacAU/Console4Channel/Console4Channel.cpp +++ b/plugins/MacAU/Console4Channel/Console4Channel.cpp @@ -161,7 +161,7 @@ void Console4Channel::Console4ChannelKernel::Reset() gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,9 +176,9 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; - long double half; - long double falf; + double inputSample; + double half; + double falf; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -190,30 +190,7 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; //if we're going to do a gain, we must apply it to everything here @@ -237,11 +214,11 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //force 80 bit into 32 bit output diff --git a/plugins/MacAU/Console4Channel/Console4Channel.h b/plugins/MacAU/Console4Channel/Console4Channel.h index 665d892c1..12023fc07 100755 --- a/plugins/MacAU/Console4Channel/Console4Channel.h +++ b/plugins/MacAU/Console4Channel/Console4Channel.h @@ -129,7 +129,7 @@ public: Float64 gainchase; Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console5Buss/Console5Buss.cpp b/plugins/MacAU/Console5Buss/Console5Buss.cpp index 3c1c84582..53f0b9675 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.cpp +++ b/plugins/MacAU/Console5Buss/Console5Buss.cpp @@ -165,7 +165,7 @@ void Console5Buss::Console5BussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -189,7 +189,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -273,11 +250,11 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, lastFXBuss *= (1.0 - (nearZero * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Console5Buss/Console5Buss.h b/plugins/MacAU/Console5Buss/Console5Buss.h index c7f16380c..205b48254 100755 --- a/plugins/MacAU/Console5Buss/Console5Buss.h +++ b/plugins/MacAU/Console5Buss/Console5Buss.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console5Channel/Console5Channel.cpp b/plugins/MacAU/Console5Channel/Console5Channel.cpp index 356f3475a..2cb1bcd67 100755 --- a/plugins/MacAU/Console5Channel/Console5Channel.cpp +++ b/plugins/MacAU/Console5Channel/Console5Channel.cpp @@ -165,7 +165,7 @@ void Console5Channel::Console5ChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -189,7 +189,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -274,11 +251,11 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Console5Channel/Console5Channel.h b/plugins/MacAU/Console5Channel/Console5Channel.h index 3b4104ef6..ae782b070 100755 --- a/plugins/MacAU/Console5Channel/Console5Channel.h +++ b/plugins/MacAU/Console5Channel/Console5Channel.h @@ -131,7 +131,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console5DarkCh/Console5DarkCh.cpp b/plugins/MacAU/Console5DarkCh/Console5DarkCh.cpp index 4b1cefdcb..5d5093cbd 100755 --- a/plugins/MacAU/Console5DarkCh/Console5DarkCh.cpp +++ b/plugins/MacAU/Console5DarkCh/Console5DarkCh.cpp @@ -165,7 +165,7 @@ void Console5DarkCh::Console5DarkChKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 inputgain = GetParameter( kParam_One ); @@ -188,7 +188,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,30 +200,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -273,11 +250,11 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Console5DarkCh/Console5DarkCh.h b/plugins/MacAU/Console5DarkCh/Console5DarkCh.h index 157ad9b80..2148c8784 100755 --- a/plugins/MacAU/Console5DarkCh/Console5DarkCh.h +++ b/plugins/MacAU/Console5DarkCh/Console5DarkCh.h @@ -131,7 +131,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console6Buss/Console6Buss.cpp b/plugins/MacAU/Console6Buss/Console6Buss.cpp index 38d21c9e6..6b52e124b 100755 --- a/plugins/MacAU/Console6Buss/Console6Buss.cpp +++ b/plugins/MacAU/Console6Buss/Console6Buss.cpp @@ -176,8 +176,8 @@ void Console6Buss::Console6BussKernel::Process( const Float32 *inSourceP, Float64 gain = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gain != 1.0) { inputSample *= gain; diff --git a/plugins/MacAU/Console6Channel/Console6Channel.cpp b/plugins/MacAU/Console6Channel/Console6Channel.cpp index 10b44b60b..212ef1b16 100755 --- a/plugins/MacAU/Console6Channel/Console6Channel.cpp +++ b/plugins/MacAU/Console6Channel/Console6Channel.cpp @@ -176,8 +176,8 @@ void Console6Channel::Console6ChannelKernel::Process( const Float32 *inSourceP Float64 gain = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gain != 1.0) { inputSample *= gain; diff --git a/plugins/MacAU/Console7Buss/Console7Buss.cpp b/plugins/MacAU/Console7Buss/Console7Buss.cpp index 559d19033..dc140c5c1 100755 --- a/plugins/MacAU/Console7Buss/Console7Buss.cpp +++ b/plugins/MacAU/Console7Buss/Console7Buss.cpp @@ -176,7 +176,7 @@ void Console7Buss::Console7BussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = GetParameter( kParam_One ) * 1.03; + double inputgain = GetParameter( kParam_One ) * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > inFramesToProcess) chasespeed = inFramesToProcess; @@ -203,10 +203,10 @@ void Console7Buss::Console7BussKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Console7Buss/Console7Buss.h b/plugins/MacAU/Console7Buss/Console7Buss.h index 9d50dfb97..56289c529 100755 --- a/plugins/MacAU/Console7Buss/Console7Buss.h +++ b/plugins/MacAU/Console7Buss/Console7Buss.h @@ -127,8 +127,8 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console7Cascade/Console7Cascade.cpp b/plugins/MacAU/Console7Cascade/Console7Cascade.cpp index 3d9abac1c..c5dd3f182 100755 --- a/plugins/MacAU/Console7Cascade/Console7Cascade.cpp +++ b/plugins/MacAU/Console7Cascade/Console7Cascade.cpp @@ -177,7 +177,7 @@ void Console7Cascade::Console7CascadeKernel::Process( const Float32 *inSourceP const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); + double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) //Neutral gain through the whole system with a full scale sine ia 0.772 on the gain knob @@ -233,10 +233,10 @@ void Console7Cascade::Console7CascadeKernel::Process( const Float32 *inSourceP biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Console7Cascade/Console7Cascade.h b/plugins/MacAU/Console7Cascade/Console7Cascade.h index dd3683c12..8376a30f3 100755 --- a/plugins/MacAU/Console7Cascade/Console7Cascade.h +++ b/plugins/MacAU/Console7Cascade/Console7Cascade.h @@ -127,11 +127,11 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console7Channel/Console7Channel.cpp b/plugins/MacAU/Console7Channel/Console7Channel.cpp index 24cf79e55..01b7d0985 100755 --- a/plugins/MacAU/Console7Channel/Console7Channel.cpp +++ b/plugins/MacAU/Console7Channel/Console7Channel.cpp @@ -176,7 +176,7 @@ void Console7Channel::Console7ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = GetParameter( kParam_One )*1.272019649514069; + double inputgain = GetParameter( kParam_One )*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -197,10 +197,10 @@ void Console7Channel::Console7ChannelKernel::Process( const Float32 *inSourceP biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Console7Channel/Console7Channel.h b/plugins/MacAU/Console7Channel/Console7Channel.h index 24ed7ba5b..8366db4f1 100755 --- a/plugins/MacAU/Console7Channel/Console7Channel.h +++ b/plugins/MacAU/Console7Channel/Console7Channel.h @@ -127,7 +127,7 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Console7Crunch/Console7Crunch.cpp b/plugins/MacAU/Console7Crunch/Console7Crunch.cpp index 6ce337058..1c6a75810 100644 --- a/plugins/MacAU/Console7Crunch/Console7Crunch.cpp +++ b/plugins/MacAU/Console7Crunch/Console7Crunch.cpp @@ -177,7 +177,7 @@ void Console7Crunch::Console7CrunchKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); + double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) //Neutral gain through the whole system with a full scale sine ia 0.772 on the gain knob @@ -233,10 +233,10 @@ void Console7Crunch::Console7CrunchKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Console7Crunch/Console7Crunch.h b/plugins/MacAU/Console7Crunch/Console7Crunch.h index 82e2921b3..e3f0fc6da 100644 --- a/plugins/MacAU/Console7Crunch/Console7Crunch.h +++ b/plugins/MacAU/Console7Crunch/Console7Crunch.h @@ -127,11 +127,11 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp index be4cd1095..7e637aa24 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp @@ -177,7 +177,7 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Reset() bMidPrev = 0.0; cMidPrev = 0.0; dMidPrev = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,36 +269,13 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou Float64 dDry = 1.0 - dWet; Float64 drySample; - long double inputSample; + double inputSample; Float64 accumulatorSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (aWet > 0.0) { @@ -444,11 +421,11 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou inputSample = (inputSample * dWet) + (drySample * dDry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h index 07db5c78a..2bb17c358 100755 --- a/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h +++ b/plugins/MacAU/CrunchyGrooveWear/CrunchyGrooveWear.h @@ -138,7 +138,7 @@ public: Float64 cMidPrev; Float64 dMidPrev; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Crystal/Crystal.cpp b/plugins/MacAU/Crystal/Crystal.cpp index 9ca3fba9f..77e162f04 100755 --- a/plugins/MacAU/Crystal/Crystal.cpp +++ b/plugins/MacAU/Crystal/Crystal.cpp @@ -184,7 +184,7 @@ void Crystal::CrystalKernel::Reset() { for(int count = 0; count < 34; count++) {b[count] = 0;} lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -222,27 +222,9 @@ void Crystal::CrystalKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction @@ -302,11 +284,11 @@ void Crystal::CrystalKernel::Process( const Float32 *inSourceP, //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Crystal/Crystal.h b/plugins/MacAU/Crystal/Crystal.h index e2046ab7f..201f0d31f 100755 --- a/plugins/MacAU/Crystal/Crystal.h +++ b/plugins/MacAU/Crystal/Crystal.h @@ -137,7 +137,7 @@ public: private: Float64 b[35]; Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Dark/Dark.cpp b/plugins/MacAU/Dark/Dark.cpp index f53b8427c..924e89fa0 100755 --- a/plugins/MacAU/Dark/Dark.cpp +++ b/plugins/MacAU/Dark/Dark.cpp @@ -197,7 +197,7 @@ void Dark::DarkKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int depth = (int)(17.0*overallscale); @@ -217,7 +217,7 @@ void Dark::DarkKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float32 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacAU/DarkNoise/DarkNoise.cpp b/plugins/MacAU/DarkNoise/DarkNoise.cpp index 9de447fd8..e561a4327 100755 --- a/plugins/MacAU/DarkNoise/DarkNoise.cpp +++ b/plugins/MacAU/DarkNoise/DarkNoise.cpp @@ -243,8 +243,8 @@ void DarkNoise::DarkNoiseKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (freqTarget < freq) { @@ -269,7 +269,7 @@ void DarkNoise::DarkNoiseKernel::Process( const Float32 *inSourceP, Float64 nondarkSample = inputSample; - long double previousPole = 0; + double previousPole = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) b[x+1][y] = b[x][y]; b[0][y] = previousPole = inputSample; diff --git a/plugins/MacAU/DeBess/DeBess.cpp b/plugins/MacAU/DeBess/DeBess.cpp index 9fb5072e7..1fcb1f054 100755 --- a/plugins/MacAU/DeBess/DeBess.cpp +++ b/plugins/MacAU/DeBess/DeBess.cpp @@ -210,7 +210,7 @@ void DeBess::DeBessKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -223,7 +223,7 @@ void DeBess::DeBessKernel::Process( const Float32 *inSourceP, int monitoring = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; s[0] = inputSample; //set up so both [0] and [1] will be input sample diff --git a/plugins/MacAU/DeBess/DeBess.h b/plugins/MacAU/DeBess/DeBess.h index e9dd418e6..feeba336d 100755 --- a/plugins/MacAU/DeBess/DeBess.h +++ b/plugins/MacAU/DeBess/DeBess.h @@ -137,7 +137,7 @@ public: virtual void Reset(); private: - long double s[41], m[41], c[41]; + double s[41], m[41], c[41]; Float64 ratioA; Float64 ratioB; Float64 iirSampleA; diff --git a/plugins/MacAU/DeEss/DeEss.cpp b/plugins/MacAU/DeEss/DeEss.cpp index bf85e7605..0cb1da1c2 100755 --- a/plugins/MacAU/DeEss/DeEss.cpp +++ b/plugins/MacAU/DeEss/DeEss.cpp @@ -181,7 +181,7 @@ void DeEss::DeEssKernel::Reset() iirSampleA = 0.0; iirSampleB = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,32 +208,9 @@ void DeEss::DeEssKernel::Process( const Float32 *inSourceP, Float64 attackspeed; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; s3 = s2; s2 = s1; @@ -276,11 +253,11 @@ void DeEss::DeEssKernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/DeEss/DeEss.h b/plugins/MacAU/DeEss/DeEss.h index e0cc7901e..72067f434 100755 --- a/plugins/MacAU/DeEss/DeEss.h +++ b/plugins/MacAU/DeEss/DeEss.h @@ -155,7 +155,7 @@ public: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/DeHiss/DeHiss.cpp b/plugins/MacAU/DeHiss/DeHiss.cpp index ef5417578..ec1281561 100755 --- a/plugins/MacAU/DeHiss/DeHiss.cpp +++ b/plugins/MacAU/DeHiss/DeHiss.cpp @@ -185,7 +185,7 @@ void DeHiss::DeHissKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -198,8 +198,8 @@ void DeHiss::DeHissKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; stored[1] = stored[0]; diff --git a/plugins/MacAU/DeRez/DeRez.cpp b/plugins/MacAU/DeRez/DeRez.cpp index e2f38291b..1482490e1 100755 --- a/plugins/MacAU/DeRez/DeRez.cpp +++ b/plugins/MacAU/DeRez/DeRez.cpp @@ -171,7 +171,7 @@ void DeRez::DeRezKernel::Reset() position = 0.0; incrementA = 0.0; incrementB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -201,39 +201,16 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, targetA /= overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23 && (targetB == 0)) inputSample = fpd * 1.18e-17; + double drySample = inputSample; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; //incrementA is the frequency derez //incrementB is the bit depth derez position += incrementA; - long double outputSample = heldSample; + double outputSample = heldSample; if (position > 1.0) { position -= 1.0; @@ -242,7 +219,7 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, //softens the edge of the derez } inputSample = outputSample; - long double offset = inputSample; + double offset = inputSample; if (incrementB > 0.0005) { if (inputSample > 0) @@ -260,11 +237,11 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, inputSample *= (1.0 - incrementB); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; lastSample = drySample; diff --git a/plugins/MacAU/DeRez/DeRez.h b/plugins/MacAU/DeRez/DeRez.h index e592bcbaa..c5ba1de6c 100755 --- a/plugins/MacAU/DeRez/DeRez.h +++ b/plugins/MacAU/DeRez/DeRez.h @@ -133,7 +133,7 @@ public: Float64 position; Float64 incrementA; Float64 incrementB; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/DeRez2/DeRez2.cpp b/plugins/MacAU/DeRez2/DeRez2.cpp index 81cdce9b7..e265d612f 100755 --- a/plugins/MacAU/DeRez2/DeRez2.cpp +++ b/plugins/MacAU/DeRez2/DeRez2.cpp @@ -216,9 +216,9 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, targetA /= overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -226,7 +226,7 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, //incrementA is the frequency derez //incrementB is the bit depth derez position += incrementA; - long double outputSample = heldSample; + double outputSample = heldSample; if (position > 1.0) { position -= 1.0; @@ -236,7 +236,7 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, } inputSample = outputSample; - long double temp = inputSample; + double temp = inputSample; if (inputSample != lastOutputSample) { temp = inputSample; diff --git a/plugins/MacAU/Deckwrecka/Deckwrecka.cpp b/plugins/MacAU/Deckwrecka/Deckwrecka.cpp index 2e04079eb..849e962db 100755 --- a/plugins/MacAU/Deckwrecka/Deckwrecka.cpp +++ b/plugins/MacAU/Deckwrecka/Deckwrecka.cpp @@ -223,7 +223,7 @@ void Deckwrecka::DeckwreckaKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; randy = (rand()/(double)RAND_MAX); randy += (rand()/(double)RAND_MAX); diff --git a/plugins/MacAU/Density/Density.cpp b/plugins/MacAU/Density/Density.cpp index 7edf12bf4..6c7924c18 100755 --- a/plugins/MacAU/Density/Density.cpp +++ b/plugins/MacAU/Density/Density.cpp @@ -184,7 +184,7 @@ void Density::DensityKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -222,30 +222,7 @@ void Density::DensityKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (fpFlip) @@ -289,11 +266,11 @@ void Density::DensityKernel::Process( const Float32 *inSourceP, //number, we really don't want to meaninglessly multiply that by 1.0. fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Density/Density.h b/plugins/MacAU/Density/Density.h index 0d9af2970..918c607df 100755 --- a/plugins/MacAU/Density/Density.h +++ b/plugins/MacAU/Density/Density.h @@ -138,7 +138,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/Density2/Density2.cpp b/plugins/MacAU/Density2/Density2.cpp index 3e35f44e3..fa3e7dc2f 100755 --- a/plugins/MacAU/Density2/Density2.cpp +++ b/plugins/MacAU/Density2/Density2.cpp @@ -199,7 +199,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 density = GetParameter( kParam_One ); @@ -211,18 +211,18 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; - long double halfwaySample = (inputSample + last1Sample + ((-last2Sample + last3Sample) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySample = halfwaySample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double halfwaySample = (inputSample + last1Sample + ((-last2Sample + last3Sample) * 0.0414213562373095048801688)) / 2.0; + double halfDrySample = halfwaySample; last3Sample = last2Sample; last2Sample = last1Sample; last1Sample = inputSample; iirSampleB = (iirSampleB * (1.0 - iirAmount)) + (halfwaySample * iirAmount); halfwaySample -= iirSampleB; //highpass section double count = density; - long double bridgerectifier; + double bridgerectifier; while (count > 1.0) { bridgerectifier = fabs(halfwaySample)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; @@ -241,7 +241,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, ataC = halfwaySample - halfDrySample; ataA *= 0.915965594177219015; ataB *= 0.915965594177219015; ataB += ataC; ataA -= ataC; ataC = ataB; - long double halfDiffSample = ataC * 0.915965594177219015; + double halfDiffSample = ataC * 0.915965594177219015; iirSampleA = (iirSampleA * (1.0 - iirAmount)) + (inputSample * iirAmount); inputSample -= iirSampleA; //highpass section @@ -264,7 +264,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, ataC = inputSample - drySample; ataA *= 0.915965594177219015; ataB *= 0.915965594177219015; ataA += ataC; ataB -= ataC; ataC = ataA; - long double diffSample = ataC * 0.915965594177219015; + double diffSample = ataC * 0.915965594177219015; inputSample = drySample + ((diffSample + halfDiffSample + lastDiffSample) / 1.187); lastDiffSample = diffSample / 2.0; diff --git a/plugins/MacAU/Density2/Density2.h b/plugins/MacAU/Density2/Density2.h index 571245366..37da2b82b 100755 --- a/plugins/MacAU/Density2/Density2.h +++ b/plugins/MacAU/Density2/Density2.h @@ -135,15 +135,15 @@ public: virtual void Reset(); private: - long double last3Sample; - long double last2Sample; - long double last1Sample; - long double ataA; - long double ataB; - long double ataC; - long double lastDiffSample; - long double iirSampleA; - long double iirSampleB; + double last3Sample; + double last2Sample; + double last1Sample; + double ataA; + double ataB; + double ataC; + double lastDiffSample; + double iirSampleA; + double iirSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Desk/Desk.cpp b/plugins/MacAU/Desk/Desk.cpp index 69dcf987f..ed085b139 100755 --- a/plugins/MacAU/Desk/Desk.cpp +++ b/plugins/MacAU/Desk/Desk.cpp @@ -152,7 +152,7 @@ void Desk::DeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,35 +181,12 @@ void Desk::DeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; slew = inputSample - lastSample; @@ -245,11 +222,11 @@ void Desk::DeskKernel::Process( const Float32 *inSourceP, //drive section inputSample /= gain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Desk/Desk.h b/plugins/MacAU/Desk/Desk.h index 119399589..29f4bec76 100755 --- a/plugins/MacAU/Desk/Desk.h +++ b/plugins/MacAU/Desk/Desk.h @@ -117,10 +117,10 @@ public: virtual void Reset(); private: - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Desk4/Desk4.cpp b/plugins/MacAU/Desk4/Desk4.cpp index 1fbdca12c..36970b290 100755 --- a/plugins/MacAU/Desk4/Desk4.cpp +++ b/plugins/MacAU/Desk4/Desk4.cpp @@ -204,7 +204,7 @@ void Desk4::Desk4Kernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -219,7 +219,7 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,34 +248,11 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, Float64 combSample; Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -349,11 +326,11 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Desk4/Desk4.h b/plugins/MacAU/Desk4/Desk4.h index 8cd019328..7d51187c6 100755 --- a/plugins/MacAU/Desk4/Desk4.h +++ b/plugins/MacAU/Desk4/Desk4.h @@ -146,7 +146,7 @@ public: Float64 lastSample; Float64 lastOutSample; Float64 lastSlew; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/DigitalBlack/DigitalBlack.cpp b/plugins/MacAU/DigitalBlack/DigitalBlack.cpp index cd7f6b0b0..f851f9648 100755 --- a/plugins/MacAU/DigitalBlack/DigitalBlack.cpp +++ b/plugins/MacAU/DigitalBlack/DigitalBlack.cpp @@ -184,7 +184,7 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -193,9 +193,9 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (inputSample > 0) { if (WasNegative == true) ZeroCross = 0; @@ -218,7 +218,7 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, Float64 gate = 1.0; if (gateroller < 1.0) gate = gateroller; - long double bridgerectifier = 1-cos(fabs(inputSample)); + double bridgerectifier = 1-cos(fabs(inputSample)); if (inputSample > 0) inputSample = (inputSample*gate)+(bridgerectifier*(1-gate)); else inputSample = (inputSample*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/MacAU/Distance/Distance.cpp b/plugins/MacAU/Distance/Distance.cpp index 35c0a22b0..181a603e8 100755 --- a/plugins/MacAU/Distance/Distance.cpp +++ b/plugins/MacAU/Distance/Distance.cpp @@ -169,7 +169,7 @@ void Distance::DistanceKernel::Reset() { thirdresult = prevresult = lastclamp = clamp = change = last = 0.0; //just an example - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -207,30 +207,7 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -256,11 +233,11 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Distance/Distance.h b/plugins/MacAU/Distance/Distance.h index cade7a527..d1a626c7c 100755 --- a/plugins/MacAU/Distance/Distance.h +++ b/plugins/MacAU/Distance/Distance.h @@ -137,7 +137,7 @@ public: Float64 thirdresult; Float64 prevresult; Float64 last; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacAU/Distance2/Distance2.cpp b/plugins/MacAU/Distance2/Distance2.cpp index ddafb82f1..faab4d9ab 100755 --- a/plugins/MacAU/Distance2/Distance2.cpp +++ b/plugins/MacAU/Distance2/Distance2.cpp @@ -175,7 +175,7 @@ ComponentResult Distance2::Initialize() void Distance2::Distance2Kernel::Reset() { thirdSample = lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -246,34 +246,16 @@ void Distance2::Distance2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; double offset = offsetScale - (lastSample - inputSample); inputSample += (offset*offsetScale); //extra bit from Loud: offset air compression inputSample *= wet; //clean up w. dry introduced inputSample *= softslew; //scale into Atmosphere algorithm - long double clamp = inputSample - lastSampleA; + double clamp = inputSample - lastSampleA; if (clamp > thresholdA) inputSample = lastSampleA + thresholdA; if (-clamp > thresholdA) inputSample = lastSampleA - thresholdA; @@ -359,11 +341,11 @@ void Distance2::Distance2Kernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Distance2/Distance2.h b/plugins/MacAU/Distance2/Distance2.h index 91c471091..a630e52d4 100755 --- a/plugins/MacAU/Distance2/Distance2.h +++ b/plugins/MacAU/Distance2/Distance2.h @@ -131,37 +131,37 @@ public: virtual void Reset(); private: - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; Float64 thirdSample; Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Distance2/Ditherbox/Ditherbox.cpp b/plugins/MacAU/Distance2/Ditherbox/Ditherbox.cpp index 41929f061..1f926a456 100755 --- a/plugins/MacAU/Distance2/Ditherbox/Ditherbox.cpp +++ b/plugins/MacAU/Distance2/Ditherbox/Ditherbox.cpp @@ -273,31 +273,31 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double contingentRnd; - long double absSample; - long double contingent; - long double overallscale = 1.0; + double contingentRnd; + double absSample; + double contingent; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double inputSample; - long double outputSample; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double inputSample; + double outputSample; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 int dtype = (int) GetParameter( kParam_One ); // +1 for Reaper bug workaround bool highRes = false; bool dithering = true; @@ -311,30 +311,7 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Distance2/Ditherbox/Ditherbox.h b/plugins/MacAU/Distance2/Ditherbox/Ditherbox.h index 1e22c4d46..8833e7316 100755 --- a/plugins/MacAU/Distance2/Ditherbox/Ditherbox.h +++ b/plugins/MacAU/Distance2/Ditherbox/Ditherbox.h @@ -176,44 +176,44 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double contingentErr; + double byn[13]; + double noiseShaping; + double contingentErr; double currentDither; - long double NSOdd; - long double NSEven; - long double prev; - long double ns[16]; + double NSOdd; + double NSEven; + double prev; + double ns[16]; int Position; bool flip; - long double lastSample; - long double outSample; - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double iirSampleG; - long double iirSampleH; - long double iirSampleI; - long double iirSampleJ; - long double iirSampleK; - long double iirSampleL; - long double iirSampleM; - long double iirSampleN; - long double iirSampleO; - long double iirSampleP; - long double iirSampleQ; - long double iirSampleR; - long double iirSampleS; - long double iirSampleT; - long double iirSampleU; - long double iirSampleV; - long double iirSampleW; - long double iirSampleX; - long double iirSampleY; - long double iirSampleZ; + double lastSample; + double outSample; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; }; }; diff --git a/plugins/MacAU/Distortion/Distortion.cpp b/plugins/MacAU/Distortion/Distortion.cpp index f12c86a4f..d12c423b5 100755 --- a/plugins/MacAU/Distortion/Distortion.cpp +++ b/plugins/MacAU/Distortion/Distortion.cpp @@ -224,14 +224,14 @@ void Distortion::DistortionKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSample+previousIn[x])*0.5; previousIn[x] = inputSample; inputSample = temp; @@ -258,19 +258,19 @@ void Distortion::DistortionKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSample),4); + double dyno; dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy break; } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSample+previousOut[x])*0.5; previousOut[x] = inputSample; inputSample = temp; diff --git a/plugins/MacAU/Distortion/Distortion.h b/plugins/MacAU/Distortion/Distortion.h index e375682c1..49dd4b003 100755 --- a/plugins/MacAU/Distortion/Distortion.h +++ b/plugins/MacAU/Distortion/Distortion.h @@ -145,8 +145,8 @@ public: virtual void Reset(); private: - long double previousIn[9]; - long double previousOut[9]; + double previousIn[9]; + double previousOut[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/DitherFloat/DitherFloat.cpp b/plugins/MacAU/DitherFloat/DitherFloat.cpp index f03ca7622..47f58ab7f 100755 --- a/plugins/MacAU/DitherFloat/DitherFloat.cpp +++ b/plugins/MacAU/DitherFloat/DitherFloat.cpp @@ -180,14 +180,14 @@ void DitherFloat::DitherFloatKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int floatOffset = GetParameter( kParam_One ); - long double blend = GetParameter( kParam_Two ); + double blend = GetParameter( kParam_Two ); - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -229,7 +229,7 @@ void DitherFloat::DitherFloatKernel::Process( const Float32 *inSourceP, //gain *= gain; //for testing with double precision, 64 bit while (nSampleFrames-- > 0) { - long double inputSample = *sourceP + (gain-1); //this offsets the float into total truncation-land. + double inputSample = *sourceP + (gain-1); //this offsets the float into total truncation-land. diff --git a/plugins/MacAU/DitherMeDiskers/DitherMeDiskers.h b/plugins/MacAU/DitherMeDiskers/DitherMeDiskers.h index 3e835e5cb..61b1d97ab 100755 --- a/plugins/MacAU/DitherMeDiskers/DitherMeDiskers.h +++ b/plugins/MacAU/DitherMeDiskers/DitherMeDiskers.h @@ -116,7 +116,7 @@ public: virtual void Reset(); private: - long double noiseShaping; + double noiseShaping; Float64 lastSample; Float64 lastSample2; }; diff --git a/plugins/MacAU/DitherMeTimbers/DitherMeTimbers.h b/plugins/MacAU/DitherMeTimbers/DitherMeTimbers.h index abc959dc0..d14202f49 100755 --- a/plugins/MacAU/DitherMeTimbers/DitherMeTimbers.h +++ b/plugins/MacAU/DitherMeTimbers/DitherMeTimbers.h @@ -118,9 +118,9 @@ public: virtual void Reset(); private: - long double noiseShaping; - long double lastSample; - long double lastSample2; + double noiseShaping; + double lastSample; + double lastSample2; }; }; diff --git a/plugins/MacAU/Ditherbox/Ditherbox.cpp b/plugins/MacAU/Ditherbox/Ditherbox.cpp index 41929f061..1f926a456 100755 --- a/plugins/MacAU/Ditherbox/Ditherbox.cpp +++ b/plugins/MacAU/Ditherbox/Ditherbox.cpp @@ -273,31 +273,31 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double contingentRnd; - long double absSample; - long double contingent; - long double overallscale = 1.0; + double contingentRnd; + double absSample; + double contingent; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double inputSample; - long double outputSample; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double inputSample; + double outputSample; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 int dtype = (int) GetParameter( kParam_One ); // +1 for Reaper bug workaround bool highRes = false; bool dithering = true; @@ -311,30 +311,7 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Ditherbox/Ditherbox.h b/plugins/MacAU/Ditherbox/Ditherbox.h index 1e22c4d46..8833e7316 100755 --- a/plugins/MacAU/Ditherbox/Ditherbox.h +++ b/plugins/MacAU/Ditherbox/Ditherbox.h @@ -176,44 +176,44 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double contingentErr; + double byn[13]; + double noiseShaping; + double contingentErr; double currentDither; - long double NSOdd; - long double NSEven; - long double prev; - long double ns[16]; + double NSOdd; + double NSEven; + double prev; + double ns[16]; int Position; bool flip; - long double lastSample; - long double outSample; - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double iirSampleG; - long double iirSampleH; - long double iirSampleI; - long double iirSampleJ; - long double iirSampleK; - long double iirSampleL; - long double iirSampleM; - long double iirSampleN; - long double iirSampleO; - long double iirSampleP; - long double iirSampleQ; - long double iirSampleR; - long double iirSampleS; - long double iirSampleT; - long double iirSampleU; - long double iirSampleV; - long double iirSampleW; - long double iirSampleX; - long double iirSampleY; - long double iirSampleZ; + double lastSample; + double outSample; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; }; }; diff --git a/plugins/MacAU/DoublePaul/DoublePaul.cpp b/plugins/MacAU/DoublePaul/DoublePaul.cpp index 868e9761c..dcf7b6aab 100755 --- a/plugins/MacAU/DoublePaul/DoublePaul.cpp +++ b/plugins/MacAU/DoublePaul/DoublePaul.cpp @@ -170,30 +170,7 @@ void DoublePaul::DoublePaulKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacAU/Drive/Drive.cpp b/plugins/MacAU/Drive/Drive.cpp index ab3c0bc03..a8af16093 100755 --- a/plugins/MacAU/Drive/Drive.cpp +++ b/plugins/MacAU/Drive/Drive.cpp @@ -184,7 +184,7 @@ void Drive::DriveKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -221,30 +221,7 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (fpFlip) @@ -279,11 +256,11 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP, //number, we really don't want to meaninglessly multiply that by 1.0. fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Drive/Drive.h b/plugins/MacAU/Drive/Drive.h index 0e4af2a81..3dda14bde 100755 --- a/plugins/MacAU/Drive/Drive.h +++ b/plugins/MacAU/Drive/Drive.h @@ -139,7 +139,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/DrumSlam/DrumSlam.cpp b/plugins/MacAU/DrumSlam/DrumSlam.cpp index 8002edec2..4ca418121 100755 --- a/plugins/MacAU/DrumSlam/DrumSlam.cpp +++ b/plugins/MacAU/DrumSlam/DrumSlam.cpp @@ -183,7 +183,7 @@ void DrumSlam::DrumSlamKernel::Reset() iirSampleG = 0.0; iirSampleH = 0.0; lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -217,35 +217,12 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySample = inputSample; - long double lowSample; - long double midSample; - long double highSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double lowSample; + double midSample; + double highSample; inputSample *= drive; if (fpFlip) @@ -280,10 +257,10 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, highSample *= drive; midSample = midSample * drive; - long double skew = (midSample - lastSample); + double skew = (midSample - lastSample); lastSample = midSample; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -319,11 +296,11 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/DrumSlam/DrumSlam.h b/plugins/MacAU/DrumSlam/DrumSlam.h index 99d305805..70b9ce804 100755 --- a/plugins/MacAU/DrumSlam/DrumSlam.h +++ b/plugins/MacAU/DrumSlam/DrumSlam.h @@ -140,7 +140,7 @@ public: Float64 iirSampleG; Float64 iirSampleH; Float64 lastSample; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/DubCenter/DubCenter.cpp b/plugins/MacAU/DubCenter/DubCenter.cpp index 397d11855..64777be88 100755 --- a/plugins/MacAU/DubCenter/DubCenter.cpp +++ b/plugins/MacAU/DubCenter/DubCenter.cpp @@ -302,8 +302,8 @@ ComponentResult DubCenter::Reset(AudioUnitScope inScope, AudioUnitElement inEle oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -320,7 +320,7 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 driveone = pow(GetParameter( kParam_One )*3.0,2); @@ -352,8 +352,8 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float64 tempSample; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -390,8 +390,8 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -610,7 +610,7 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/DubCenter/DubCenter.h b/plugins/MacAU/DubCenter/DubCenter.h index 325a486c5..2fdc597f6 100755 --- a/plugins/MacAU/DubCenter/DubCenter.h +++ b/plugins/MacAU/DubCenter/DubCenter.h @@ -192,8 +192,8 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/DubSub/DubSub.cpp b/plugins/MacAU/DubSub/DubSub.cpp index 49a371b84..74048aa25 100755 --- a/plugins/MacAU/DubSub/DubSub.cpp +++ b/plugins/MacAU/DubSub/DubSub.cpp @@ -281,7 +281,7 @@ void DubSub::DubSubKernel::Reset() oscGate = 1.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -326,28 +326,10 @@ void DubSub::DubSubKernel::Process( const Float32 *inSourceP, Float64 tempSample; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; // here's the plan. // Grind Boost @@ -523,11 +505,11 @@ void DubSub::DubSubKernel::Process( const Float32 *inSourceP, bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/DubSub/DubSub.h b/plugins/MacAU/DubSub/DubSub.h index 43a046450..6cdbcc2f5 100755 --- a/plugins/MacAU/DubSub/DubSub.h +++ b/plugins/MacAU/DubSub/DubSub.h @@ -202,7 +202,7 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/DustBunny/DustBunny.cpp b/plugins/MacAU/DustBunny/DustBunny.cpp index 28418d405..ab5c187c1 100755 --- a/plugins/MacAU/DustBunny/DustBunny.cpp +++ b/plugins/MacAU/DustBunny/DustBunny.cpp @@ -164,7 +164,7 @@ void DustBunny::DustBunnyKernel::Reset() ataUpsampleHighTweak = 0.0414213562373095048801688; //more adds treble to upsampling ataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity ataFlip = false; //end reset of antialias parameters - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -186,30 +186,7 @@ void DustBunny::DustBunnyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample; @@ -242,11 +219,11 @@ void DustBunny::DustBunnyKernel::Process( const Float32 *inSourceP, ataPrevDiffSample = ataDiffSample / 2.0; //apply processing as difference to non-oversampled raw input - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacAU/DustBunny/DustBunny.h b/plugins/MacAU/DustBunny/DustBunny.h index ce73aa5bf..25658bcb3 100755 --- a/plugins/MacAU/DustBunny/DustBunny.h +++ b/plugins/MacAU/DustBunny/DustBunny.h @@ -140,7 +140,7 @@ public: Float32 ataDiffSample; Float32 ataPrevDiffSample; bool ataFlip; //end defining of antialiasing variables - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Dyno/Dyno.cpp b/plugins/MacAU/Dyno/Dyno.cpp index 6d744b61d..c20f02c4a 100755 --- a/plugins/MacAU/Dyno/Dyno.cpp +++ b/plugins/MacAU/Dyno/Dyno.cpp @@ -176,15 +176,15 @@ void Dyno::DynoKernel::Process( const Float32 *inSourceP, Float64 gain = pow(10.0,GetParameter( kParam_One )/20.0); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - //long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + //double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double dyno = pow(fabs(inputSample),4); + double dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy diff --git a/plugins/MacAU/EQ/EQ.cpp b/plugins/MacAU/EQ/EQ.cpp index 4b2d40be7..cf0bd0949 100755 --- a/plugins/MacAU/EQ/EQ.cpp +++ b/plugins/MacAU/EQ/EQ.cpp @@ -222,7 +222,7 @@ ComponentResult EQ::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void EQ::EQKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; iirHighSampleA = 0.0; iirHighSampleB = 0.0; @@ -321,30 +321,7 @@ void EQ::EQKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; last2Sample = lastSample; lastSample = inputSample; @@ -516,11 +493,11 @@ void EQ::EQKernel::Process( const Float32 *inSourceP, //built in output trim and dry/wet if desired if (outputgain != 1.0) inputSample *= outputgain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/EQ/EQ.h b/plugins/MacAU/EQ/EQ.h index a3b0194e2..5b9043fd0 100755 --- a/plugins/MacAU/EQ/EQ.h +++ b/plugins/MacAU/EQ/EQ.h @@ -197,7 +197,7 @@ public: Float64 lastSample; Float64 last2Sample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/EdIsDim/EdIsDim.cpp b/plugins/MacAU/EdIsDim/EdIsDim.cpp index e9d2e23e0..58cfcc236 100755 --- a/plugins/MacAU/EdIsDim/EdIsDim.cpp +++ b/plugins/MacAU/EdIsDim/EdIsDim.cpp @@ -171,8 +171,8 @@ ComponentResult EdIsDim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult EdIsDim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -192,10 +192,10 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 midgain = GetParameter( kParam_One ) * 2.0; Float64 sidegain = 2.0 - midgain; @@ -204,44 +204,8 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -251,7 +215,7 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/EdIsDim/EdIsDim.h b/plugins/MacAU/EdIsDim/EdIsDim.h index e5d5e46bf..4eb106785 100755 --- a/plugins/MacAU/EdIsDim/EdIsDim.h +++ b/plugins/MacAU/EdIsDim/EdIsDim.h @@ -111,8 +111,8 @@ public: virtual ComponentResult Version() { return kEdIsDimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacAU/Elation/Elation.cpp b/plugins/MacAU/Elation/Elation.cpp index 6af10381e..1656de88e 100755 --- a/plugins/MacAU/Elation/Elation.cpp +++ b/plugins/MacAU/Elation/Elation.cpp @@ -221,8 +221,8 @@ void Elation::ElationKernel::Process( const Float32 *inSourceP, Float64 outputSample; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample *= indrive; diff --git a/plugins/MacAU/ElectroHat/ElectroHat.cpp b/plugins/MacAU/ElectroHat/ElectroHat.cpp index cfdf411a2..7567b4708 100755 --- a/plugins/MacAU/ElectroHat/ElectroHat.cpp +++ b/plugins/MacAU/ElectroHat/ElectroHat.cpp @@ -214,7 +214,7 @@ void ElectroHat::ElectroHatKernel::Reset() tik = 3746926; lok = 0; flip = true; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -229,7 +229,7 @@ void ElectroHat::ElectroHatKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); bool highSample = false; @@ -312,11 +312,11 @@ void ElectroHat::ElectroHatKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //moving average combats that near-Nyquist stuff diff --git a/plugins/MacAU/Energy/Energy.cpp b/plugins/MacAU/Energy/Energy.cpp index 3e9d4cb96..99302f6a9 100755 --- a/plugins/MacAU/Energy/Energy.cpp +++ b/plugins/MacAU/Energy/Energy.cpp @@ -299,7 +299,7 @@ void Energy::EnergyKernel::Reset() PrevB = 0.0; PrevA = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -326,29 +326,11 @@ void Energy::EnergyKernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double correction = 0.0; + double correction = 0.0; duoFactor = PrevA - inputSample; if (flip) @@ -733,11 +715,11 @@ void Energy::EnergyKernel::Process( const Float32 *inSourceP, //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Energy/Energy.h b/plugins/MacAU/Energy/Energy.h index 62648f236..7eeaf7691 100755 --- a/plugins/MacAU/Energy/Energy.h +++ b/plugins/MacAU/Energy/Energy.h @@ -225,7 +225,7 @@ public: Float64 PrevB; Float64 PrevA; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Energy2/Energy2.cpp b/plugins/MacAU/Energy2/Energy2.cpp index 6bf52fce6..81e92c7bf 100644 --- a/plugins/MacAU/Energy2/Energy2.cpp +++ b/plugins/MacAU/Energy2/Energy2.cpp @@ -279,7 +279,7 @@ void Energy2::Energy2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -300,13 +300,13 @@ void Energy2::Energy2Kernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correction = 0.0; + double correction = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactor = PrevA - inputSample; diff --git a/plugins/MacAU/Energy2/Energy2.h b/plugins/MacAU/Energy2/Energy2.h index 2f59439fc..7266577b1 100644 --- a/plugins/MacAU/Energy2/Energy2.h +++ b/plugins/MacAU/Energy2/Energy2.h @@ -226,7 +226,7 @@ public: Float64 PrevB; Float64 PrevA; - long double lastRef[10]; + double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacAU/Ensemble/Ensemble.cpp b/plugins/MacAU/Ensemble/Ensemble.cpp index cdb1f4ca4..fedac6d3c 100755 --- a/plugins/MacAU/Ensemble/Ensemble.cpp +++ b/plugins/MacAU/Ensemble/Ensemble.cpp @@ -190,7 +190,7 @@ void Ensemble::EnsembleKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -228,7 +228,7 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, int count; int ensemble; Float64 temp; - long double inputSample; + double inputSample; Float64 drySample; //now we'll precalculate some stuff that needn't be in every sample @@ -242,30 +242,7 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -304,11 +281,11 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/Ensemble/Ensemble.h b/plugins/MacAU/Ensemble/Ensemble.h index af1c3aac2..08ce6ec37 100755 --- a/plugins/MacAU/Ensemble/Ensemble.h +++ b/plugins/MacAU/Ensemble/Ensemble.h @@ -143,7 +143,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/EveryTrim/EveryTrim.cpp b/plugins/MacAU/EveryTrim/EveryTrim.cpp index 550a23adf..4b31e467d 100755 --- a/plugins/MacAU/EveryTrim/EveryTrim.cpp +++ b/plugins/MacAU/EveryTrim/EveryTrim.cpp @@ -203,8 +203,8 @@ ComponentResult EveryTrim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult EveryTrim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -224,10 +224,10 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 leftgain = pow(10.0,GetParameter( kParam_One )/20.0); Float64 rightgain = pow(10.0,GetParameter( kParam_Two )/20.0); @@ -242,44 +242,8 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -291,7 +255,7 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/EveryTrim/EveryTrim.h b/plugins/MacAU/EveryTrim/EveryTrim.h index 58ffc7264..3aaa10b3c 100755 --- a/plugins/MacAU/EveryTrim/EveryTrim.h +++ b/plugins/MacAU/EveryTrim/EveryTrim.h @@ -121,8 +121,8 @@ public: virtual ComponentResult Version() { return kEveryTrimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/MacAU/Facet/Facet.cpp b/plugins/MacAU/Facet/Facet.cpp index 0da8d3316..150437c8b 100755 --- a/plugins/MacAU/Facet/Facet.cpp +++ b/plugins/MacAU/Facet/Facet.cpp @@ -177,8 +177,8 @@ void Facet::FacetKernel::Process( const Float32 *inSourceP, Float64 pos = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacAU/FathomFive/FathomFive.cpp b/plugins/MacAU/FathomFive/FathomFive.cpp index b2746ae7b..368d52a7c 100755 --- a/plugins/MacAU/FathomFive/FathomFive.cpp +++ b/plugins/MacAU/FathomFive/FathomFive.cpp @@ -188,7 +188,7 @@ void FathomFive::FathomFiveKernel::Reset() iirSampleB = 0.0; iirSampleC = 0.0; iirSampleD = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -218,30 +218,7 @@ void FathomFive::FathomFiveKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 0) @@ -277,7 +254,7 @@ void FathomFive::FathomFiveKernel::Process( const Float32 *inSourceP, //further ones work to rein in that DC offset issue. //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/FathomFive/FathomFive.h b/plugins/MacAU/FathomFive/FathomFive.h index 4d0b2f16f..ccb24a676 100755 --- a/plugins/MacAU/FathomFive/FathomFive.h +++ b/plugins/MacAU/FathomFive/FathomFive.h @@ -140,7 +140,7 @@ public: Float64 iirSampleB; Float64 iirSampleC; Float64 iirSampleD; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Floor/Floor.cpp b/plugins/MacAU/Floor/Floor.cpp index fefa12e61..000484334 100755 --- a/plugins/MacAU/Floor/Floor.cpp +++ b/plugins/MacAU/Floor/Floor.cpp @@ -185,7 +185,7 @@ void Floor::FloorKernel::Reset() iirSample2C = 0.0; iirSample2D = 0.0; iirSample2E = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,28 +221,10 @@ void Floor::FloorKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0-wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -346,11 +328,11 @@ void Floor::FloorKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Floor/Floor.h b/plugins/MacAU/Floor/Floor.h index 1645f9a1d..0389f291c 100755 --- a/plugins/MacAU/Floor/Floor.h +++ b/plugins/MacAU/Floor/Floor.h @@ -142,7 +142,7 @@ public: Float64 iirSample2C; Float64 iirSample2D; Float64 iirSample2E; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Focus/Focus.cpp b/plugins/MacAU/Focus/Focus.cpp index ecedc647c..78e899a3b 100755 --- a/plugins/MacAU/Focus/Focus.cpp +++ b/plugins/MacAU/Focus/Focus.cpp @@ -243,15 +243,15 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, figure[6] = (1.0 - K / figure[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * figure[2]) + figure[7]; + double tempSample = (inputSample * figure[2]) + figure[7]; figure[7] = -(tempSample * figure[5]) + figure[8]; figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); inputSample = tempSample; @@ -261,7 +261,7 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, inputSample = asin(inputSample); //decode Console5 - long double groundSample = drySample - inputSample; //set up UnBox + double groundSample = drySample - inputSample; //set up UnBox inputSample *= boost; //now, focussed area gets cranked before distort switch (mode) @@ -285,12 +285,12 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSample),4); + double dyno; dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy break; diff --git a/plugins/MacAU/Focus/Focus.h b/plugins/MacAU/Focus/Focus.h index 7103db84b..c24d74933 100755 --- a/plugins/MacAU/Focus/Focus.h +++ b/plugins/MacAU/Focus/Focus.h @@ -148,7 +148,7 @@ public: virtual void Reset(); private: - long double figure[9]; + double figure[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Fracture/Fracture.cpp b/plugins/MacAU/Fracture/Fracture.cpp index 481827052..33e5d1006 100755 --- a/plugins/MacAU/Fracture/Fracture.cpp +++ b/plugins/MacAU/Fracture/Fracture.cpp @@ -182,7 +182,7 @@ ComponentResult Fracture::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Fracture::FractureKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,30 +213,7 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -255,11 +232,11 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP, inputSample = (drySample * dry)+(inputSample*wet); //that simple. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Fracture/Fracture.h b/plugins/MacAU/Fracture/Fracture.h index 1dccb926e..b96b6f39f 100755 --- a/plugins/MacAU/Fracture/Fracture.h +++ b/plugins/MacAU/Fracture/Fracture.h @@ -134,7 +134,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/FromTape/FromTape.cpp b/plugins/MacAU/FromTape/FromTape.cpp index 30fe41a32..1bed28725 100755 --- a/plugins/MacAU/FromTape/FromTape.cpp +++ b/plugins/MacAU/FromTape/FromTape.cpp @@ -220,8 +220,7 @@ void FromTape::FromTapeKernel::Reset() iirSampleY = 0.0; iirSampleZ = 0.0; flip = 0; - //noisesource = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -256,34 +255,11 @@ void FromTape::FromTapeKernel::Process( const Float32 *inSourceP, Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -373,11 +349,11 @@ void FromTape::FromTapeKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/FromTape/FromTape.h b/plugins/MacAU/FromTape/FromTape.h index e9156d53b..926d70017 100755 --- a/plugins/MacAU/FromTape/FromTape.h +++ b/plugins/MacAU/FromTape/FromTape.h @@ -169,7 +169,7 @@ public: Float64 iirSampleZ; int flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Galactic/Galactic.cpp b/plugins/MacAU/Galactic/Galactic.cpp index 5f5b4da23..f63b8ee05 100644 --- a/plugins/MacAU/Galactic/Galactic.cpp +++ b/plugins/MacAU/Galactic/Galactic.cpp @@ -305,8 +305,8 @@ OSStatus Galactic::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag delayM = 256; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; diff --git a/plugins/MacAU/Gatelinked/Gatelinked.cpp b/plugins/MacAU/Gatelinked/Gatelinked.cpp index 641b64dec..0f5203fdf 100755 --- a/plugins/MacAU/Gatelinked/Gatelinked.cpp +++ b/plugins/MacAU/Gatelinked/Gatelinked.cpp @@ -216,8 +216,8 @@ ComponentResult Gatelinked::Reset(AudioUnitScope inScope, AudioUnitElement inEl treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -234,7 +234,7 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); //speed settings around release @@ -253,8 +253,8 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 highestSample; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -414,7 +414,7 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Gatelinked/Gatelinked.h b/plugins/MacAU/Gatelinked/Gatelinked.h index 1aecad135..a79e65342 100755 --- a/plugins/MacAU/Gatelinked/Gatelinked.h +++ b/plugins/MacAU/Gatelinked/Gatelinked.h @@ -131,8 +131,8 @@ public: Float64 treblefreq; Float64 bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + double fpNShapeL; + double fpNShapeR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/Gatelope/Gatelope.cpp b/plugins/MacAU/Gatelope/Gatelope.cpp index 3f6ed4e08..50311836e 100755 --- a/plugins/MacAU/Gatelope/Gatelope.cpp +++ b/plugins/MacAU/Gatelope/Gatelope.cpp @@ -197,7 +197,7 @@ void Gatelope::GatelopeKernel::Reset() treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -212,7 +212,7 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); //speed settings around release @@ -230,27 +230,9 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, Float64 attackSpeed; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; attackSpeed = slowAttack - (fabs(inputSample)*slowAttack*0.5); @@ -334,11 +316,11 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Gatelope/Gatelope.h b/plugins/MacAU/Gatelope/Gatelope.h index e2ecc0b1f..34d3f3d10 100755 --- a/plugins/MacAU/Gatelope/Gatelope.h +++ b/plugins/MacAU/Gatelope/Gatelope.h @@ -143,7 +143,7 @@ public: Float64 treblefreq; Float64 bassfreq; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/GlitchShifter/GlitchShifter.cpp b/plugins/MacAU/GlitchShifter/GlitchShifter.cpp index 656786e0c..825d5b180 100755 --- a/plugins/MacAU/GlitchShifter/GlitchShifter.cpp +++ b/plugins/MacAU/GlitchShifter/GlitchShifter.cpp @@ -235,8 +235,8 @@ void GlitchShifter::GlitchShifterKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; airFactor = airPrev - inputSample; if (flip) {airEven += airFactor; airOdd -= airFactor; airFactor = airEven;} diff --git a/plugins/MacAU/Golem/Golem.cpp b/plugins/MacAU/Golem/Golem.cpp index e6f1566ce..62d15ca75 100755 --- a/plugins/MacAU/Golem/Golem.cpp +++ b/plugins/MacAU/Golem/Golem.cpp @@ -210,8 +210,8 @@ ComponentResult Golem::Reset(AudioUnitScope inScope, AudioUnitElement inElement { for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -249,50 +249,14 @@ OSStatus Golem::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, int far = near + 1; Float64 nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -329,7 +293,7 @@ OSStatus Golem::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Golem/Golem.h b/plugins/MacAU/Golem/Golem.h index d66b91f8e..8de93792b 100755 --- a/plugins/MacAU/Golem/Golem.h +++ b/plugins/MacAU/Golem/Golem.h @@ -132,8 +132,8 @@ public: private: Float64 p[4099]; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/Gringer/Gringer.cpp b/plugins/MacAU/Gringer/Gringer.cpp index 4ed98942b..8777ac81a 100755 --- a/plugins/MacAU/Gringer/Gringer.cpp +++ b/plugins/MacAU/Gringer/Gringer.cpp @@ -166,7 +166,7 @@ void Gringer::GringerKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); inband[0] = 0.025/overallscale; @@ -190,13 +190,13 @@ void Gringer::GringerKernel::Process( const Float32 *inSourceP, outband[6] = (1.0 - K / outband[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * inband[2]) + inband[7]; + double tempSample = (inputSample * inband[2]) + inband[7]; inband[7] = -(tempSample * inband[5]) + inband[8]; inband[8] = (inputSample * inband[4]) - (tempSample * inband[6]); diff --git a/plugins/MacAU/Gringer/Gringer.h b/plugins/MacAU/Gringer/Gringer.h index 921cf0aaf..82eca4178 100755 --- a/plugins/MacAU/Gringer/Gringer.h +++ b/plugins/MacAU/Gringer/Gringer.h @@ -120,8 +120,8 @@ public: virtual void Reset(); private: - long double inband[9]; - long double outband[9]; + double inband[9]; + double outband[9]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/GrooveWear/GrooveWear.cpp b/plugins/MacAU/GrooveWear/GrooveWear.cpp index 62c963499..86bb9c8ea 100755 --- a/plugins/MacAU/GrooveWear/GrooveWear.cpp +++ b/plugins/MacAU/GrooveWear/GrooveWear.cpp @@ -177,7 +177,7 @@ void GrooveWear::GrooveWearKernel::Reset() bMidPrev = 0.0; cMidPrev = 0.0; dMidPrev = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,36 +269,13 @@ void GrooveWear::GrooveWearKernel::Process( const Float32 *inSourceP, Float64 dDry = 1.0 - dWet; Float64 drySample; - long double inputSample; + double inputSample; Float64 accumulatorSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (aWet > 0.0) { @@ -444,11 +421,11 @@ void GrooveWear::GrooveWearKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * dWet) + (drySample * dDry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/GrooveWear/GrooveWear.h b/plugins/MacAU/GrooveWear/GrooveWear.h index 5f86da892..315b8c765 100755 --- a/plugins/MacAU/GrooveWear/GrooveWear.h +++ b/plugins/MacAU/GrooveWear/GrooveWear.h @@ -138,7 +138,7 @@ public: Float64 cMidPrev; Float64 dMidPrev; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/GuitarConditioner/GuitarConditioner.cpp b/plugins/MacAU/GuitarConditioner/GuitarConditioner.cpp index d3d23e66d..5c8e4b2fc 100755 --- a/plugins/MacAU/GuitarConditioner/GuitarConditioner.cpp +++ b/plugins/MacAU/GuitarConditioner/GuitarConditioner.cpp @@ -150,7 +150,7 @@ ComponentResult GuitarConditioner::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void GuitarConditioner::GuitarConditionerKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; lastSampleT = 0.0; lastSampleB = 0.0; //for Slews. T for treble, B for bass @@ -172,12 +172,12 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double treble; - long double bass; + double inputSample; + double treble; + double bass; Float64 iirTreble = 0.287496/overallscale; //tight is -1 Float64 iirBass = 0.085184/overallscale; //tight is 1 iirTreble += iirTreble; @@ -192,30 +192,7 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; treble = bass = inputSample; @@ -262,11 +239,11 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou inputSample = treble + bass; //final merge fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; destP += inNumChannels; diff --git a/plugins/MacAU/GuitarConditioner/GuitarConditioner.h b/plugins/MacAU/GuitarConditioner/GuitarConditioner.h index 4ad66691a..461f7db1d 100755 --- a/plugins/MacAU/GuitarConditioner/GuitarConditioner.h +++ b/plugins/MacAU/GuitarConditioner/GuitarConditioner.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; bool fpFlip; Float64 lastSampleT; Float64 lastSampleB; //for Slews diff --git a/plugins/MacAU/HardVacuum/HardVacuum.cpp b/plugins/MacAU/HardVacuum/HardVacuum.cpp index d65243138..86b8ed173 100755 --- a/plugins/MacAU/HardVacuum/HardVacuum.cpp +++ b/plugins/MacAU/HardVacuum/HardVacuum.cpp @@ -191,7 +191,7 @@ ComponentResult HardVacuum::Initialize() void HardVacuum::HardVacuumKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -222,35 +222,12 @@ void HardVacuum::HardVacuumKernel::Process( const Float32 *inSourceP, Float64 negative; Float64 bridgerectifier; Float64 skew; - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; skew = (inputSample - lastSample); @@ -314,11 +291,11 @@ void HardVacuum::HardVacuumKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/HardVacuum/HardVacuum.h b/plugins/MacAU/HardVacuum/HardVacuum.h index b5b4116a9..42a1ffe04 100755 --- a/plugins/MacAU/HardVacuum/HardVacuum.h +++ b/plugins/MacAU/HardVacuum/HardVacuum.h @@ -139,7 +139,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/HermeTrim/HermeTrim.cpp b/plugins/MacAU/HermeTrim/HermeTrim.cpp index d66c78c95..91d6c74c4 100755 --- a/plugins/MacAU/HermeTrim/HermeTrim.cpp +++ b/plugins/MacAU/HermeTrim/HermeTrim.cpp @@ -203,8 +203,8 @@ ComponentResult HermeTrim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult HermeTrim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -224,10 +224,10 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 leftgain = pow(10.0,GetParameter( kParam_One )/20.0); Float64 rightgain = pow(10.0,GetParameter( kParam_Two )/20.0); @@ -242,44 +242,8 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -291,7 +255,7 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/HermeTrim/HermeTrim.h b/plugins/MacAU/HermeTrim/HermeTrim.h index 28ed59989..da24fea06 100755 --- a/plugins/MacAU/HermeTrim/HermeTrim.h +++ b/plugins/MacAU/HermeTrim/HermeTrim.h @@ -121,8 +121,8 @@ public: virtual ComponentResult Version() { return kHermeTrimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacAU/Hermepass/Hermepass.cpp b/plugins/MacAU/Hermepass/Hermepass.cpp index c9697199a..f9378c95b 100755 --- a/plugins/MacAU/Hermepass/Hermepass.cpp +++ b/plugins/MacAU/Hermepass/Hermepass.cpp @@ -174,7 +174,7 @@ void Hermepass::HermepassKernel::Reset() iirF = 0.0; iirG = 0.0; iirH = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -190,11 +190,11 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 rangescale = 0.1 / overallscale; @@ -241,36 +241,13 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSample; + double inputSample; Float64 tempSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; tempSample = inputSample; if (fpFlip) { @@ -301,11 +278,11 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, inputSample -= correction; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Hermepass/Hermepass.h b/plugins/MacAU/Hermepass/Hermepass.h index 3483edc52..56b4c4a5f 100755 --- a/plugins/MacAU/Hermepass/Hermepass.h +++ b/plugins/MacAU/Hermepass/Hermepass.h @@ -139,7 +139,7 @@ public: Float64 iirH; //seven poles max, and the final pole is always at 20hz directly. - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/HighGlossDither/HighGlossDither.cpp b/plugins/MacAU/HighGlossDither/HighGlossDither.cpp index 0d3b7fb77..472508f6e 100755 --- a/plugins/MacAU/HighGlossDither/HighGlossDither.cpp +++ b/plugins/MacAU/HighGlossDither/HighGlossDither.cpp @@ -167,35 +167,12 @@ void HighGlossDither::HighGlossDitherKernel::Process( const Float32 *inSourceP const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; int hotbinA; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacAU/HighImpact/HighImpact.cpp b/plugins/MacAU/HighImpact/HighImpact.cpp index 43ca1f54b..40eee1899 100755 --- a/plugins/MacAU/HighImpact/HighImpact.cpp +++ b/plugins/MacAU/HighImpact/HighImpact.cpp @@ -175,7 +175,7 @@ ComponentResult HighImpact::Initialize() void HighImpact::HighImpactKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -205,30 +205,7 @@ void HighImpact::HighImpactKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -273,11 +250,11 @@ void HighImpact::HighImpactKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Highpass/Highpass.cpp b/plugins/MacAU/Highpass/Highpass.cpp index 095a5fd69..083633dbc 100755 --- a/plugins/MacAU/Highpass/Highpass.cpp +++ b/plugins/MacAU/Highpass/Highpass.cpp @@ -175,7 +175,7 @@ void Highpass::HighpassKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -218,30 +218,7 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -262,11 +239,11 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP, if (wet < 1.0) outputSample = (outputSample * wet) + (inputSample * dry); fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = outputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Highpass/Highpass.h b/plugins/MacAU/Highpass/Highpass.h index d29dcf95c..87591e997 100755 --- a/plugins/MacAU/Highpass/Highpass.h +++ b/plugins/MacAU/Highpass/Highpass.h @@ -136,7 +136,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/Highpass2/Highpass2.cpp b/plugins/MacAU/Highpass2/Highpass2.cpp index fb9b98f74..e2a1f5d06 100755 --- a/plugins/MacAU/Highpass2/Highpass2.cpp +++ b/plugins/MacAU/Highpass2/Highpass2.cpp @@ -228,28 +228,10 @@ void Highpass2::Highpass2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); else offset = (1 + tight) + ((1-fabs(inputSample))*tight); diff --git a/plugins/MacAU/Holt/Holt.cpp b/plugins/MacAU/Holt/Holt.cpp index 68ea17d85..4ab765b38 100755 --- a/plugins/MacAU/Holt/Holt.cpp +++ b/plugins/MacAU/Holt/Holt.cpp @@ -220,8 +220,8 @@ void Holt::HoltKernel::Process( const Float32 *inSourceP, alpha += ((1.0-beta)*pow(GetParameter( kParam_One ),3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times Float64 aWet = 1.0; Float64 bWet = 1.0; @@ -241,10 +241,10 @@ void Holt::HoltKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (aWet > 0.0) { trend = (beta * (inputSample - previousSampleA) + ((0.999-beta) * previousTrendA)); diff --git a/plugins/MacAU/Holt/Holt.h b/plugins/MacAU/Holt/Holt.h index ae955b069..11ffa2d1f 100755 --- a/plugins/MacAU/Holt/Holt.h +++ b/plugins/MacAU/Holt/Holt.h @@ -137,14 +137,14 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousTrendA; - long double previousSampleB; - long double previousTrendB; - long double previousSampleC; - long double previousTrendC; - long double previousSampleD; - long double previousTrendD; + double previousSampleA; + double previousTrendA; + double previousSampleB; + double previousTrendB; + double previousSampleC; + double previousTrendC; + double previousSampleD; + double previousTrendD; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Hombre/Hombre.cpp b/plugins/MacAU/Hombre/Hombre.cpp index 420afa5c9..9931eb87b 100755 --- a/plugins/MacAU/Hombre/Hombre.cpp +++ b/plugins/MacAU/Hombre/Hombre.cpp @@ -169,7 +169,7 @@ void Hombre::HombreKernel::Reset() for(int count = 0; count < 4000; count++) {p[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -194,37 +194,14 @@ void Hombre::HombreKernel::Process( const Float32 *inSourceP, int widthB = (int)(7.0*overallscale); //max 364 at 44.1, 792 at 96K Float64 wet = GetParameter( kParam_Two ); Float64 dry = 1.0 - wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 total; int count; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; slide = (slide * 0.9997)+(target*0.0003); @@ -266,11 +243,11 @@ void Hombre::HombreKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Hombre/Hombre.h b/plugins/MacAU/Hombre/Hombre.h index 0f2225b5d..517e88d9d 100755 --- a/plugins/MacAU/Hombre/Hombre.h +++ b/plugins/MacAU/Hombre/Hombre.h @@ -131,7 +131,7 @@ public: Float64 p[4001]; Float64 slide; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Hull/Hull.cpp b/plugins/MacAU/Hull/Hull.cpp index a06375a32..5256c9aac 100644 --- a/plugins/MacAU/Hull/Hull.cpp +++ b/plugins/MacAU/Hull/Hull.cpp @@ -185,31 +185,31 @@ void Hull::HullKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 96000.0; overallscale *= GetSampleRate(); //this one's scaled to 96k for the deepest bass if (overallscale > 1.0) overallscale = 1.0; //and if you go for 192k, rather than crash //it just cuts out the maximum (2000) depth of averaging you can get Float64 hullSetting = pow(GetParameter( kParam_One ),3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; Float64 wet = -GetParameter( kParam_Two ); //functions as dark/bright while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; bPointer--; if (bPointer < 0) bPointer += 2000; b[bPointer] = b[bPointer+2000] = inputSample; int x = bPointer; - long double longAverage = 0.0; - long double shortAverage = 0.0; + double longAverage = 0.0; + double shortAverage = 0.0; while (x < bPointer+limitB) { shortAverage += b[x]; longAverage += b[x]; @@ -227,7 +227,7 @@ void Hull::HullKernel::Process( const Float32 *inSourceP, c[cPointer] = c[cPointer+50] = shortAverage+(shortAverage-longAverage); x = cPointer; - long double shortestAverage = 0.0; + double shortestAverage = 0.0; while (x < cPointer+limitC) { shortestAverage += c[x]; x++; diff --git a/plugins/MacAU/Hull/Hull.h b/plugins/MacAU/Hull/Hull.h index 7436017c7..e8746c157 100644 --- a/plugins/MacAU/Hull/Hull.h +++ b/plugins/MacAU/Hull/Hull.h @@ -127,9 +127,9 @@ public: virtual void Reset(); private: - long double b[4005]; + double b[4005]; int bPointer; - long double c[105]; + double c[105]; int cPointer; uint32_t fpd; }; diff --git a/plugins/MacAU/Infinity/Infinity.cpp b/plugins/MacAU/Infinity/Infinity.cpp index 06abef788..76f2da8e3 100755 --- a/plugins/MacAU/Infinity/Infinity.cpp +++ b/plugins/MacAU/Infinity/Infinity.cpp @@ -291,11 +291,11 @@ void Infinity::InfinityKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -303,10 +303,10 @@ void Infinity::InfinityKernel::Process( const Float32 *inSourceP, //we're going to use this as a kind of balance since the reverb buildup can be so large inputSample *= 0.5; - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} diff --git a/plugins/MacAU/Infinity/Infinity.h b/plugins/MacAU/Infinity/Infinity.h index 8fe50533b..f18d4ce5f 100755 --- a/plugins/MacAU/Infinity/Infinity.h +++ b/plugins/MacAU/Infinity/Infinity.h @@ -133,9 +133,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacAU/Infinity2/Infinity2.cpp b/plugins/MacAU/Infinity2/Infinity2.cpp index 55b363289..212588f88 100644 --- a/plugins/MacAU/Infinity2/Infinity2.cpp +++ b/plugins/MacAU/Infinity2/Infinity2.cpp @@ -306,18 +306,18 @@ void Infinity2::Infinity2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} diff --git a/plugins/MacAU/Infinity2/Infinity2.h b/plugins/MacAU/Infinity2/Infinity2.h index c9f9d957e..71c2852dd 100644 --- a/plugins/MacAU/Infinity2/Infinity2.h +++ b/plugins/MacAU/Infinity2/Infinity2.h @@ -140,9 +140,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacAU/Infrasonic/Infrasonic.cpp b/plugins/MacAU/Infrasonic/Infrasonic.cpp index bbb17bb43..287fddff2 100755 --- a/plugins/MacAU/Infrasonic/Infrasonic.cpp +++ b/plugins/MacAU/Infrasonic/Infrasonic.cpp @@ -215,10 +215,10 @@ void Infrasonic::InfrasonicKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Infrasonic/Infrasonic.h b/plugins/MacAU/Infrasonic/Infrasonic.h index 76788591c..3a1601a87 100755 --- a/plugins/MacAU/Infrasonic/Infrasonic.h +++ b/plugins/MacAU/Infrasonic/Infrasonic.h @@ -118,11 +118,11 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Interstage/Interstage.cpp b/plugins/MacAU/Interstage/Interstage.cpp index 969fdcbde..59f198b83 100755 --- a/plugins/MacAU/Interstage/Interstage.cpp +++ b/plugins/MacAU/Interstage/Interstage.cpp @@ -173,7 +173,7 @@ void Interstage::InterstageKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -182,9 +182,9 @@ void Interstage::InterstageKernel::Process( const Float32 *inSourceP, Float64 threshold = 0.381966011250105; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = (inputSample+lastSample)*0.5; //start the lowpassing with an average diff --git a/plugins/MacAU/Interstage/Interstage.h b/plugins/MacAU/Interstage/Interstage.h index d1cdd2d73..be12dd469 100755 --- a/plugins/MacAU/Interstage/Interstage.h +++ b/plugins/MacAU/Interstage/Interstage.h @@ -125,7 +125,7 @@ public: Float64 iirSampleD; Float64 iirSampleE; Float64 iirSampleF; - long double lastSample; + double lastSample; uint32_t fpd; bool flip; }; diff --git a/plugins/MacAU/IronOxide5/IronOxide5.cpp b/plugins/MacAU/IronOxide5/IronOxide5.cpp index c64d19ac7..b18a72748 100755 --- a/plugins/MacAU/IronOxide5/IronOxide5.cpp +++ b/plugins/MacAU/IronOxide5/IronOxide5.cpp @@ -224,7 +224,7 @@ void IronOxide5::IronOxide5Kernel::Reset() sweep = 0.0; rateof = 0.5; nextmax = 0.5; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -257,7 +257,7 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, Float64 fastTaper = ips/15.0; Float64 slowTaper = 2.0/(lps*lps); Float64 lowspeedscale = (5.0/ips); - long double inputSample; + double inputSample; Float64 drySample; SInt32 count; SInt32 flutcount; @@ -288,30 +288,7 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; flutterrandy = (rand()/(double)RAND_MAX); @@ -477,11 +454,11 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, if (fabs(drySample) > 0.0) inputSample += drySample; //end invdrywet block with outputgain - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/IronOxide5/IronOxide5.h b/plugins/MacAU/IronOxide5/IronOxide5.h index 2b3c655d4..3353a8004 100755 --- a/plugins/MacAU/IronOxide5/IronOxide5.h +++ b/plugins/MacAU/IronOxide5/IronOxide5.h @@ -167,7 +167,7 @@ public: Float64 rateof; Float64 sweep; Float64 nextmax; - long double fpNShape; + uint32_t fpd; bool flip; }; }; diff --git a/plugins/MacAU/IronOxideClassic/IronOxideClassic.cpp b/plugins/MacAU/IronOxideClassic/IronOxideClassic.cpp index 4bd736fbc..a5d004ac3 100755 --- a/plugins/MacAU/IronOxideClassic/IronOxideClassic.cpp +++ b/plugins/MacAU/IronOxideClassic/IronOxideClassic.cpp @@ -180,7 +180,7 @@ void IronOxideClassic::IronOxideClassicKernel::Reset() gcount = 0; fastIIRA = fastIIRB = slowIIRA = slowIIRB = 0.0; iirSampleA = iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -208,7 +208,7 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc Float64 fastTaper = ips/15.0; Float64 slowTaper = 2.0/(ips*ips); Float64 lowspeedscale = (5.0/ips); - long double inputSample; + double inputSample; SInt32 count; Float64 temp; Float64 overallscale = 1.0; @@ -225,30 +225,7 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fpFlip) { @@ -381,11 +358,11 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc if (outputgain != 1.0) inputSample *= outputgain; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/IronOxideClassic/IronOxideClassic.h b/plugins/MacAU/IronOxideClassic/IronOxideClassic.h index 4dfe41be6..6d9bb949a 100755 --- a/plugins/MacAU/IronOxideClassic/IronOxideClassic.h +++ b/plugins/MacAU/IronOxideClassic/IronOxideClassic.h @@ -142,7 +142,7 @@ public: Float64 slowIIRB; SInt32 gcount; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.cpp b/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.cpp index 7e0e79bca..a2956da98 100755 --- a/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.cpp +++ b/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.cpp @@ -199,7 +199,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -250,8 +250,8 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -268,14 +268,14 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou //do IIR highpass for leaning out if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } if (inputgain != 1.0) inputSample *= inputgain; - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSample > 0.0) inputSample = bridgerectifier; @@ -288,7 +288,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou int count = gcount; //increment the counter - long double temp; + double temp; d[count+131] = d[count] = inputSample; if (flip) @@ -424,7 +424,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou //second stage of overdrive to prevent overs and allow bloody loud extremeness if (biquadB[0] < 0.49999) { - long double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; + double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSample; inputSample = tempSample; biquadB[10] = biquadB[9]; biquadB[9] = inputSample; //DF1 } diff --git a/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.h b/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.h index 319114d2c..d4fa13f74 100755 --- a/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.h +++ b/plugins/MacAU/IronOxideClassic2/IronOxideClassic2.h @@ -133,8 +133,8 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; Float64 iirSampleA; Float64 iirSampleB; Float64 d[264]; diff --git a/plugins/MacAU/Isolator/Isolator.cpp b/plugins/MacAU/Isolator/Isolator.cpp index 212f7f913..02fd58787 100755 --- a/plugins/MacAU/Isolator/Isolator.cpp +++ b/plugins/MacAU/Isolator/Isolator.cpp @@ -190,7 +190,7 @@ void Isolator::IsolatorKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -237,14 +237,14 @@ void Isolator::IsolatorKernel::Process( const Float32 *inSourceP, // but I would suggest subtracting the lowpass from dry while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Isolator/Isolator.h b/plugins/MacAU/Isolator/Isolator.h index 7f8d575ad..821e02161 100755 --- a/plugins/MacAU/Isolator/Isolator.h +++ b/plugins/MacAU/Isolator/Isolator.h @@ -131,9 +131,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Isolator2/Isolator2.cpp b/plugins/MacAU/Isolator2/Isolator2.cpp index 9f39e8489..79fc6eb82 100644 --- a/plugins/MacAU/Isolator2/Isolator2.cpp +++ b/plugins/MacAU/Isolator2/Isolator2.cpp @@ -341,7 +341,7 @@ void Isolator2::Isolator2Kernel::Process( const Float32 *inSourceP, if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); diff --git a/plugins/MacAU/Logical4/Logical4.cpp b/plugins/MacAU/Logical4/Logical4.cpp index af228c2bd..98eff2921 100755 --- a/plugins/MacAU/Logical4/Logical4.cpp +++ b/plugins/MacAU/Logical4/Logical4.cpp @@ -268,8 +268,8 @@ ComponentResult Logical4::Reset(AudioUnitScope inScope, AudioUnitElement inElem //end Power Sags - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; return noErr; } @@ -296,11 +296,11 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 drySampleL; Float32 drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; //begin ButterComp Float64 inputpos; @@ -395,44 +395,8 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables like the dry - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1148,7 +1112,7 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Logical4/Logical4.h b/plugins/MacAU/Logical4/Logical4.h index 31b3c1ae2..baa5e4c1d 100755 --- a/plugins/MacAU/Logical4/Logical4.h +++ b/plugins/MacAU/Logical4/Logical4.h @@ -210,8 +210,8 @@ private: int gcount; - long double fpNShapeR; - long double fpNShapeL; + double fpNShapeR; + double fpNShapeL; bool fpFlip; }; diff --git a/plugins/MacAU/Loud/Loud.cpp b/plugins/MacAU/Loud/Loud.cpp index 69b15940f..1debb959f 100755 --- a/plugins/MacAU/Loud/Loud.cpp +++ b/plugins/MacAU/Loud/Loud.cpp @@ -199,13 +199,13 @@ void Loud::LoudKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 clamp; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= boost; diff --git a/plugins/MacAU/Lowpass/Lowpass.cpp b/plugins/MacAU/Lowpass/Lowpass.cpp index f727829ba..2f1119a65 100755 --- a/plugins/MacAU/Lowpass/Lowpass.cpp +++ b/plugins/MacAU/Lowpass/Lowpass.cpp @@ -176,7 +176,7 @@ void Lowpass::LowpassKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -216,30 +216,7 @@ void Lowpass::LowpassKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -260,11 +237,11 @@ void Lowpass::LowpassKernel::Process( const Float32 *inSourceP, if (wet < 1.0) outputSample = (outputSample * wet) + (inputSample * dry); fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = outputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/Lowpass/Lowpass.h b/plugins/MacAU/Lowpass/Lowpass.h index cf12e7542..b07871041 100755 --- a/plugins/MacAU/Lowpass/Lowpass.h +++ b/plugins/MacAU/Lowpass/Lowpass.h @@ -133,7 +133,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/Lowpass2/Lowpass2.cpp b/plugins/MacAU/Lowpass2/Lowpass2.cpp index 9948a6c4f..628779392 100755 --- a/plugins/MacAU/Lowpass2/Lowpass2.cpp +++ b/plugins/MacAU/Lowpass2/Lowpass2.cpp @@ -228,28 +228,10 @@ void Lowpass2::Lowpass2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); else offset = (1 + tight) + ((1-fabs(inputSample))*tight); diff --git a/plugins/MacAU/Luxor/Luxor.cpp b/plugins/MacAU/Luxor/Luxor.cpp index 987f3fdf0..5400f8293 100755 --- a/plugins/MacAU/Luxor/Luxor.cpp +++ b/plugins/MacAU/Luxor/Luxor.cpp @@ -221,8 +221,8 @@ void Luxor::LuxorKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacAU/MV/MV.cpp b/plugins/MacAU/MV/MV.cpp index 25c62b289..0aa891bd4 100755 --- a/plugins/MacAU/MV/MV.cpp +++ b/plugins/MacAU/MV/MV.cpp @@ -278,27 +278,9 @@ void MV::MVKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample += feedback; diff --git a/plugins/MacAU/MackEQ/MackEQ.cpp b/plugins/MacAU/MackEQ/MackEQ.cpp index faa51f406..127b7b2b1 100644 --- a/plugins/MacAU/MackEQ/MackEQ.cpp +++ b/plugins/MacAU/MackEQ/MackEQ.cpp @@ -212,7 +212,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -270,8 +270,8 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, biquadD[6] = (1.0 - K / biquadD[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (fabs(iirSampleA)<1.18e-37) iirSampleA = 0.0; @@ -281,7 +281,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (inTrim != 1.0) inputSample *= inTrim; //begin Mackity input stage - long double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = outSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; @@ -300,8 +300,8 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (fabs(iirSampleC)<1.18e-37) iirSampleC = 0.0; iirSampleC = (iirSampleC * (1.0 - iirBassMid)) + (inputSample * iirBassMid); - long double bassSample = iirSampleC; - long double midSample = inputSample - bassSample; + double bassSample = iirSampleC; + double midSample = inputSample - bassSample; if (gainBass != 1.0) bassSample *= gainBass; if (bassSample > 1.0) bassSample = 1.0; @@ -317,7 +317,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (fabs(iirSampleE)<1.18e-37) iirSampleE = 0.0; iirSampleE = (iirSampleE * (1.0 - iirMidHigh)) + (midSample * iirMidHigh); - long double highSample = midSample - iirSampleE; + double highSample = midSample - iirSampleE; midSample = iirSampleE; //here is where we make the high sample out of the mid, and take highs //away from the mid. diff --git a/plugins/MacAU/MackEQ/MackEQ.h b/plugins/MacAU/MackEQ/MackEQ.h index 60480a136..23475e60e 100644 --- a/plugins/MacAU/MackEQ/MackEQ.h +++ b/plugins/MacAU/MackEQ/MackEQ.h @@ -137,16 +137,16 @@ public: private: - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Mackity/Mackity.cpp b/plugins/MacAU/Mackity/Mackity.cpp index f5aedb191..8a05bc5d1 100644 --- a/plugins/MacAU/Mackity/Mackity.cpp +++ b/plugins/MacAU/Mackity/Mackity.cpp @@ -184,7 +184,7 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -216,8 +216,8 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fabs(iirSampleA)<1.18e-37) iirSampleA = 0.0; iirSampleA = (iirSampleA * (1.0 - iirAmountA)) + (inputSample * iirAmountA); @@ -225,7 +225,7 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, if (inTrim != 1.0) inputSample *= inTrim; - long double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = outSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; diff --git a/plugins/MacAU/Mackity/Mackity.h b/plugins/MacAU/Mackity/Mackity.h index 43d72da51..f54f5f027 100644 --- a/plugins/MacAU/Mackity/Mackity.h +++ b/plugins/MacAU/Mackity/Mackity.h @@ -128,10 +128,10 @@ public: virtual void Reset(); private: - long double iirSampleA; - long double iirSampleB; - long double biquadA[11]; - long double biquadB[11]; + double iirSampleA; + double iirSampleB; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; diff --git a/plugins/MacAU/MatrixVerb/MatrixVerb.cpp b/plugins/MacAU/MatrixVerb/MatrixVerb.cpp index f7251bd39..a4d6bffcc 100755 --- a/plugins/MacAU/MatrixVerb/MatrixVerb.cpp +++ b/plugins/MacAU/MatrixVerb/MatrixVerb.cpp @@ -283,7 +283,7 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -345,8 +345,8 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, //predelay for natural spaces, gets cut back for heavily artificial spaces while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; aM[countM] = inputSample; @@ -354,7 +354,7 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, inputSample = aM[countM]; //predelay - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -363,10 +363,10 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; diff --git a/plugins/MacAU/MatrixVerb/MatrixVerb.h b/plugins/MacAU/MatrixVerb/MatrixVerb.h index ec76d2829..d2c7ff0f1 100755 --- a/plugins/MacAU/MatrixVerb/MatrixVerb.h +++ b/plugins/MacAU/MatrixVerb/MatrixVerb.h @@ -142,9 +142,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacAU/Melt/Melt.cpp b/plugins/MacAU/Melt/Melt.cpp index eaca93d12..c89bd6423 100755 --- a/plugins/MacAU/Melt/Melt.cpp +++ b/plugins/MacAU/Melt/Melt.cpp @@ -189,7 +189,7 @@ void Melt::MeltKernel::Reset() stepCount = 0; slowCount = 0; gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -242,35 +242,12 @@ void Melt::MeltKernel::Process( const Float32 *inSourceP, minTap[28] = floor(109 * depthA); maxTap[28] = floor(109 * depthB); minTap[29] = floor(113 * depthA); maxTap[29] = floor(113 * depthB); minTap[30] = floor(117 * depthA); maxTap[30] = floor(117 * depthB); - long double drySample; - long double inputSample; + double drySample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 16000) {gcount = 16000;} @@ -363,11 +340,11 @@ void Melt::MeltKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Melt/Melt.h b/plugins/MacAU/Melt/Melt.h index 4473fb5e8..d7366ad89 100755 --- a/plugins/MacAU/Melt/Melt.h +++ b/plugins/MacAU/Melt/Melt.h @@ -145,7 +145,7 @@ public: Float32 scalefactor; int gcount; //we're using 32 bit because we want to build some truncation into the tails to noise them. - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/MidSide/MidSide.cpp b/plugins/MacAU/MidSide/MidSide.cpp index 8330aa161..b7269198b 100755 --- a/plugins/MacAU/MidSide/MidSide.cpp +++ b/plugins/MacAU/MidSide/MidSide.cpp @@ -171,8 +171,8 @@ ComponentResult MidSide::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult MidSide::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -192,10 +192,10 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 sidegain = GetParameter( kParam_One ) * 2.0; Float64 midgain = 2.0 - sidegain; @@ -204,44 +204,8 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -251,7 +215,7 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/MidSide/MidSide.h b/plugins/MacAU/MidSide/MidSide.h index 643457a34..c5dec2ac3 100755 --- a/plugins/MacAU/MidSide/MidSide.h +++ b/plugins/MacAU/MidSide/MidSide.h @@ -111,8 +111,8 @@ public: virtual ComponentResult Version() { return kMidSideVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacAU/MoNoam/MoNoam.cpp b/plugins/MacAU/MoNoam/MoNoam.cpp index a9f361a9a..21dc9fbf3 100755 --- a/plugins/MacAU/MoNoam/MoNoam.cpp +++ b/plugins/MacAU/MoNoam/MoNoam.cpp @@ -211,21 +211,21 @@ OSStatus MoNoam::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int processing = (int) GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/MacAU/Mojo/Mojo.cpp b/plugins/MacAU/Mojo/Mojo.cpp index 19d9db2c5..e86079b24 100755 --- a/plugins/MacAU/Mojo/Mojo.cpp +++ b/plugins/MacAU/Mojo/Mojo.cpp @@ -176,15 +176,15 @@ void Mojo::MojoKernel::Process( const Float32 *inSourceP, Float64 gain = pow(10.0,GetParameter( kParam_One )/20.0); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - //long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + //double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double mojo = pow(fabs(inputSample),0.25); + double mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacAU/Monitoring/Monitoring.cpp b/plugins/MacAU/Monitoring/Monitoring.cpp index 158373bb6..5b7cf29dd 100755 --- a/plugins/MacAU/Monitoring/Monitoring.cpp +++ b/plugins/MacAU/Monitoring/Monitoring.cpp @@ -267,7 +267,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int processing = (int) GetParameter( kParam_One ); @@ -289,8 +289,8 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //for Bandpasses while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -357,7 +357,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl case 3: Float64 trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -530,8 +530,8 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -547,17 +547,17 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (-tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (-tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -579,9 +579,9 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -638,7 +638,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -657,17 +657,17 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -681,7 +681,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -690,7 +690,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/MacAU/Monitoring/Monitoring.h b/plugins/MacAU/Monitoring/Monitoring.h index 86059430d..8eceec7d1 100755 --- a/plugins/MacAU/Monitoring/Monitoring.h +++ b/plugins/MacAU/Monitoring/Monitoring.h @@ -142,8 +142,8 @@ public: virtual ComponentResult Version() { return kMonitoringVersion; } private: - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD Float64 aL[1503], bL[1503], cL[1503], dL[1503]; Float64 aR[1503], bR[1503], cR[1503], dR[1503]; @@ -163,7 +163,7 @@ public: Float64 iirSampleTR, iirSampleUR, iirSampleVR; Float64 iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquad[11]; + double biquad[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/MacAU/Monitoring2/Monitoring2.cpp b/plugins/MacAU/Monitoring2/Monitoring2.cpp index b2bda4b03..f3270e4f0 100644 --- a/plugins/MacAU/Monitoring2/Monitoring2.cpp +++ b/plugins/MacAU/Monitoring2/Monitoring2.cpp @@ -248,7 +248,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -275,8 +275,8 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //for Bandpasses while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -346,7 +346,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF case kSLEW: Float64 trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -519,8 +519,8 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -536,17 +536,17 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -568,9 +568,9 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -627,7 +627,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/MacAU/Monitoring2/Monitoring2.h b/plugins/MacAU/Monitoring2/Monitoring2.h index d0f7f47f7..32b707a39 100644 --- a/plugins/MacAU/Monitoring2/Monitoring2.h +++ b/plugins/MacAU/Monitoring2/Monitoring2.h @@ -157,7 +157,7 @@ public: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.cpp b/plugins/MacAU/NCSeventeen/NCSeventeen.cpp index 14f0cf2d3..18740ebca 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.cpp +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.cpp @@ -212,7 +212,7 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, Float64 maxfeedTreb = 0.972; Float64 maxfeed = 0.975; Float64 bridgerectifier; - long double inputSample; + double inputSample; Float64 lowSample; Float64 highSample; Float64 distSample; @@ -224,30 +224,7 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= gain; @@ -382,11 +359,11 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, if (inputSample < -0.95) inputSample = -0.95; //iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacAU/NCSeventeen/NCSeventeen.h b/plugins/MacAU/NCSeventeen/NCSeventeen.h index 571f64fcc..b3421b7f3 100755 --- a/plugins/MacAU/NCSeventeen/NCSeventeen.h +++ b/plugins/MacAU/NCSeventeen/NCSeventeen.h @@ -133,7 +133,7 @@ public: Float64 basslev; Float64 treblev; Float64 cheblev; - long double fpNShape; + uint32_t fpd; //default stuff }; diff --git a/plugins/MacAU/NaturalizeDither/NaturalizeDither.cpp b/plugins/MacAU/NaturalizeDither/NaturalizeDither.cpp index 76531b4ac..351e9caa4 100755 --- a/plugins/MacAU/NaturalizeDither/NaturalizeDither.cpp +++ b/plugins/MacAU/NaturalizeDither/NaturalizeDither.cpp @@ -176,7 +176,7 @@ void NaturalizeDither::NaturalizeDitherKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 benfordize; int hotbinA; int hotbinB; @@ -185,30 +185,7 @@ void NaturalizeDither::NaturalizeDitherKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacAU/Neverland/Neverland.cpp b/plugins/MacAU/Neverland/Neverland.cpp index a2f227f59..c8b10775b 100755 --- a/plugins/MacAU/Neverland/Neverland.cpp +++ b/plugins/MacAU/Neverland/Neverland.cpp @@ -222,8 +222,8 @@ void Neverland::NeverlandKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacAU/Nikola/Nikola.cpp b/plugins/MacAU/Nikola/Nikola.cpp index 64bcd5e0b..f0f96d9cd 100755 --- a/plugins/MacAU/Nikola/Nikola.cpp +++ b/plugins/MacAU/Nikola/Nikola.cpp @@ -190,9 +190,9 @@ void Nikola::NikolaKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 bridgerectifier = fabs(inputSample); if (bridgerectifier > outlevel) outlevel = bridgerectifier; diff --git a/plugins/MacAU/NodeDither/NodeDither.cpp b/plugins/MacAU/NodeDither/NodeDither.cpp index b57ae55da..6e662e863 100755 --- a/plugins/MacAU/NodeDither/NodeDither.cpp +++ b/plugins/MacAU/NodeDither/NodeDither.cpp @@ -210,35 +210,12 @@ void NodeDither::NodeDitherKernel::Process( const Float32 *inSourceP, int phase = GetParameter( kParam_Two ); //0 default is out of phase, 1 is in phase - long double inputSample; + double inputSample; Float64 currentDither; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacAU/Noise/Noise.cpp b/plugins/MacAU/Noise/Noise.cpp index 15ca903e3..8bb002283 100755 --- a/plugins/MacAU/Noise/Noise.cpp +++ b/plugins/MacAU/Noise/Noise.cpp @@ -209,7 +209,7 @@ void Noise::NoiseKernel::Reset() flip = false; filterflip = false; for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -228,7 +228,7 @@ void Noise::NoiseKernel::Process( const Float32 *inSourceP, Float64 cutofftarget = (GetParameter( kParam_One )*3.5); Float64 rumblecutoff = cutofftarget * 0.005; Float64 invcutoff; - long double inputSample; + double inputSample; Float64 drySample; Float64 highpass = GetParameter( kParam_Three )*38.0; int lowcut = floor(highpass); @@ -311,30 +311,7 @@ void Noise::NoiseKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (surge> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Noise/Noise.h b/plugins/MacAU/Noise/Noise.h index 452a6031d..31568fe4a 100755 --- a/plugins/MacAU/Noise/Noise.h +++ b/plugins/MacAU/Noise/Noise.h @@ -152,7 +152,7 @@ public: bool filterflip; Float64 b[11]; Float64 f[11]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/NonlinearSpace/NonlinearSpace.cpp b/plugins/MacAU/NonlinearSpace/NonlinearSpace.cpp index d91e997fa..e50f05b10 100755 --- a/plugins/MacAU/NonlinearSpace/NonlinearSpace.cpp +++ b/plugins/MacAU/NonlinearSpace/NonlinearSpace.cpp @@ -408,8 +408,8 @@ ComponentResult NonlinearSpace::Reset(AudioUnitScope inScope, AudioUnitElement countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -428,12 +428,12 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 overallscale = 1.0; int samplerate = (int) GetParameter( kParam_One ); switch (samplerate) @@ -511,44 +511,8 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1157,7 +1121,7 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.cpp b/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.cpp index fe31998cb..6a0ef725a 100755 --- a/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.cpp +++ b/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.cpp @@ -177,7 +177,7 @@ void NotJustAnotherCD::NotJustAnotherCDKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 benfordize; int hotbinA; int hotbinB; @@ -188,30 +188,7 @@ void NotJustAnotherCD::NotJustAnotherCDKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; diff --git a/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.h b/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.h index b3700c9b8..7ca7ce40e 100755 --- a/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.h +++ b/plugins/MacAU/NotJustAnotherCD/NotJustAnotherCD.h @@ -122,7 +122,7 @@ public: private: Float64 byn[13]; - long double noiseShaping; + double noiseShaping; }; }; diff --git a/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.cpp b/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.cpp index 5ca17fdc5..1af7e0b23 100755 --- a/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.cpp +++ b/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.cpp @@ -222,23 +222,23 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; //0-1 is now one bit, now we dither bool cutbins; cutbins = false; - long double drySample = inputSample; + double drySample = inputSample; inputSample -= noiseShaping; - long double benfordize; benfordize = floor(inputSample); + double benfordize; benfordize = floor(inputSample); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { byn[hotbinA] += 1; if (byn[hotbinA] > 982) cutbins = true; @@ -254,7 +254,7 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { byn[hotbinB] += 1; if (byn[hotbinB] > 982) cutbins = true; @@ -265,7 +265,7 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {byn[hotbinA] += 1; outputSample = floor(inputSample);} else {byn[hotbinB] += 1; outputSample = floor(inputSample+1);} //assign the relevant one to the delay line diff --git a/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.h b/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.h index d519bfbf2..69eb38ed6 100755 --- a/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.h +++ b/plugins/MacAU/NotJustAnotherDither/NotJustAnotherDither.h @@ -132,7 +132,7 @@ public: private: Float64 byn[13]; - long double noiseShaping; + double noiseShaping; uint32_t fpd; }; }; diff --git a/plugins/MacAU/OneCornerClip/OneCornerClip.cpp b/plugins/MacAU/OneCornerClip/OneCornerClip.cpp index 9ddb8db29..cdf82e3ee 100755 --- a/plugins/MacAU/OneCornerClip/OneCornerClip.cpp +++ b/plugins/MacAU/OneCornerClip/OneCornerClip.cpp @@ -193,7 +193,7 @@ void OneCornerClip::OneCornerClipKernel::Reset() lastSample = 0.0; limitPos = 0.0; limitNeg = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,7 +208,7 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -230,35 +230,12 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, bool clipEngage = false; Float64 wet = GetParameter( kParam_Five ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (inputGain != 1.0) @@ -304,11 +281,11 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither if (clipEngage == false) { diff --git a/plugins/MacAU/OneCornerClip/OneCornerClip.h b/plugins/MacAU/OneCornerClip/OneCornerClip.h index 013fc94fb..109620622 100755 --- a/plugins/MacAU/OneCornerClip/OneCornerClip.h +++ b/plugins/MacAU/OneCornerClip/OneCornerClip.h @@ -140,7 +140,7 @@ public: Float64 lastSample; Float64 limitPos; Float64 limitNeg; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PDBuss/PDBuss.cpp b/plugins/MacAU/PDBuss/PDBuss.cpp index 6f450c648..8c41b9196 100755 --- a/plugins/MacAU/PDBuss/PDBuss.cpp +++ b/plugins/MacAU/PDBuss/PDBuss.cpp @@ -170,7 +170,7 @@ void PDBuss::PDBussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -190,7 +190,7 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, Float64 apply; double drySample; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -259,11 +236,11 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PDBuss/PDBuss.h b/plugins/MacAU/PDBuss/PDBuss.h index 476b436ec..d857b806e 100755 --- a/plugins/MacAU/PDBuss/PDBuss.h +++ b/plugins/MacAU/PDBuss/PDBuss.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; Float64 previousSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PDChannel/PDChannel.cpp b/plugins/MacAU/PDChannel/PDChannel.cpp index 1571b158a..6b79ea41f 100755 --- a/plugins/MacAU/PDChannel/PDChannel.cpp +++ b/plugins/MacAU/PDChannel/PDChannel.cpp @@ -170,7 +170,7 @@ void PDChannel::PDChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,7 +185,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 inputgain = GetParameter( kParam_One ); @@ -193,7 +193,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, Float64 apply; double drySample; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -204,30 +204,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -265,11 +242,11 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PDChannel/PDChannel.h b/plugins/MacAU/PDChannel/PDChannel.h index 523f7893b..920d251cd 100755 --- a/plugins/MacAU/PDChannel/PDChannel.h +++ b/plugins/MacAU/PDChannel/PDChannel.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; Float64 previousSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Pafnuty/Pafnuty.cpp b/plugins/MacAU/Pafnuty/Pafnuty.cpp index 8b59be312..409db3537 100755 --- a/plugins/MacAU/Pafnuty/Pafnuty.cpp +++ b/plugins/MacAU/Pafnuty/Pafnuty.cpp @@ -254,7 +254,7 @@ ComponentResult Pafnuty::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Pafnuty::PafnutyKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,70 +269,52 @@ void Pafnuty::PafnutyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double chebyshev; - long double effect; - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (GetParameter( kParam_One )*1.0); + double chebyshev; + double effect; + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (GetParameter( kParam_One )*1.0); second = second * fabs(second); - long double third = -(GetParameter( kParam_Two )*0.60); + double third = -(GetParameter( kParam_Two )*0.60); third = third * fabs(third); - long double fourth = -(GetParameter( kParam_Three )*0.60); + double fourth = -(GetParameter( kParam_Three )*0.60); fourth = fourth * fabs(fourth); - long double fifth = (GetParameter( kParam_Four )*0.45); + double fifth = (GetParameter( kParam_Four )*0.45); fifth = fifth * fabs(fifth); - long double sixth = (GetParameter( kParam_Five )*0.45); + double sixth = (GetParameter( kParam_Five )*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(GetParameter( kParam_Six )*0.38); + double seventh = -(GetParameter( kParam_Six )*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(GetParameter( kParam_Seven )*0.38); + double eighth = -(GetParameter( kParam_Seven )*0.38); eighth = eighth * fabs(eighth); - long double ninth = (GetParameter( kParam_Eight )*0.35); + double ninth = (GetParameter( kParam_Eight )*0.35); ninth = ninth * fabs(ninth); - long double tenth = (GetParameter( kParam_Nine )*0.35); + double tenth = (GetParameter( kParam_Nine )*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(GetParameter( kParam_Ten )*0.32); + double eleventh = -(GetParameter( kParam_Ten )*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(GetParameter( kParam_Eleven )*0.32); + double twelvth = -(GetParameter( kParam_Eleven )*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (GetParameter( kParam_Twelve )*0.30); + double thirteenth = (GetParameter( kParam_Twelve )*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = GetParameter( kParam_Thirteen ); + double amount = GetParameter( kParam_Thirteen ); amount = amount * fabs(amount); //setting up while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; effect = 0.0; inP2 = inputSample * inputSample; @@ -412,11 +394,11 @@ void Pafnuty::PafnutyKernel::Process( const Float32 *inSourceP, inputSample += (effect * amount); //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Pafnuty/Pafnuty.h b/plugins/MacAU/Pafnuty/Pafnuty.h index ae2b76687..111add59a 100755 --- a/plugins/MacAU/Pafnuty/Pafnuty.h +++ b/plugins/MacAU/Pafnuty/Pafnuty.h @@ -162,7 +162,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PaulDither/PaulDither.cpp b/plugins/MacAU/PaulDither/PaulDither.cpp index 99b85f961..b3ae5543f 100755 --- a/plugins/MacAU/PaulDither/PaulDither.cpp +++ b/plugins/MacAU/PaulDither/PaulDither.cpp @@ -198,7 +198,7 @@ void PaulDither::PaulDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 currentDither; bool highres = false; @@ -214,7 +214,7 @@ void PaulDither::PaulDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacAU/PaulWide/PaulWide.cpp b/plugins/MacAU/PaulWide/PaulWide.cpp index 9be8f23f5..41ff5bc39 100644 --- a/plugins/MacAU/PaulWide/PaulWide.cpp +++ b/plugins/MacAU/PaulWide/PaulWide.cpp @@ -229,8 +229,8 @@ OSStatus PaulWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag if (outScale < 8.0) outScale = 8.0; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -247,14 +247,14 @@ OSStatus PaulWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/MacAU/PeaksOnly/PeaksOnly.cpp b/plugins/MacAU/PeaksOnly/PeaksOnly.cpp index efe8ad97e..c83943bb8 100755 --- a/plugins/MacAU/PeaksOnly/PeaksOnly.cpp +++ b/plugins/MacAU/PeaksOnly/PeaksOnly.cpp @@ -167,7 +167,7 @@ void PeaksOnly::PeaksOnlyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -178,8 +178,8 @@ void PeaksOnly::PeaksOnlyKernel::Process( const Float32 *inSourceP, int allpasstemp = 0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.cpp b/plugins/MacAU/PhaseNudge/PhaseNudge.cpp index abb05e1ae..ca904d3a8 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.cpp +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.cpp @@ -168,7 +168,7 @@ void PhaseNudge::PhaseNudgeKernel::Reset() { for(int count = 0; count < 1502; count++) {d[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; //coded to snap directly to the value on instantiation if the disparity is great enough } @@ -193,36 +193,13 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; Float64 bridgerectifier; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample /= 4.0; @@ -253,11 +230,11 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, inputSample *= 4.0; if (wet < 1.0) inputSample = (drySample * dry)+(inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PhaseNudge/PhaseNudge.h b/plugins/MacAU/PhaseNudge/PhaseNudge.h index fa655e80e..f6ad98dcd 100755 --- a/plugins/MacAU/PhaseNudge/PhaseNudge.h +++ b/plugins/MacAU/PhaseNudge/PhaseNudge.h @@ -130,7 +130,7 @@ public: private: Float64 d[1503]; int one, maxdelay; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PitchDelay/PitchDelay.cpp b/plugins/MacAU/PitchDelay/PitchDelay.cpp index 4d604e4be..ff72403c4 100644 --- a/plugins/MacAU/PitchDelay/PitchDelay.cpp +++ b/plugins/MacAU/PitchDelay/PitchDelay.cpp @@ -221,7 +221,7 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -269,8 +269,8 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, //unless you go super heavy, you are only adjusting the added echo loudness. while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; @@ -279,7 +279,7 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, int pos = floor(delay); Float64 newSample = inputSample + (regenSample*feedback); - long double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; + double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; regenFilter[7] = -(tempSample * regenFilter[5]) + regenFilter[8]; regenFilter[8] = (newSample * regenFilter[4]) - (tempSample * regenFilter[6]); newSample = tempSample; diff --git a/plugins/MacAU/PitchDelay/PitchDelay.h b/plugins/MacAU/PitchDelay/PitchDelay.h index 15f396905..6f76114c2 100644 --- a/plugins/MacAU/PitchDelay/PitchDelay.h +++ b/plugins/MacAU/PitchDelay/PitchDelay.h @@ -145,8 +145,8 @@ public: Float64 regenSample; Float64 delay; Float64 sweep; - long double regenFilter[9]; - long double outFilter[9]; + double regenFilter[9]; + double outFilter[9]; double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacAU/PocketVerbs/PocketVerbs.cpp b/plugins/MacAU/PocketVerbs/PocketVerbs.cpp index 741b94e3a..1f7c69286 100755 --- a/plugins/MacAU/PocketVerbs/PocketVerbs.cpp +++ b/plugins/MacAU/PocketVerbs/PocketVerbs.cpp @@ -544,9 +544,9 @@ void PocketVerbs::PocketVerbsKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; peak -= release; if (peak < fabs(inputSample*2.0)) peak = fabs(inputSample*2.0); diff --git a/plugins/MacAU/Podcast/Podcast.cpp b/plugins/MacAU/Podcast/Podcast.cpp index 8324dd85b..e0e043475 100755 --- a/plugins/MacAU/Podcast/Podcast.cpp +++ b/plugins/MacAU/Podcast/Podcast.cpp @@ -182,7 +182,7 @@ void Podcast::PodcastKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -197,9 +197,9 @@ void Podcast::PodcastKernel::Process( const Float32 *inSourceP, Float64 trigger; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample *= c1; trigger = fabs(inputSample)*4.7; diff --git a/plugins/MacAU/PodcastDeluxe/PodcastDeluxe.cpp b/plugins/MacAU/PodcastDeluxe/PodcastDeluxe.cpp index 945e20657..ef1720237 100755 --- a/plugins/MacAU/PodcastDeluxe/PodcastDeluxe.cpp +++ b/plugins/MacAU/PodcastDeluxe/PodcastDeluxe.cpp @@ -177,7 +177,7 @@ void PodcastDeluxe::PodcastDeluxeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -207,8 +207,8 @@ void PodcastDeluxe::PodcastDeluxeKernel::Process( const Float32 *inSourceP, Float64 trigger; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; allpasstemp = tap1 - 1; if (allpasstemp < 0 || allpasstemp > maxdelay1) {allpasstemp = maxdelay1;} diff --git a/plugins/MacAU/Point/Poynt.cpp b/plugins/MacAU/Point/Poynt.cpp index b8b70308b..bb85abdca 100755 --- a/plugins/MacAU/Point/Poynt.cpp +++ b/plugins/MacAU/Point/Poynt.cpp @@ -178,7 +178,7 @@ void Poynt::PoyntKernel::Reset() nobA = 0.0; nibB = 0.0; nobB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -213,35 +213,12 @@ void Poynt::PoyntKernel::Process( const Float32 *inSourceP, if (GetParameter( kParam_Two ) > 0) nobDiv = nibDiv / (1.001-GetParameter( kParam_Two )); else nobDiv = nibDiv * (1.001-pow(GetParameter( kParam_Two )*0.75,2)); Float64 nibnobFactor = 0.0; //start with the fallthrough value, why not - long double inputSample; + double inputSample; Float64 absolute; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; @@ -274,11 +251,11 @@ void Poynt::PoyntKernel::Process( const Float32 *inSourceP, inputSample *= nibnobFactor; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/Pop/Pop.cpp b/plugins/MacAU/Pop/Pop.cpp index 08b031415..e934b857a 100755 --- a/plugins/MacAU/Pop/Pop.cpp +++ b/plugins/MacAU/Pop/Pop.cpp @@ -223,9 +223,9 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; d[delay] = inputSample; delay--; @@ -233,7 +233,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, //yes this is a second bounds check. it's cheap, check EVERY time inputSample = (inputSample * thicken) + (d[delay] * (1.0-thicken)); - long double lowestSample = inputSample; + double lowestSample = inputSample; if (fabs(inputSample) > fabs(previous)) lowestSample = previous; if (fabs(lowestSample) > fabs(previous2)) lowestSample = (lowestSample + previous2) / 1.99; if (fabs(lowestSample) > fabs(previous3)) lowestSample = (lowestSample + previous3) / 1.98; @@ -304,7 +304,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, muSpeedB = muNewSpeed / muSpeedB; } //got coefficients, adjusted speeds - long double coefficient = highGainOffset; + double coefficient = highGainOffset; if (flip) coefficient += pow(muCoefficientA,2); else coefficient += pow(muCoefficientB,2); inputSample *= coefficient; @@ -313,7 +313,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/MacAU/Pop/Pop.h b/plugins/MacAU/Pop/Pop.h index 859a55cf5..fee7c7bce 100755 --- a/plugins/MacAU/Pop/Pop.h +++ b/plugins/MacAU/Pop/Pop.h @@ -130,19 +130,19 @@ public: virtual void Reset(); private: - long double muVary; - long double muAttack; - long double muNewSpeed; - long double muSpeedA; - long double muSpeedB; - long double muCoefficientA; - long double muCoefficientB; - long double thicken; - long double previous; - long double previous2; - long double previous3; - long double previous4; - long double previous5; + double muVary; + double muAttack; + double muNewSpeed; + double muSpeedA; + double muSpeedB; + double muCoefficientA; + double muCoefficientB; + double thicken; + double previous; + double previous2; + double previous3; + double previous4; + double previous5; Float64 d[10001]; int delay; bool flip; diff --git a/plugins/MacAU/PowerSag/PowerSag.cpp b/plugins/MacAU/PowerSag/PowerSag.cpp index 95f70d2de..55f08b2ed 100755 --- a/plugins/MacAU/PowerSag/PowerSag.cpp +++ b/plugins/MacAU/PowerSag/PowerSag.cpp @@ -169,7 +169,7 @@ void PowerSag::PowerSagKernel::Reset() for(int count = 0; count < 8999; count++) {d[count] = 0;} control = 0; gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -191,34 +191,11 @@ void PowerSag::PowerSagKernel::Process( const Float32 *inSourceP, Float64 thickness; Float64 out; Float64 bridgerectifier; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -249,11 +226,11 @@ void PowerSag::PowerSagKernel::Process( const Float32 *inSourceP, inputSample *= clamp; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PowerSag/PowerSag.h b/plugins/MacAU/PowerSag/PowerSag.h index ef594dcdb..8a7796b84 100755 --- a/plugins/MacAU/PowerSag/PowerSag.h +++ b/plugins/MacAU/PowerSag/PowerSag.h @@ -131,7 +131,7 @@ public: Float64 d[9000]; Float64 control; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PowerSag2/PowerSag2.cpp b/plugins/MacAU/PowerSag2/PowerSag2.cpp index 232ae3f07..9fc98f656 100755 --- a/plugins/MacAU/PowerSag2/PowerSag2.cpp +++ b/plugins/MacAU/PowerSag2/PowerSag2.cpp @@ -191,8 +191,8 @@ void PowerSag2::PowerSag2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; if (gcount < 0 || gcount > 16384) {gcount = 16384;} diff --git a/plugins/MacAU/Precious/Precious.cpp b/plugins/MacAU/Precious/Precious.cpp index 84e7bc015..ae0d5a104 100755 --- a/plugins/MacAU/Precious/Precious.cpp +++ b/plugins/MacAU/Precious/Precious.cpp @@ -221,8 +221,8 @@ void Precious::PreciousKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacAU/Preponderant/Preponderant.cpp b/plugins/MacAU/Preponderant/Preponderant.cpp index c38eb9357..c6b9d321f 100755 --- a/plugins/MacAU/Preponderant/Preponderant.cpp +++ b/plugins/MacAU/Preponderant/Preponderant.cpp @@ -209,7 +209,7 @@ void Preponderant::PreponderantKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -256,24 +256,24 @@ void Preponderant::PreponderantKernel::Process( const Float32 *inSourceP, biquadC[6] = (1.0 - K / biquadC[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); - long double bassSample = tempSample; //BANDPASS form + double bassSample = tempSample; //BANDPASS form tempSample = (inputSample * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (inputSample * biquadB[4]) - (tempSample * biquadB[6]); - long double midSample = tempSample; //BANDPASS form + double midSample = tempSample; //BANDPASS form tempSample = (inputSample * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSample * biquadC[5]) + biquadC[8]; biquadC[8] = (inputSample * biquadC[4]) - (tempSample * biquadC[6]); - long double highSample = tempSample; //BANDPASS form + double highSample = tempSample; //BANDPASS form if (bassBalance < 0.00125) bassBalance = 0.00125; if (bassBalance > 1.0) bassBalance = 1.0; diff --git a/plugins/MacAU/Preponderant/Preponderant.h b/plugins/MacAU/Preponderant/Preponderant.h index 87c8d8fcb..1dff6ad8b 100755 --- a/plugins/MacAU/Preponderant/Preponderant.h +++ b/plugins/MacAU/Preponderant/Preponderant.h @@ -137,16 +137,16 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double bassBalance; - long double midBalance; - long double highBalance; - long double bassTrack; - long double midTrack; - long double highTrack; - long double quickness; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double bassBalance; + double midBalance; + double highBalance; + double bassTrack; + double midTrack; + double highTrack; + double quickness; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Pressure4/Pressure4.cpp b/plugins/MacAU/Pressure4/Pressure4.cpp index 9fbbe853b..69f19af0b 100755 --- a/plugins/MacAU/Pressure4/Pressure4.cpp +++ b/plugins/MacAU/Pressure4/Pressure4.cpp @@ -198,8 +198,8 @@ ComponentResult Pressure4::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Pressure4::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -236,7 +236,7 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla release /= overallscale; Float64 fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; Float64 coefficient; Float64 inputSense; Float64 mewiness = GetParameter( kParam_Three ); @@ -255,50 +255,14 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla unmewiness = 1.0-mewiness; } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -406,7 +370,7 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Pressure4/Pressure4.h b/plugins/MacAU/Pressure4/Pressure4.h index 6534c4647..181c5b3c2 100755 --- a/plugins/MacAU/Pressure4/Pressure4.h +++ b/plugins/MacAU/Pressure4/Pressure4.h @@ -125,8 +125,8 @@ public: Float64 muSpeedB; Float64 muCoefficientA; Float64 muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + double fpNShapeL; + double fpNShapeR; bool flip; }; diff --git a/plugins/MacAU/Pressure4Mono/Pressure4Mono.cpp b/plugins/MacAU/Pressure4Mono/Pressure4Mono.cpp index 90991bc41..0c251e162 100755 --- a/plugins/MacAU/Pressure4Mono/Pressure4Mono.cpp +++ b/plugins/MacAU/Pressure4Mono/Pressure4Mono.cpp @@ -182,7 +182,7 @@ ComponentResult Pressure4Mono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Pressure4Mono::Pressure4MonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -213,7 +213,7 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, release /= overallscale; Float64 fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; Float64 coefficient; Float64 mewiness = GetParameter( kParam_Three ); Float64 outputGain = GetParameter( kParam_Four ); @@ -231,34 +231,11 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, unmewiness = 1.0-mewiness; } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; // advance to next frame (e.g. if stereo, we're advancing 2 samples); @@ -349,11 +326,11 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, //second stage of overdrive to prevent overs and allow bloody loud extremeness flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/Pressure4Mono/Pressure4Mono.h b/plugins/MacAU/Pressure4Mono/Pressure4Mono.h index 6c4b3df71..10641a300 100755 --- a/plugins/MacAU/Pressure4Mono/Pressure4Mono.h +++ b/plugins/MacAU/Pressure4Mono/Pressure4Mono.h @@ -141,7 +141,7 @@ public: Float64 muSpeedB; Float64 muCoefficientA; Float64 muCoefficientB; - long double fpNShape; + uint32_t fpd; bool flip; }; diff --git a/plugins/MacAU/Pressure5/Pressure5.cpp b/plugins/MacAU/Pressure5/Pressure5.cpp index b7d095e79..4fba69769 100644 --- a/plugins/MacAU/Pressure5/Pressure5.cpp +++ b/plugins/MacAU/Pressure5/Pressure5.cpp @@ -246,7 +246,7 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int spacing = floor(overallscale); //should give us working basic scaling, usually 2 or 4 @@ -280,18 +280,18 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //make the second filter same as the first, don't use sample slots while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -391,7 +391,7 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; diff --git a/plugins/MacAU/Pressure5/Pressure5.h b/plugins/MacAU/Pressure5/Pressure5.h index 12b825de4..a9a5bfede 100644 --- a/plugins/MacAU/Pressure5/Pressure5.h +++ b/plugins/MacAU/Pressure5/Pressure5.h @@ -149,15 +149,15 @@ public: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacAU/PurestAir/PurestAir.cpp b/plugins/MacAU/PurestAir/PurestAir.cpp index 8dd6a065c..d62e4606d 100755 --- a/plugins/MacAU/PurestAir/PurestAir.cpp +++ b/plugins/MacAU/PurestAir/PurestAir.cpp @@ -203,8 +203,8 @@ void PurestAir::PurestAirKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; halfDrySample = halfwaySample = (inputSample + last1Sample) / 2.0; diff --git a/plugins/MacAU/PurestAir/PurestAir.h b/plugins/MacAU/PurestAir/PurestAir.h index 38c73a27f..b8c5aa030 100755 --- a/plugins/MacAU/PurestAir/PurestAir.h +++ b/plugins/MacAU/PurestAir/PurestAir.h @@ -131,12 +131,12 @@ public: virtual void Reset(); private: - long double last1Sample; - long double halfwaySample; - long double halfDrySample; - long double halfDiffSample; - long double diffSample; - long double lastSample; + double last1Sample; + double halfwaySample; + double halfDrySample; + double halfDiffSample; + double diffSample; + double lastSample; Float64 s1; Float64 s2; Float64 s3; diff --git a/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.cpp b/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.cpp index 73e3f0a5c..fb1594595 100755 --- a/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.cpp +++ b/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.cpp @@ -179,11 +179,11 @@ void PurestConsole2Buss::PurestConsole2BussKernel::Process( const Float32 *inS biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } diff --git a/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.h b/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.h index a9aff91e9..2ab3c5f75 100755 --- a/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.h +++ b/plugins/MacAU/PurestConsole2Buss/PurestConsole2Buss.h @@ -117,7 +117,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.cpp b/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.cpp index d8a629c2e..a47b0e23a 100755 --- a/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.cpp +++ b/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.cpp @@ -179,11 +179,11 @@ void PurestConsole2Channel::PurestConsole2ChannelKernel::Process( const Float32 biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } diff --git a/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.h b/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.h index 43d201102..aacdbbe06 100755 --- a/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.h +++ b/plugins/MacAU/PurestConsole2Channel/PurestConsole2Channel.h @@ -117,7 +117,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.cpp b/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.cpp index d0b8cf9c1..3dba02c76 100755 --- a/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.cpp +++ b/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.cpp @@ -150,7 +150,7 @@ ComponentResult PurestConsoleBuss::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestConsoleBuss::PurestConsoleBussKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -166,34 +166,11 @@ void PurestConsoleBuss::PurestConsoleBussKernel::Process( const Float32 *inSou const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; @@ -202,11 +179,11 @@ void PurestConsoleBuss::PurestConsoleBussKernel::Process( const Float32 *inSou inputSample = asin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.h b/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.h index 590e7978f..1d85733b8 100755 --- a/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.h +++ b/plugins/MacAU/PurestConsoleBuss/PurestConsoleBuss.h @@ -118,7 +118,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp index b41864036..1c58335b7 100755 --- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp +++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.cpp @@ -150,7 +150,7 @@ ComponentResult PurestConsoleChannel::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestConsoleChannel::PurestConsoleChannelKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -166,43 +166,20 @@ void PurestConsoleChannel::PurestConsoleChannelKernel::Process( const Float32 const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h index 0beecd138..b97f934e6 100755 --- a/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h +++ b/plugins/MacAU/PurestConsoleChannel/PurestConsoleChannel.h @@ -119,7 +119,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PurestDrive/PurestDrive.cpp b/plugins/MacAU/PurestDrive/PurestDrive.cpp index 7f6d0a0f4..d55b34fbd 100755 --- a/plugins/MacAU/PurestDrive/PurestDrive.cpp +++ b/plugins/MacAU/PurestDrive/PurestDrive.cpp @@ -159,7 +159,7 @@ ComponentResult PurestDrive::Initialize() void PurestDrive::PurestDriveKernel::Reset() { previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } @@ -177,36 +177,13 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; Float64 intensity = GetParameter( kParam_One ); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 apply; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample = sin(inputSample); @@ -222,11 +199,11 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PurestDrive/PurestDrive.h b/plugins/MacAU/PurestDrive/PurestDrive.h index 54809d8da..09a9920fc 100755 --- a/plugins/MacAU/PurestDrive/PurestDrive.h +++ b/plugins/MacAU/PurestDrive/PurestDrive.h @@ -126,7 +126,7 @@ public: private: double previousSample; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacAU/PurestEcho/PurestEcho.cpp b/plugins/MacAU/PurestEcho/PurestEcho.cpp index cfbb9fdd8..7868d14a3 100755 --- a/plugins/MacAU/PurestEcho/PurestEcho.cpp +++ b/plugins/MacAU/PurestEcho/PurestEcho.cpp @@ -197,7 +197,7 @@ void PurestEcho::PurestEchoKernel::Reset() for(int count = 0; count < totalsamples-1; count++) {d[count] = 0;} gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -274,34 +274,11 @@ void PurestEcho::PurestEchoKernel::Process( const Float32 *inSourceP, Float64 delaysBuffer; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; d[gcount+loopLimit] = d[gcount] = inputSample * tapsTrim; //this is how the double buffer works: @@ -338,11 +315,11 @@ void PurestEcho::PurestEchoKernel::Process( const Float32 *inSourceP, gcount--; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PurestEcho/PurestEcho.h b/plugins/MacAU/PurestEcho/PurestEcho.h index 7ed818b06..1e94fa7dd 100755 --- a/plugins/MacAU/PurestEcho/PurestEcho.h +++ b/plugins/MacAU/PurestEcho/PurestEcho.h @@ -140,7 +140,7 @@ public: const static int totalsamples = 65535; Float32 d[totalsamples]; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/PurestFade/PurestFade.cpp b/plugins/MacAU/PurestFade/PurestFade.cpp index ce01295cb..e18e1ce72 100755 --- a/plugins/MacAU/PurestFade/PurestFade.cpp +++ b/plugins/MacAU/PurestFade/PurestFade.cpp @@ -204,26 +204,26 @@ void PurestFade::PurestFadeKernel::Process( const Float32 *inSourceP, //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = GetParameter( kParam_Two ); + double targetBgain = GetParameter( kParam_Two ); if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((GetSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; targetgain = pow(10.0,settingchase/20.0); //now we have the target in our temp variable diff --git a/plugins/MacAU/PurestGain/PurestGain.cpp b/plugins/MacAU/PurestGain/PurestGain.cpp index 6bc46d5f9..c8df39024 100755 --- a/plugins/MacAU/PurestGain/PurestGain.cpp +++ b/plugins/MacAU/PurestGain/PurestGain.cpp @@ -170,7 +170,7 @@ void PurestGain::PurestGainKernel::Reset() settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,7 +213,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, Float64 outputgain; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { @@ -235,30 +235,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, //directly multiply the dB gain by the straight multiply gain inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (1.0 == outputgain) *destP = *sourceP; @@ -267,7 +244,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, inputSample *= outputgain; //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither *destP = inputSample; diff --git a/plugins/MacAU/PurestSquish/PurestSquish.cpp b/plugins/MacAU/PurestSquish/PurestSquish.cpp index affb8ceeb..71e40b58b 100755 --- a/plugins/MacAU/PurestSquish/PurestSquish.cpp +++ b/plugins/MacAU/PurestSquish/PurestSquish.cpp @@ -220,40 +220,22 @@ void PurestSquish::PurestSquishKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double highpassSample; - long double highpassSampleB; + double highpassSample; + double highpassSampleB; Float64 threshold = 1.01 - (1.0-pow(1.0-(GetParameter( kParam_One )*0.5),4)); Float64 iirAmount = pow(GetParameter( kParam_Two ),4)/overallscale; Float64 output = GetParameter( kParam_Three ); Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 muMakeupGain = 1.0 / threshold; Float64 outMakeupGain = sqrt(muMakeupGain); diff --git a/plugins/MacAU/PurestWarm/PurestWarm.cpp b/plugins/MacAU/PurestWarm/PurestWarm.cpp index 0763f84af..f3c1b5fc7 100755 --- a/plugins/MacAU/PurestWarm/PurestWarm.cpp +++ b/plugins/MacAU/PurestWarm/PurestWarm.cpp @@ -173,7 +173,7 @@ ComponentResult PurestWarm::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestWarm::PurestWarmKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -189,35 +189,12 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; int polarity = (int) GetParameter( kParam_One ); - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (polarity == 1) { @@ -226,7 +203,7 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, inputSample = -(sin(-inputSample*1.57079634)/1.57079634); //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } @@ -236,7 +213,7 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample*1.57079634)/1.57079634; //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } diff --git a/plugins/MacAU/Pyewacket/Pyewacket.cpp b/plugins/MacAU/Pyewacket/Pyewacket.cpp index bb8583ba7..944b5ef0b 100755 --- a/plugins/MacAU/Pyewacket/Pyewacket.cpp +++ b/plugins/MacAU/Pyewacket/Pyewacket.cpp @@ -189,8 +189,8 @@ ComponentResult Pyewacket::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Pyewacket::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; @@ -215,12 +215,12 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla overallscale *= GetSampleRate(); if (overallscale < 0.1) overallscale = 1.0; //insanity check - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 bridgerectifier; Float64 temprectifier; Float64 inputSense; @@ -239,44 +239,8 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { @@ -334,7 +298,7 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Pyewacket/Pyewacket.h b/plugins/MacAU/Pyewacket/Pyewacket.h index f4560469a..756f699f1 100755 --- a/plugins/MacAU/Pyewacket/Pyewacket.h +++ b/plugins/MacAU/Pyewacket/Pyewacket.h @@ -116,8 +116,8 @@ public: private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; Float64 chase; Float64 lastrectifierL; Float64 lastrectifierR; diff --git a/plugins/MacAU/PyewacketMono/PyewacketMono.cpp b/plugins/MacAU/PyewacketMono/PyewacketMono.cpp index 8ea6ab2a8..7157041f4 100755 --- a/plugins/MacAU/PyewacketMono/PyewacketMono.cpp +++ b/plugins/MacAU/PyewacketMono/PyewacketMono.cpp @@ -174,7 +174,7 @@ ComponentResult PyewacketMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PyewacketMono::PyewacketMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chase = 1.0; lastrectifier = 0.0; } @@ -196,10 +196,10 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, overallscale *= GetSampleRate(); if (overallscale < 0.1) overallscale = 1.0; //insanity check - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSample; - long double drySample; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSample; + double drySample; Float64 bridgerectifier; Float64 temprectifier; Float64 inputSense; @@ -217,30 +217,7 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; @@ -280,11 +257,11 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, inputSample *= outputGain; } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/PyewacketMono/PyewacketMono.h b/plugins/MacAU/PyewacketMono/PyewacketMono.h index 469c9f0c5..6e07f3582 100755 --- a/plugins/MacAU/PyewacketMono/PyewacketMono.h +++ b/plugins/MacAU/PyewacketMono/PyewacketMono.h @@ -130,7 +130,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; Float64 chase; Float64 lastrectifier; }; diff --git a/plugins/MacAU/RawGlitters/RawGlitters.cpp b/plugins/MacAU/RawGlitters/RawGlitters.cpp index 1ae2c2bb1..f4d59545e 100755 --- a/plugins/MacAU/RawGlitters/RawGlitters.cpp +++ b/plugins/MacAU/RawGlitters/RawGlitters.cpp @@ -214,7 +214,7 @@ void RawGlitters::RawGlittersKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float64 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; Float64 outputSample; diff --git a/plugins/MacAU/RawTimbers/RawTimbers.cpp b/plugins/MacAU/RawTimbers/RawTimbers.cpp index 008f68840..bc882ca2a 100755 --- a/plugins/MacAU/RawTimbers/RawTimbers.cpp +++ b/plugins/MacAU/RawTimbers/RawTimbers.cpp @@ -216,7 +216,7 @@ void RawTimbers::RawTimbersKernel::Process( const Float32 *inSourceP, Float64 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; Float64 outputSample; diff --git a/plugins/MacAU/Recurve/Recurve.cpp b/plugins/MacAU/Recurve/Recurve.cpp index 7ad5ae167..9886ded8b 100755 --- a/plugins/MacAU/Recurve/Recurve.cpp +++ b/plugins/MacAU/Recurve/Recurve.cpp @@ -185,8 +185,8 @@ OSStatus Recurve::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags UInt32 nSampleFrames = inFramesToProcess; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; diff --git a/plugins/MacAU/Recurve/Recurve.h b/plugins/MacAU/Recurve/Recurve.h index a0da97bce..883a863c9 100755 --- a/plugins/MacAU/Recurve/Recurve.h +++ b/plugins/MacAU/Recurve/Recurve.h @@ -105,7 +105,7 @@ public: virtual ComponentResult Version() { return kRecurveVersion; } private: - long double gain; + double gain; uint32_t fpd; }; diff --git a/plugins/MacAU/Remap/Remap.cpp b/plugins/MacAU/Remap/Remap.cpp index 6356423a8..90c924eb2 100755 --- a/plugins/MacAU/Remap/Remap.cpp +++ b/plugins/MacAU/Remap/Remap.cpp @@ -195,12 +195,12 @@ void Remap::RemapKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - long double gaintrim = fabs(inputSample); - long double bridgerectifier = gaintrim*gain; + double gaintrim = fabs(inputSample); + double bridgerectifier = gaintrim*gain; if (gaintrim > 1.0) gaintrim = 1.0; else gaintrim *= gaintrim; diff --git a/plugins/MacAU/ResEQ/ResEQ.cpp b/plugins/MacAU/ResEQ/ResEQ.cpp index 3c3f93d69..835073053 100755 --- a/plugins/MacAU/ResEQ/ResEQ.cpp +++ b/plugins/MacAU/ResEQ/ResEQ.cpp @@ -334,9 +334,9 @@ void ResEQ::ResEQKernel::Process( const Float32 *inSourceP, //done updating the kernel for this go-round while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; b[59] = b[58]; b[58] = b[57]; b[57] = b[56]; b[56] = b[55]; b[55] = b[54]; b[54] = b[53]; b[53] = b[52]; b[52] = b[51]; b[51] = b[50]; b[50] = b[49]; b[49] = b[48]; b[48] = b[47]; b[47] = b[46]; b[46] = b[45]; b[45] = b[44]; b[44] = b[43]; b[43] = b[42]; b[42] = b[41]; b[41] = b[40]; b[40] = b[39]; b[39] = b[38]; diff --git a/plugins/MacAU/Reverb/Reverb.cpp b/plugins/MacAU/Reverb/Reverb.cpp index 3a58ddab7..d10cfb4d9 100755 --- a/plugins/MacAU/Reverb/Reverb.cpp +++ b/plugins/MacAU/Reverb/Reverb.cpp @@ -297,8 +297,8 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, biquadC[6] = (1.0 - K / biquadC[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; aM[countM] = inputSample; @@ -306,7 +306,7 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, inputSample = aM[countM]; //predelay - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -315,10 +315,10 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; diff --git a/plugins/MacAU/Reverb/Reverb.h b/plugins/MacAU/Reverb/Reverb.h index cee672ef5..6a827503a 100755 --- a/plugins/MacAU/Reverb/Reverb.h +++ b/plugins/MacAU/Reverb/Reverb.h @@ -126,9 +126,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacAU/Righteous4/Righteous4.cpp b/plugins/MacAU/Righteous4/Righteous4.cpp index d906edb87..a87e3ea00 100755 --- a/plugins/MacAU/Righteous4/Righteous4.cpp +++ b/plugins/MacAU/Righteous4/Righteous4.cpp @@ -228,7 +228,7 @@ void Righteous4::Righteous4Kernel::Reset() gwA = 0.0; gwB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -243,8 +243,8 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -274,31 +274,8 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, Float64 refclip = pow(10.0,-0.0058888); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; //begin the whole distortion dealiebop @@ -309,7 +286,7 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, Float64 secondharmonic = sin((2 * inputSample * inputSample) * IIRsample); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSample; + double bridgerectifier = inputSample; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -414,7 +391,7 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, if (bitDepth == 3) { //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } else { diff --git a/plugins/MacAU/Righteous4/Righteous4.h b/plugins/MacAU/Righteous4/Righteous4.h index 1cf11d4ea..446fc6246 100755 --- a/plugins/MacAU/Righteous4/Righteous4.h +++ b/plugins/MacAU/Righteous4/Righteous4.h @@ -165,7 +165,7 @@ public: Float64 midSampleZ; Float64 byn[13]; - long double noiseShaping; + double noiseShaping; Float64 lastSample; Float64 IIRsample; @@ -174,7 +174,7 @@ public: Float64 gwA; Float64 gwB; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacAU/SideDull/SideDull.cpp b/plugins/MacAU/SideDull/SideDull.cpp index 2b75d722f..f8547e940 100755 --- a/plugins/MacAU/SideDull/SideDull.cpp +++ b/plugins/MacAU/SideDull/SideDull.cpp @@ -197,9 +197,9 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; Float64 side; Float64 overallscale = 1.0; overallscale /= 44100.0; @@ -210,44 +210,8 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -270,7 +234,7 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/SideDull/SideDull.h b/plugins/MacAU/SideDull/SideDull.h index 85fd8d5db..515b969f6 100755 --- a/plugins/MacAU/SideDull/SideDull.h +++ b/plugins/MacAU/SideDull/SideDull.h @@ -112,8 +112,8 @@ private: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/Sidepass/Sidepass.cpp b/plugins/MacAU/Sidepass/Sidepass.cpp index 137913722..d4ac2045e 100755 --- a/plugins/MacAU/Sidepass/Sidepass.cpp +++ b/plugins/MacAU/Sidepass/Sidepass.cpp @@ -176,8 +176,8 @@ ComponentResult Sidepass::Reset(AudioUnitScope inScope, AudioUnitElement inElem iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -198,9 +198,9 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; Float64 side; Float64 overallscale = 1.0; overallscale /= 44100.0; @@ -211,44 +211,8 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -271,7 +235,7 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Sidepass/Sidepass.h b/plugins/MacAU/Sidepass/Sidepass.h index 4ac346b17..6a7f62b42 100755 --- a/plugins/MacAU/Sidepass/Sidepass.h +++ b/plugins/MacAU/Sidepass/Sidepass.h @@ -112,8 +112,8 @@ private: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.cpp b/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.cpp index 9c0da6216..bb368eebd 100755 --- a/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.cpp +++ b/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.cpp @@ -183,7 +183,7 @@ ComponentResult SingleEndedTriode::Initialize() void SingleEndedTriode::SingleEndedTriodeKernel::Reset() { postsine = sin(0.5); - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,27 +208,9 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; @@ -236,7 +218,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou { inputSample *= intensity; inputSample -= 0.5; - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSample > 0) inputSample = bridgerectifier; @@ -247,7 +229,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSample > 0.0) inputSample = bridgerectifier; @@ -257,7 +239,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSample > 0.0) inputSample = bridgerectifier; @@ -268,11 +250,11 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou inputSample = (drySample * dry)+(inputSample*wet); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.h b/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.h index 243efa600..20dd706f7 100755 --- a/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.h +++ b/plugins/MacAU/SingleEndedTriode/SingleEndedTriode.h @@ -135,7 +135,7 @@ public: private: Float64 postsine; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Slew/Slew.cpp b/plugins/MacAU/Slew/Slew.cpp index 5eee0abad..76e5d61ec 100755 --- a/plugins/MacAU/Slew/Slew.cpp +++ b/plugins/MacAU/Slew/Slew.cpp @@ -159,7 +159,7 @@ ComponentResult Slew::Initialize() void Slew::SlewKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -190,30 +190,7 @@ void Slew::SlewKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; @@ -227,7 +204,7 @@ void Slew::SlewKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/Slew/Slew.h b/plugins/MacAU/Slew/Slew.h index 95bf7c2cd..84a3b7590 100755 --- a/plugins/MacAU/Slew/Slew.h +++ b/plugins/MacAU/Slew/Slew.h @@ -124,7 +124,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Slew2/Slew2.cpp b/plugins/MacAU/Slew2/Slew2.cpp index d9a509314..62d3de036 100755 --- a/plugins/MacAU/Slew2/Slew2.cpp +++ b/plugins/MacAU/Slew2/Slew2.cpp @@ -165,7 +165,7 @@ void Slew2::Slew2Kernel::Reset() ataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity ataFlip = false; //end reset of antialias parameters lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -189,30 +189,7 @@ void Slew2::Slew2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample; ataHalfDrySample = ataHalfwaySample = (inputSample + ataLast1Sample + ((-ataLast2Sample + ataLast3Sample) * ataUpsampleHighTweak)) / 2.0; @@ -255,11 +232,11 @@ void Slew2::Slew2Kernel::Process( const Float32 *inSourceP, ataPrevDiffSample = ataDiffSample / 2.0; //apply processing as difference to non-oversampled raw input - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacAU/Slew2/Slew2.h b/plugins/MacAU/Slew2/Slew2.h index 4e16def2c..4881182b5 100755 --- a/plugins/MacAU/Slew2/Slew2.h +++ b/plugins/MacAU/Slew2/Slew2.h @@ -141,7 +141,7 @@ public: Float64 ataPrevDiffSample; bool ataFlip; //end defining of antialiasing variables Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Slew3/Slew3.cpp b/plugins/MacAU/Slew3/Slew3.cpp index 4c1c85fd9..375f6f5c3 100755 --- a/plugins/MacAU/Slew3/Slew3.cpp +++ b/plugins/MacAU/Slew3/Slew3.cpp @@ -181,8 +181,8 @@ void Slew3::Slew3Kernel::Process( const Float32 *inSourceP, Float64 threshold = pow((1-GetParameter( kParam_One )),4)/overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 clamp = (lastSampleB - lastSampleC) * 0.381966011250105; clamp -= (lastSampleA - lastSampleB) * 0.6180339887498948482045; diff --git a/plugins/MacAU/SlewOnly/SlewOnly.cpp b/plugins/MacAU/SlewOnly/SlewOnly.cpp index 1cd7a74f9..b1df59cd9 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.cpp +++ b/plugins/MacAU/SlewOnly/SlewOnly.cpp @@ -151,7 +151,7 @@ ComponentResult SlewOnly::Initialize() void SlewOnly::SlewOnlyKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -172,30 +172,7 @@ void SlewOnly::SlewOnlyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = (inputSample - lastSample)*trim; @@ -205,7 +182,7 @@ void SlewOnly::SlewOnlyKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/SlewOnly/SlewOnly.h b/plugins/MacAU/SlewOnly/SlewOnly.h index 8b310928f..08b9e1500 100755 --- a/plugins/MacAU/SlewOnly/SlewOnly.h +++ b/plugins/MacAU/SlewOnly/SlewOnly.h @@ -122,7 +122,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Smooth/Smooth.cpp b/plugins/MacAU/Smooth/Smooth.cpp index fb0eba743..24d44a72d 100755 --- a/plugins/MacAU/Smooth/Smooth.cpp +++ b/plugins/MacAU/Smooth/Smooth.cpp @@ -211,28 +211,10 @@ void Smooth::SmoothKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; clamp = fabs(inputSample - lastSampleA); clamp = sin(clamp*ratio); diff --git a/plugins/MacAU/SoftGate/SoftGate.cpp b/plugins/MacAU/SoftGate/SoftGate.cpp index e69dab8f8..f8ce5adc7 100755 --- a/plugins/MacAU/SoftGate/SoftGate.cpp +++ b/plugins/MacAU/SoftGate/SoftGate.cpp @@ -211,7 +211,7 @@ OSStatus SoftGate::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -222,8 +222,8 @@ OSStatus SoftGate::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float64 invrec = 1.0 - recovery; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; storedL[1] = storedL[0]; diff --git a/plugins/MacAU/SoftGateMono/SoftGateMono.cpp b/plugins/MacAU/SoftGateMono/SoftGateMono.cpp index a33b492f7..be31c59a9 100755 --- a/plugins/MacAU/SoftGateMono/SoftGateMono.cpp +++ b/plugins/MacAU/SoftGateMono/SoftGateMono.cpp @@ -192,7 +192,7 @@ void SoftGateMono::SoftGateMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 threshold = pow(GetParameter( kParam_One ),6); @@ -202,8 +202,8 @@ void SoftGateMono::SoftGateMonoKernel::Process( const Float32 *inSourceP, Float64 invrec = 1.0 - recovery; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; storedL[1] = storedL[0]; storedL[0] = inputSample; diff --git a/plugins/MacAU/SpatializeDither/SpatializeDither.cpp b/plugins/MacAU/SpatializeDither/SpatializeDither.cpp index ee067fb8e..f9f6ca458 100755 --- a/plugins/MacAU/SpatializeDither/SpatializeDither.cpp +++ b/plugins/MacAU/SpatializeDither/SpatializeDither.cpp @@ -199,7 +199,7 @@ void SpatializeDither::SpatializeDitherKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 contingentRnd; Float64 absSample; Float64 contingent; @@ -221,7 +221,7 @@ void SpatializeDither::SpatializeDitherKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacAU/Spiral/Spiral.cpp b/plugins/MacAU/Spiral/Spiral.cpp index 1c4975d37..309ef1c0c 100755 --- a/plugins/MacAU/Spiral/Spiral.cpp +++ b/plugins/MacAU/Spiral/Spiral.cpp @@ -167,9 +167,9 @@ void Spiral::SpiralKernel::Process( const Float32 *inSourceP, Float32 *destP = inDestP; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; //clip to 1.2533141373155 to reach maximum output diff --git a/plugins/MacAU/Spiral2/Spiral2.cpp b/plugins/MacAU/Spiral2/Spiral2.cpp index 5c6b2961d..0dfe5870a 100755 --- a/plugins/MacAU/Spiral2/Spiral2.cpp +++ b/plugins/MacAU/Spiral2/Spiral2.cpp @@ -219,9 +219,9 @@ void Spiral2::Spiral2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; @@ -240,7 +240,7 @@ void Spiral2::Spiral2Kernel::Process( const Float32 *inSourceP, } //highpass section - long double presenceSample = sin(inputSample * fabs(prevSample)) / ((prevSample == 0.0) ?1:fabs(prevSample)); + double presenceSample = sin(inputSample * fabs(prevSample)) / ((prevSample == 0.0) ?1:fabs(prevSample)); //change from first Spiral: delay of one sample on the scaling factor. inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); diff --git a/plugins/MacAU/Spiral2/Spiral2.h b/plugins/MacAU/Spiral2/Spiral2.h index 90912bf69..1cf41aee7 100755 --- a/plugins/MacAU/Spiral2/Spiral2.h +++ b/plugins/MacAU/Spiral2/Spiral2.h @@ -138,9 +138,9 @@ public: virtual void Reset(); private: - long double iirSampleA; - long double iirSampleB; - long double prevSample; + double iirSampleA; + double iirSampleB; + double prevSample; uint32_t fpd; bool flip; }; diff --git a/plugins/MacAU/Srsly/Srsly.cpp b/plugins/MacAU/Srsly/Srsly.cpp index 6f59e60fb..01dce0b60 100755 --- a/plugins/MacAU/Srsly/Srsly.cpp +++ b/plugins/MacAU/Srsly/Srsly.cpp @@ -237,7 +237,7 @@ OSStatus Srsly::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 sampleRate = GetSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -348,10 +348,10 @@ OSStatus Srsly::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //[10] is RIGHT stored delayed sample (you have to include the coefficient making code if you do that) while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -359,70 +359,70 @@ OSStatus Srsly::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; diff --git a/plugins/MacAU/Srsly/Srsly.h b/plugins/MacAU/Srsly/Srsly.h index 3b91e240f..42ba47dd6 100755 --- a/plugins/MacAU/Srsly/Srsly.h +++ b/plugins/MacAU/Srsly/Srsly.h @@ -121,17 +121,17 @@ public: virtual ComponentResult Version() { return kSrslyVersion; } private: - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacAU/Srsly2/Srsly2.cpp b/plugins/MacAU/Srsly2/Srsly2.cpp index bb92bdb76..27e560cca 100755 --- a/plugins/MacAU/Srsly2/Srsly2.cpp +++ b/plugins/MacAU/Srsly2/Srsly2.cpp @@ -237,7 +237,7 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 sampleRate = GetSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -353,10 +353,10 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //[10] is RIGHT stored delayed sample (you have to include the coefficient making code if you do that) while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -365,70 +365,70 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; diff --git a/plugins/MacAU/Srsly2/Srsly2.h b/plugins/MacAU/Srsly2/Srsly2.h index 5b8cc636a..b9ae4c51e 100755 --- a/plugins/MacAU/Srsly2/Srsly2.h +++ b/plugins/MacAU/Srsly2/Srsly2.h @@ -121,17 +121,17 @@ public: virtual ComponentResult Version() { return kSrsly2Version; } private: - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacAU/StarChild/StarChild.cpp b/plugins/MacAU/StarChild/StarChild.cpp index 850d80eb5..42031966c 100755 --- a/plugins/MacAU/StarChild/StarChild.cpp +++ b/plugins/MacAU/StarChild/StarChild.cpp @@ -238,8 +238,8 @@ ComponentResult StarChild::Reset(AudioUnitScope inScope, AudioUnitElement inEle increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -320,44 +320,8 @@ OSStatus StarChild::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables like the dry - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -634,7 +598,7 @@ OSStatus StarChild::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)drySampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); drySampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)drySampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/StarChild/StarChild.h b/plugins/MacAU/StarChild/StarChild.h index 239daeff0..2efa380a8 100755 --- a/plugins/MacAU/StarChild/StarChild.h +++ b/plugins/MacAU/StarChild/StarChild.h @@ -133,8 +133,8 @@ private: Float64 wearLPrev; Float64 wearRPrev; - long double fpNShapeR; - long double fpNShapeL; + double fpNShapeR; + double fpNShapeL; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/StereoFX/StereoFX.cpp b/plugins/MacAU/StereoFX/StereoFX.cpp index 0c32089f6..3a292a12a 100755 --- a/plugins/MacAU/StereoFX/StereoFX.cpp +++ b/plugins/MacAU/StereoFX/StereoFX.cpp @@ -190,8 +190,8 @@ ComponentResult StereoFX::Reset(AudioUnitScope inScope, AudioUnitElement inElem iirSampleA = 0.0; iirSampleB = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -213,10 +213,10 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section Float64 stereowide = GetParameter( kParam_One ); Float64 centersquish = GetParameter( kParam_Three ); @@ -235,44 +235,8 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -333,7 +297,7 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/StereoFX/StereoFX.h b/plugins/MacAU/StereoFX/StereoFX.h index a52f713d7..f7f216256 100755 --- a/plugins/MacAU/StereoFX/StereoFX.h +++ b/plugins/MacAU/StereoFX/StereoFX.h @@ -119,8 +119,8 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; }; diff --git a/plugins/MacAU/StudioTan/StudioTan.cpp b/plugins/MacAU/StudioTan/StudioTan.cpp index a4d0221be..ba1afcb23 100755 --- a/plugins/MacAU/StudioTan/StudioTan.cpp +++ b/plugins/MacAU/StudioTan/StudioTan.cpp @@ -221,9 +221,9 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample; - long double outputSample; - long double drySample; + double inputSample; + double outputSample; + double drySample; if (highres) inputSample = *sourceP * 8388608.0; else inputSample = *sourceP * 32768.0; @@ -234,7 +234,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, cutbins = false; drySample = inputSample; inputSample -= noiseShaping; - long double benfordize = floor(inputSample); + double benfordize = floor(inputSample); while (benfordize >= 1.0) {benfordize /= 10;} if (benfordize < 1.0) {benfordize *= 10;} if (benfordize < 1.0) {benfordize *= 10;} @@ -243,7 +243,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { byn[hotbinA] += 1; @@ -270,7 +270,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { byn[hotbinB] += 1; @@ -334,7 +334,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, } //shared output stage - long double noiseSuppress = fabs(inputSample); + double noiseSuppress = fabs(inputSample); if (noiseShaping > noiseSuppress) noiseShaping = noiseSuppress; if (noiseShaping < -noiseSuppress) noiseShaping = -noiseSuppress; diff --git a/plugins/MacAU/StudioTan/StudioTan.h b/plugins/MacAU/StudioTan/StudioTan.h index 37a4d4316..79ab64d39 100755 --- a/plugins/MacAU/StudioTan/StudioTan.h +++ b/plugins/MacAU/StudioTan/StudioTan.h @@ -137,10 +137,10 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double lastSample; - long double lastSample2; + double byn[13]; + double noiseShaping; + double lastSample; + double lastSample2; }; }; diff --git a/plugins/MacAU/SubsOnly/SubsOnly.cpp b/plugins/MacAU/SubsOnly/SubsOnly.cpp index cfa37b02b..56802050b 100755 --- a/plugins/MacAU/SubsOnly/SubsOnly.cpp +++ b/plugins/MacAU/SubsOnly/SubsOnly.cpp @@ -176,7 +176,7 @@ void SubsOnly::SubsOnlyKernel::Reset() iirSampleX = 0.0; iirSampleY = 0.0; iirSampleZ = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -203,30 +203,7 @@ void SubsOnly::SubsOnlyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; gain = gaintarget; inputSample *= gain; gain = ((gain-1)*0.75)+1; @@ -335,11 +312,11 @@ void SubsOnly::SubsOnlyKernel::Process( const Float32 *inSourceP, if (inputSample < -1.0) inputSample = -1.0; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; destP += inNumChannels; diff --git a/plugins/MacAU/SubsOnly/SubsOnly.h b/plugins/MacAU/SubsOnly/SubsOnly.h index a2efe962e..940157d56 100755 --- a/plugins/MacAU/SubsOnly/SubsOnly.h +++ b/plugins/MacAU/SubsOnly/SubsOnly.h @@ -147,7 +147,7 @@ public: Float64 iirSampleX; Float64 iirSampleY; Float64 iirSampleZ; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Surge/Surge.cpp b/plugins/MacAU/Surge/Surge.cpp index af2adf465..200d15dea 100755 --- a/plugins/MacAU/Surge/Surge.cpp +++ b/plugins/MacAU/Surge/Surge.cpp @@ -181,8 +181,8 @@ ComponentResult Surge::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Surge::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -208,10 +208,10 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 chaseMax = 0.0; Float64 intensity = (1.0-(pow((1.0-GetParameter( kParam_One )),2)))*0.7; @@ -224,44 +224,8 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -307,7 +271,7 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Surge/Surge.h b/plugins/MacAU/Surge/Surge.h index 0d24ad77a..7649dcb58 100755 --- a/plugins/MacAU/Surge/Surge.h +++ b/plugins/MacAU/Surge/Surge.h @@ -112,13 +112,13 @@ public: virtual ComponentResult Version() { return kSurgeVersion; } private: - long double fpNShapeL; - long double fpNShapeR; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + uint32_t fpdL; + uint32_t fpdR; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacAU/SurgeMono/SurgeMono.cpp b/plugins/MacAU/SurgeMono/SurgeMono.cpp index 8909d58b6..adece7301 100755 --- a/plugins/MacAU/SurgeMono/SurgeMono.cpp +++ b/plugins/MacAU/SurgeMono/SurgeMono.cpp @@ -166,7 +166,7 @@ ComponentResult SurgeMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void SurgeMono::SurgeMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -186,11 +186,11 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 chaseMax = 0.0; Float64 intensity = (1.0-(pow((1.0-GetParameter( kParam_One )),2)))*0.7; Float64 attack = ((intensity+0.1)*0.0005)/overallscale; @@ -201,30 +201,7 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= 8.0; @@ -258,11 +235,11 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, inputSample = drySample - (inputSample * intensity); inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/SurgeMono/SurgeMono.h b/plugins/MacAU/SurgeMono/SurgeMono.h index 692d325c4..4ca90b8db 100755 --- a/plugins/MacAU/SurgeMono/SurgeMono.h +++ b/plugins/MacAU/SurgeMono/SurgeMono.h @@ -128,12 +128,12 @@ public: virtual void Reset(); private: - long double fpNShape; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + uint32_t fpd; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; }; }; diff --git a/plugins/MacAU/SurgeTide/SurgeTide.cpp b/plugins/MacAU/SurgeTide/SurgeTide.cpp index 3a415f2bb..54617f206 100755 --- a/plugins/MacAU/SurgeTide/SurgeTide.cpp +++ b/plugins/MacAU/SurgeTide/SurgeTide.cpp @@ -188,8 +188,8 @@ ComponentResult SurgeTide::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult SurgeTide::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -213,10 +213,10 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 intensity = GetParameter( kParam_One ); Float64 attack = ((GetParameter( kParam_Two )+0.1)*0.0005)/overallscale; @@ -229,44 +229,8 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -304,7 +268,7 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/SurgeTide/SurgeTide.h b/plugins/MacAU/SurgeTide/SurgeTide.h index a72f6c64a..21a482e11 100755 --- a/plugins/MacAU/SurgeTide/SurgeTide.h +++ b/plugins/MacAU/SurgeTide/SurgeTide.h @@ -115,11 +115,11 @@ public: virtual ComponentResult Version() { return kSurgeTideVersion; } private: - long double fpNShapeL; - long double fpNShapeR; - long double chaseA; - long double chaseB; - long double chaseC; + double fpNShapeL; + double fpNShapeR; + double chaseA; + double chaseB; + double chaseC; }; diff --git a/plugins/MacAU/SurgeTideMono/SurgeTideMono.cpp b/plugins/MacAU/SurgeTideMono/SurgeTideMono.cpp index 2bbd97298..93926dc5e 100755 --- a/plugins/MacAU/SurgeTideMono/SurgeTideMono.cpp +++ b/plugins/MacAU/SurgeTideMono/SurgeTideMono.cpp @@ -174,7 +174,7 @@ ComponentResult SurgeTideMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void SurgeTideMono::SurgeTideMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -192,11 +192,11 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 intensity = GetParameter( kParam_One ); Float64 attack = ((GetParameter( kParam_Two )+0.1)*0.0005)/overallscale; Float64 decay = ((GetParameter( kParam_Two )+0.001)*0.00005)/overallscale; @@ -206,30 +206,7 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= 8.0; @@ -255,11 +232,11 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, inputSample = drySample - (inputSample * intensity); inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/SurgeTideMono/SurgeTideMono.h b/plugins/MacAU/SurgeTideMono/SurgeTideMono.h index 067d2e586..e173f6ff8 100755 --- a/plugins/MacAU/SurgeTideMono/SurgeTideMono.h +++ b/plugins/MacAU/SurgeTideMono/SurgeTideMono.h @@ -131,10 +131,10 @@ public: virtual void Reset(); private: - long double fpNShape; - long double chaseA; - long double chaseB; - long double chaseC; + uint32_t fpd; + double chaseA; + double chaseB; + double chaseC; }; }; diff --git a/plugins/MacAU/Swell/Swell.cpp b/plugins/MacAU/Swell/Swell.cpp index 09dec89d4..0662af78c 100755 --- a/plugins/MacAU/Swell/Swell.cpp +++ b/plugins/MacAU/Swell/Swell.cpp @@ -176,7 +176,7 @@ void Swell::SwellKernel::Reset() { swell = 0.0; louder = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -191,7 +191,7 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 thresholdOn = pow(GetParameter( kParam_One ),2) * GetParameter( kParam_Two ); @@ -201,35 +201,12 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); Float64 dry = 1.0 - wet; - long double drySample; - long double inputSample; + double drySample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -245,11 +222,11 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/Swell/Swell.h b/plugins/MacAU/Swell/Swell.h index fa354364e..75bff1357 100755 --- a/plugins/MacAU/Swell/Swell.h +++ b/plugins/MacAU/Swell/Swell.h @@ -132,9 +132,9 @@ public: private: - long double swell; + double swell; bool louder; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/TPDFDither/TPDFDither.cpp b/plugins/MacAU/TPDFDither/TPDFDither.cpp index a7c23f769..b1373a135 100755 --- a/plugins/MacAU/TPDFDither/TPDFDither.cpp +++ b/plugins/MacAU/TPDFDither/TPDFDither.cpp @@ -197,7 +197,7 @@ void TPDFDither::TPDFDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; bool highres = false; if (GetParameter( kParam_One ) == 1) highres = true; @@ -213,7 +213,7 @@ void TPDFDither::TPDFDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacAU/TPDFWide/TPDFWide.cpp b/plugins/MacAU/TPDFWide/TPDFWide.cpp index 165bab553..98d8c32f3 100644 --- a/plugins/MacAU/TPDFWide/TPDFWide.cpp +++ b/plugins/MacAU/TPDFWide/TPDFWide.cpp @@ -227,8 +227,8 @@ OSStatus TPDFWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag if (outScale < 8.0) outScale = 8.0; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -238,12 +238,12 @@ OSStatus TPDFWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/MacAU/Tape/Tape.cpp b/plugins/MacAU/Tape/Tape.cpp index edfd574a9..582164a18 100755 --- a/plugins/MacAU/Tape/Tape.cpp +++ b/plugins/MacAU/Tape/Tape.cpp @@ -188,7 +188,7 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -219,18 +219,18 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, biquadC[6] = biquadD[6] = (1.0 - K / biquadD[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputgain < 1.0) { inputSample *= inputgain; } //gain cut before anything, even dry - long double drySample = inputSample; + double drySample = inputSample; - long double HighsSample = 0.0; - long double NonHighsSample = 0.0; - long double tempSample; + double HighsSample = 0.0; + double NonHighsSample = 0.0; + double tempSample; if (flip) { @@ -284,13 +284,13 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, } flip = !flip; - long double groundSample = drySample - inputSample; //set up UnBox + double groundSample = drySample - inputSample; //set up UnBox if (inputgain > 1.0) { inputSample *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSample)*1.57079633; + double applySoften = fabs(HighsSample)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSample > 0) inputSample -= applySoften; diff --git a/plugins/MacAU/Tape/Tape.h b/plugins/MacAU/Tape/Tape.h index 2aa9a8fe1..ed866e5c4 100755 --- a/plugins/MacAU/Tape/Tape.h +++ b/plugins/MacAU/Tape/Tape.h @@ -132,11 +132,11 @@ public: Float64 iirHeadBumpA; Float64 iirHeadBumpB; bool flip; - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double biquadD[9]; - long double lastSample; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double biquadD[9]; + double lastSample; uint32_t fpd; }; }; diff --git a/plugins/MacAU/TapeDelay/TapeDelay.cpp b/plugins/MacAU/TapeDelay/TapeDelay.cpp index 8f0ea2bde..aeeb77051 100755 --- a/plugins/MacAU/TapeDelay/TapeDelay.cpp +++ b/plugins/MacAU/TapeDelay/TapeDelay.cpp @@ -205,7 +205,7 @@ void TapeDelay::TapeDelayKernel::Reset() delay = 0; gcount = 0; chase = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -235,27 +235,9 @@ void TapeDelay::TapeDelayKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 128) {gcount = 128;} count = gcount; @@ -322,11 +304,11 @@ void TapeDelay::TapeDelayKernel::Process( const Float32 *inSourceP, //yes this is a second bounds check. it's cheap, check EVERY time inputSample = (inputSample * dry) + (d[delay] * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/TapeDelay/TapeDelay.h b/plugins/MacAU/TapeDelay/TapeDelay.h index 9d9440e23..7b99c60b0 100755 --- a/plugins/MacAU/TapeDelay/TapeDelay.h +++ b/plugins/MacAU/TapeDelay/TapeDelay.h @@ -148,7 +148,7 @@ public: int delay; int maxdelay; int chase; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/TapeDelay2/TapeDelay2.cpp b/plugins/MacAU/TapeDelay2/TapeDelay2.cpp index 7917f10e5..956936051 100644 --- a/plugins/MacAU/TapeDelay2/TapeDelay2.cpp +++ b/plugins/MacAU/TapeDelay2/TapeDelay2.cpp @@ -221,7 +221,7 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -270,8 +270,8 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; @@ -281,7 +281,7 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, int pos = floor(delay); Float64 newSample = inputSample + d[pos]*feedback; - long double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; + double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; regenFilter[7] = -(tempSample * regenFilter[5]) + regenFilter[8]; regenFilter[8] = (newSample * regenFilter[4]) - (tempSample * regenFilter[6]); newSample = tempSample; diff --git a/plugins/MacAU/TapeDelay2/TapeDelay2.h b/plugins/MacAU/TapeDelay2/TapeDelay2.h index f13708fae..ab82a395f 100644 --- a/plugins/MacAU/TapeDelay2/TapeDelay2.h +++ b/plugins/MacAU/TapeDelay2/TapeDelay2.h @@ -145,8 +145,8 @@ public: Float64 prevSample; Float64 delay; Float64 sweep; - long double regenFilter[9]; - long double outFilter[9]; + double regenFilter[9]; + double outFilter[9]; double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacAU/TapeDither/TapeDither.cpp b/plugins/MacAU/TapeDither/TapeDither.cpp index 3db25a915..ce144d080 100755 --- a/plugins/MacAU/TapeDither/TapeDither.cpp +++ b/plugins/MacAU/TapeDither/TapeDither.cpp @@ -201,7 +201,7 @@ void TapeDither::TapeDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 currentDither; bool highres = false; @@ -217,7 +217,7 @@ void TapeDither::TapeDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacAU/TapeDust/TapeDust.cpp b/plugins/MacAU/TapeDust/TapeDust.cpp index c58633942..a6ffb6457 100755 --- a/plugins/MacAU/TapeDust/TapeDust.cpp +++ b/plugins/MacAU/TapeDust/TapeDust.cpp @@ -167,7 +167,7 @@ ComponentResult TapeDust::Initialize() void TapeDust::TapeDustKernel::Reset() { for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -183,7 +183,7 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 drySample; Float64 rRange = pow(GetParameter( kParam_One ),2)*5.0; Float64 xfuzz = rRange * 0.002; @@ -195,30 +195,7 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; for(int count = 9; count < 0; count--) { @@ -248,11 +225,11 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/TapeDust/TapeDust.h b/plugins/MacAU/TapeDust/TapeDust.h index 6898d7e27..2a992c3d2 100755 --- a/plugins/MacAU/TapeDust/TapeDust.h +++ b/plugins/MacAU/TapeDust/TapeDust.h @@ -130,7 +130,7 @@ public: private: Float64 b[11]; Float64 f[11]; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacAU/TapeFat/TapeFat.cpp b/plugins/MacAU/TapeFat/TapeFat.cpp index 42e9d607d..8b63ffa65 100755 --- a/plugins/MacAU/TapeFat/TapeFat.cpp +++ b/plugins/MacAU/TapeFat/TapeFat.cpp @@ -169,7 +169,7 @@ void TapeFat::TapeFatKernel::Reset() { for (int count = 0; count < 257; count++) {p[count] = 0;} gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,27 +193,9 @@ void TapeFat::TapeFatKernel::Process( const Float32 *inSourceP, int count; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 128) {gcount = 128;} count = gcount; @@ -263,11 +245,11 @@ void TapeFat::TapeFatKernel::Process( const Float32 *inSourceP, gcount--; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/TapeFat/TapeFat.h b/plugins/MacAU/TapeFat/TapeFat.h index 07e0ae1e0..10bd95d40 100755 --- a/plugins/MacAU/TapeFat/TapeFat.h +++ b/plugins/MacAU/TapeFat/TapeFat.h @@ -132,7 +132,7 @@ public: private: int p[257]; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Thunder/Thunder.cpp b/plugins/MacAU/Thunder/Thunder.cpp index f9dc65773..9c2cdb8e5 100755 --- a/plugins/MacAU/Thunder/Thunder.cpp +++ b/plugins/MacAU/Thunder/Thunder.cpp @@ -179,8 +179,8 @@ ComponentResult Thunder::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Thunder::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -238,50 +238,14 @@ OSStatus Thunder::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float64 resultML; Float64 resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -422,7 +386,7 @@ OSStatus Thunder::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Thunder/Thunder.h b/plugins/MacAU/Thunder/Thunder.h index 233c3db28..ca1606fe5 100755 --- a/plugins/MacAU/Thunder/Thunder.h +++ b/plugins/MacAU/Thunder/Thunder.h @@ -129,8 +129,8 @@ private: Float64 iirSampleAM; Float64 iirSampleBM; Float64 iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; }; diff --git a/plugins/MacAU/ToTape5/ToTape5.cpp b/plugins/MacAU/ToTape5/ToTape5.cpp index 2135e1d0c..1c9660b55 100755 --- a/plugins/MacAU/ToTape5/ToTape5.cpp +++ b/plugins/MacAU/ToTape5/ToTape5.cpp @@ -238,7 +238,7 @@ void ToTape5::ToTape5Kernel::Reset() sweep = 0.0; rateof = 0.5; nextmax = 0.5; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -256,7 +256,7 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! Float64 inputgain = pow(GetParameter( kParam_One )+1.0,3); Float64 outputgain = GetParameter( kParam_Five ); @@ -294,34 +294,11 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, SInt32 count; Float64 tempSample; Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; flutterrandy = (rand()/(double)RAND_MAX); @@ -472,11 +449,11 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/ToTape5/ToTape5.h b/plugins/MacAU/ToTape5/ToTape5.h index 250d9a56a..987ed190e 100755 --- a/plugins/MacAU/ToTape5/ToTape5.h +++ b/plugins/MacAU/ToTape5/ToTape5.h @@ -185,7 +185,7 @@ public: Float64 iirSampleY; Float64 iirSampleZ; int flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/ToTape6/ToTape6.cpp b/plugins/MacAU/ToTape6/ToTape6.cpp index 30e06f431..49ec384d7 100755 --- a/plugins/MacAU/ToTape6/ToTape6.cpp +++ b/plugins/MacAU/ToTape6/ToTape6.cpp @@ -225,7 +225,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -264,9 +264,9 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Six ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (inputgain < 1.0) { inputSample *= inputgain; @@ -280,7 +280,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSample = (d[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -297,10 +297,10 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, } gcount--; - long double vibDrySample = inputSample; - long double HighsSample = 0.0; - long double NonHighsSample = 0.0; - long double tempSample; + double vibDrySample = inputSample; + double HighsSample = 0.0; + double NonHighsSample = 0.0; + double tempSample; if (flip) { @@ -354,13 +354,13 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, } flip = !flip; - long double groundSample = vibDrySample - inputSample; //set up UnBox on fluttered audio + double groundSample = vibDrySample - inputSample; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSample *= inputgain; } //gain boost inside UnBox/Mojo - long double applySoften = fabs(HighsSample)*1.57079633; + double applySoften = fabs(HighsSample)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSample > 0) inputSample -= applySoften; @@ -379,7 +379,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacAU/ToTape6/ToTape6.h b/plugins/MacAU/ToTape6/ToTape6.h index 6c13952a5..249f804cf 100755 --- a/plugins/MacAU/ToTape6/ToTape6.h +++ b/plugins/MacAU/ToTape6/ToTape6.h @@ -149,12 +149,12 @@ public: Float64 iirMidRollerB; Float64 iirHeadBumpA; Float64 iirHeadBumpB; - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double biquadD[9]; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double biquadD[9]; bool flip; - long double lastSample; + double lastSample; uint32_t fpd; }; diff --git a/plugins/MacAU/ToVinyl4/ToVinyl4.cpp b/plugins/MacAU/ToVinyl4/ToVinyl4.cpp index 3f0d6e4bf..00ccc9b63 100755 --- a/plugins/MacAU/ToVinyl4/ToVinyl4.cpp +++ b/plugins/MacAU/ToVinyl4/ToVinyl4.cpp @@ -270,8 +270,8 @@ ComponentResult ToVinyl4::Reset(AudioUnitScope inScope, AudioUnitElement inElem s1R = s2R = s3R = 0.0; o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; @@ -490,44 +490,8 @@ OSStatus ToVinyl4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -736,7 +700,7 @@ OSStatus ToVinyl4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/ToneSlant/ToneSlant.cpp b/plugins/MacAU/ToneSlant/ToneSlant.cpp index 55f7435d6..32f5ffaf0 100755 --- a/plugins/MacAU/ToneSlant/ToneSlant.cpp +++ b/plugins/MacAU/ToneSlant/ToneSlant.cpp @@ -168,7 +168,7 @@ ComponentResult ToneSlant::Initialize() void ToneSlant::ToneSlantKernel::Reset() { for(int count = 0; count < 102; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -206,30 +206,7 @@ void ToneSlant::ToneSlantKernel::Process( const Float32 *inSourceP, for (int count = overallscale; count >= 0; count--) b[count+1] = b[count]; inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; b[0] = accumulatorSample = drySample = inputSample; @@ -242,11 +219,11 @@ void ToneSlant::ToneSlantKernel::Process( const Float32 *inSourceP, inputSample += (correctionSample * applySlant); //our one math operation on the input data coming in - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/ToneSlant/ToneSlant.h b/plugins/MacAU/ToneSlant/ToneSlant.h index 8f94128fe..9a33b8985 100755 --- a/plugins/MacAU/ToneSlant/ToneSlant.h +++ b/plugins/MacAU/ToneSlant/ToneSlant.h @@ -131,7 +131,7 @@ public: private: Float64 b[102]; Float64 f[102]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/TransDesk/TransDesk.cpp b/plugins/MacAU/TransDesk/TransDesk.cpp index f508b6712..05f8b1efd 100755 --- a/plugins/MacAU/TransDesk/TransDesk.cpp +++ b/plugins/MacAU/TransDesk/TransDesk.cpp @@ -157,7 +157,7 @@ void TransDesk::TransDeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -198,35 +198,12 @@ void TransDesk::TransDeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 9) {gcount = 9;} @@ -294,7 +271,7 @@ void TransDesk::TransDeskKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/TransDesk/TransDesk.h b/plugins/MacAU/TransDesk/TransDesk.h index 74799368c..d619f2855 100755 --- a/plugins/MacAU/TransDesk/TransDesk.h +++ b/plugins/MacAU/TransDesk/TransDesk.h @@ -120,8 +120,8 @@ public: Float64 d[20]; Float64 control; int gcount; - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; Float64 fpNShape; }; diff --git a/plugins/MacAU/TremoSquare/TremoSquare.cpp b/plugins/MacAU/TremoSquare/TremoSquare.cpp index d859d2b10..d32c1eea1 100755 --- a/plugins/MacAU/TremoSquare/TremoSquare.cpp +++ b/plugins/MacAU/TremoSquare/TremoSquare.cpp @@ -184,7 +184,7 @@ void TremoSquare::TremoSquareKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -192,8 +192,8 @@ void TremoSquare::TremoSquareKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; osc += increment; if (osc > 1.0) osc = 0.0; diff --git a/plugins/MacAU/Tremolo/Tremolo.cpp b/plugins/MacAU/Tremolo/Tremolo.cpp index 6e1f64459..cb4e27ca7 100755 --- a/plugins/MacAU/Tremolo/Tremolo.cpp +++ b/plugins/MacAU/Tremolo/Tremolo.cpp @@ -173,7 +173,7 @@ void Tremolo::TremoloKernel::Reset() depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -206,8 +206,8 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, Float64 density; Float64 tupi = 3.141592653589793238; - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 control; Float64 tempcontrol; Float64 thickness; @@ -217,30 +217,7 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; speedAmount = (((speedAmount*speedSpeed)+speedChase)/(speedSpeed + 1.0)); @@ -284,11 +261,11 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, //apply tremolo, apply gain boost to compensate for volume loss inputSample = (drySample * (1-depth)) + (inputSample*depth); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacAU/TripleSpread/TripleSpread.cpp b/plugins/MacAU/TripleSpread/TripleSpread.cpp index d711c763d..112afe727 100755 --- a/plugins/MacAU/TripleSpread/TripleSpread.cpp +++ b/plugins/MacAU/TripleSpread/TripleSpread.cpp @@ -250,12 +250,12 @@ OSStatus TripleSpread::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -520,8 +520,8 @@ OSStatus TripleSpread::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/MacAU/Tube/Tube.cpp b/plugins/MacAU/Tube/Tube.cpp index 389029558..90ba43bf4 100644 --- a/plugins/MacAU/Tube/Tube.cpp +++ b/plugins/MacAU/Tube/Tube.cpp @@ -175,7 +175,7 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -193,11 +193,11 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, double outputscaling = 1.0 + (1.0/(double)(powerfactor)); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleA; previousSampleA = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average @@ -227,7 +227,7 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, */ if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleB; previousSampleB = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average diff --git a/plugins/MacAU/Tube/Tube.h b/plugins/MacAU/Tube/Tube.h index 16413545f..6cde991fe 100644 --- a/plugins/MacAU/Tube/Tube.h +++ b/plugins/MacAU/Tube/Tube.h @@ -125,8 +125,8 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousSampleB; + double previousSampleA; + double previousSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Tube2/Tube2.cpp b/plugins/MacAU/Tube2/Tube2.cpp index 6ce01eccd..54ddad09c 100644 --- a/plugins/MacAU/Tube2/Tube2.cpp +++ b/plugins/MacAU/Tube2/Tube2.cpp @@ -184,7 +184,7 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -196,13 +196,13 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, double outputscaling = 1.0 + (1.0/(double)(powerfactor)); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputPad < 1.0) inputSample *= inputPad; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleA; previousSampleA = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average @@ -211,7 +211,7 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, //flatten bottom, point top of sine waveshaper inputSample /= asymPad; - long double sharpen = -inputSample; + double sharpen = -inputSample; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSample -= inputSample*fabs(inputSample)*sharpen*0.25; @@ -228,15 +228,15 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, inputSample *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleB; previousSampleB = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz - long double slew = previousSampleC - inputSample; + double slew = previousSampleC - inputSample; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleC; previousSampleC = stored; inputSample *= 0.5; } else previousSampleC = inputSample; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); diff --git a/plugins/MacAU/Tube2/Tube2.h b/plugins/MacAU/Tube2/Tube2.h index 36e9ca34b..a2ff1681f 100644 --- a/plugins/MacAU/Tube2/Tube2.h +++ b/plugins/MacAU/Tube2/Tube2.h @@ -128,9 +128,9 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; + double previousSampleA; + double previousSampleB; + double previousSampleC; uint32_t fpd; }; }; diff --git a/plugins/MacAU/TubeDesk/TubeDesk.cpp b/plugins/MacAU/TubeDesk/TubeDesk.cpp index cf2c04225..59186882a 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.cpp +++ b/plugins/MacAU/TubeDesk/TubeDesk.cpp @@ -157,7 +157,7 @@ void TubeDesk::TubeDeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -196,35 +196,12 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 2450) {gcount = 2450;} @@ -292,7 +269,7 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacAU/TubeDesk/TubeDesk.h b/plugins/MacAU/TubeDesk/TubeDesk.h index 393c14bad..bf44ecfd4 100755 --- a/plugins/MacAU/TubeDesk/TubeDesk.h +++ b/plugins/MacAU/TubeDesk/TubeDesk.h @@ -121,8 +121,8 @@ public: Float64 d[5000]; Float64 control; int gcount; - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; Float64 fpNShape; }; diff --git a/plugins/MacAU/UltrasonX/UltrasonX.cpp b/plugins/MacAU/UltrasonX/UltrasonX.cpp index 3ed1cda40..47b2e0beb 100644 --- a/plugins/MacAU/UltrasonX/UltrasonX.cpp +++ b/plugins/MacAU/UltrasonX/UltrasonX.cpp @@ -214,8 +214,8 @@ void UltrasonX::UltrasonXKernel::Process( const Float32 *inSourceP, break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -224,10 +224,10 @@ void UltrasonX::UltrasonXKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double temp = (inputSample * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSample * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSample * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSample * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSample = temp; //fixed biquad filtering ultrasonics diff --git a/plugins/MacAU/UltrasonX/UltrasonX.h b/plugins/MacAU/UltrasonX/UltrasonX.h index 1541107a4..6db40d451 100644 --- a/plugins/MacAU/UltrasonX/UltrasonX.h +++ b/plugins/MacAU/UltrasonX/UltrasonX.h @@ -148,7 +148,7 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/Ultrasonic/Ultrasonic.cpp b/plugins/MacAU/Ultrasonic/Ultrasonic.cpp index d48e51d5d..9d5c184c8 100755 --- a/plugins/MacAU/Ultrasonic/Ultrasonic.cpp +++ b/plugins/MacAU/Ultrasonic/Ultrasonic.cpp @@ -215,10 +215,10 @@ void Ultrasonic::UltrasonicKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/Ultrasonic/Ultrasonic.h b/plugins/MacAU/Ultrasonic/Ultrasonic.h index cf23e6f62..86605a999 100755 --- a/plugins/MacAU/Ultrasonic/Ultrasonic.h +++ b/plugins/MacAU/Ultrasonic/Ultrasonic.h @@ -121,11 +121,11 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/UltrasonicLite/UltrasonicLite.cpp b/plugins/MacAU/UltrasonicLite/UltrasonicLite.cpp index 840af879b..fb3818f73 100644 --- a/plugins/MacAU/UltrasonicLite/UltrasonicLite.cpp +++ b/plugins/MacAU/UltrasonicLite/UltrasonicLite.cpp @@ -180,10 +180,10 @@ void UltrasonicLite::UltrasonicLiteKernel::Process( const Float32 *inSourceP, biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/UltrasonicLite/UltrasonicLite.h b/plugins/MacAU/UltrasonicLite/UltrasonicLite.h index c8f236689..09ffe44fe 100644 --- a/plugins/MacAU/UltrasonicLite/UltrasonicLite.h +++ b/plugins/MacAU/UltrasonicLite/UltrasonicLite.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/UltrasonicMed/UltrasonicMed.cpp b/plugins/MacAU/UltrasonicMed/UltrasonicMed.cpp index 5b989e8b7..dec848c7f 100644 --- a/plugins/MacAU/UltrasonicMed/UltrasonicMed.cpp +++ b/plugins/MacAU/UltrasonicMed/UltrasonicMed.cpp @@ -193,10 +193,10 @@ void UltrasonicMed::UltrasonicMedKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacAU/UltrasonicMed/UltrasonicMed.h b/plugins/MacAU/UltrasonicMed/UltrasonicMed.h index fb57a5012..2e4d59615 100644 --- a/plugins/MacAU/UltrasonicMed/UltrasonicMed.h +++ b/plugins/MacAU/UltrasonicMed/UltrasonicMed.h @@ -121,8 +121,8 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/UnBox/UnBox.cpp b/plugins/MacAU/UnBox/UnBox.cpp index 7607af43d..73a97ad07 100755 --- a/plugins/MacAU/UnBox/UnBox.cpp +++ b/plugins/MacAU/UnBox/UnBox.cpp @@ -193,7 +193,7 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,12 +247,12 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (input != 1.0) inputSample *= input; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; a[4] = a[3]; a[3] = a[2]; a[2] = a[1]; a[1] = a[0]; a[0] = inputSample; @@ -280,7 +280,7 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, inputSample /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSample = (drySample - inputSample); + double accumulatorSample = (drySample - inputSample); c[9] = c[8]; c[8] = c[7]; c[7] = c[6]; c[6] = c[5]; c[5] = c[4]; c[4] = c[3]; c[3] = c[2]; c[2] = c[1]; c[1] = c[0]; c[0] = accumulatorSample; diff --git a/plugins/MacAU/UnBox/UnBox.h b/plugins/MacAU/UnBox/UnBox.h index 570a65efe..c7832d04d 100755 --- a/plugins/MacAU/UnBox/UnBox.h +++ b/plugins/MacAU/UnBox/UnBox.h @@ -130,13 +130,13 @@ public: virtual void Reset(); private: - long double a[5]; - long double b[5]; - long double c[11]; - long double e[5]; - long double f[11]; - long double iirSampleA; - long double iirSampleB; + double a[5]; + double b[5]; + double c[11]; + double e[5]; + double f[11]; + double iirSampleA; + double iirSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacAU/VariMu/VariMu.cpp b/plugins/MacAU/VariMu/VariMu.cpp index de02670c0..099a5bb96 100755 --- a/plugins/MacAU/VariMu/VariMu.cpp +++ b/plugins/MacAU/VariMu/VariMu.cpp @@ -189,7 +189,7 @@ void VariMu::VariMuKernel::Reset() muVary = 1; flip = false; previous = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -220,32 +220,14 @@ void VariMu::VariMuKernel::Process( const Float32 *inSourceP, Float64 coefficient; Float64 output = outGain * GetParameter( kParam_Three ); Float64 wet = GetParameter( kParam_Four ); - long double squaredSample; + double squaredSample; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (fabs(inputSample) > fabs(previous)) squaredSample = previous * previous; else squaredSample = inputSample * inputSample; @@ -331,11 +313,11 @@ void VariMu::VariMuKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/VariMu/VariMu.h b/plugins/MacAU/VariMu/VariMu.h index 9428e1ece..3ba594ad5 100755 --- a/plugins/MacAU/VariMu/VariMu.h +++ b/plugins/MacAU/VariMu/VariMu.h @@ -142,7 +142,7 @@ public: Float64 muCoefficientB; Float64 previous; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/Verbity/Verbity.cpp b/plugins/MacAU/Verbity/Verbity.cpp index f6d545ea0..71bdddaae 100755 --- a/plugins/MacAU/Verbity/Verbity.cpp +++ b/plugins/MacAU/Verbity/Verbity.cpp @@ -246,7 +246,7 @@ void Verbity::VerbityKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -286,8 +286,8 @@ void Verbity::VerbityKernel::Process( const Float32 *inSourceP, delayH = 1597.0*size; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (fabs(iirA)<1.18e-37) iirA = 0.0; diff --git a/plugins/MacAU/Vibrato/Vibrato.cpp b/plugins/MacAU/Vibrato/Vibrato.cpp index 11ca72303..0b914adba 100755 --- a/plugins/MacAU/Vibrato/Vibrato.cpp +++ b/plugins/MacAU/Vibrato/Vibrato.cpp @@ -222,8 +222,8 @@ void Vibrato::VibratoKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); //note: inv/dry/wet while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; airFactor = airPrev - inputSample; diff --git a/plugins/MacAU/VinylDither/VinylDither.cpp b/plugins/MacAU/VinylDither/VinylDither.cpp index 97740a030..0542ec1ae 100755 --- a/plugins/MacAU/VinylDither/VinylDither.cpp +++ b/plugins/MacAU/VinylDither/VinylDither.cpp @@ -215,7 +215,7 @@ void VinylDither::VinylDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 absSample; bool highres = false; @@ -232,7 +232,7 @@ void VinylDither::VinylDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp index cfc6806c4..050e91c73 100755 --- a/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp +++ b/plugins/MacAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp @@ -175,7 +175,7 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Reset() filterflip = false; for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -318,11 +318,11 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Process( const Float32 *inS flip = !flip; filterflip = !filterflip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacAU/VoiceTrick/VoiceTrick.cpp b/plugins/MacAU/VoiceTrick/VoiceTrick.cpp index d773486cf..bc272039a 100755 --- a/plugins/MacAU/VoiceTrick/VoiceTrick.cpp +++ b/plugins/MacAU/VoiceTrick/VoiceTrick.cpp @@ -209,8 +209,8 @@ OSStatus VoiceTrick::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 invLowpass; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,7 +218,7 @@ OSStatus VoiceTrick::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/MacAU/Wider/Wider.cpp b/plugins/MacAU/Wider/Wider.cpp index 3063f9716..0790d0731 100755 --- a/plugins/MacAU/Wider/Wider.cpp +++ b/plugins/MacAU/Wider/Wider.cpp @@ -189,8 +189,8 @@ ComponentResult Wider::Reset(AudioUnitScope inScope, AudioUnitElement inElement { for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -212,12 +212,12 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; Float64 drySampleL; Float64 drySampleR; - long double mid; - long double side; + double mid; + double side; Float64 out; Float64 densityside = GetParameter( kParam_One ); Float64 densitymid = GetParameter( kParam_Two ); @@ -240,44 +240,8 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -334,7 +298,7 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacAU/Wider/Wider.h b/plugins/MacAU/Wider/Wider.h index 5d5608fdc..f4788781f 100755 --- a/plugins/MacAU/Wider/Wider.h +++ b/plugins/MacAU/Wider/Wider.h @@ -118,8 +118,8 @@ public: private: Float64 p[4099]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; int count; }; diff --git a/plugins/MacAU/XBandpass/XBandpass.cpp b/plugins/MacAU/XBandpass/XBandpass.cpp index 00de16890..4f961d6c6 100644 --- a/plugins/MacAU/XBandpass/XBandpass.cpp +++ b/plugins/MacAU/XBandpass/XBandpass.cpp @@ -231,18 +231,18 @@ void XBandpass::XBandpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; inputSample *= clipFactor; outSample = biquad[2]*inputSample+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; diff --git a/plugins/MacAU/XBandpass/XBandpass.h b/plugins/MacAU/XBandpass/XBandpass.h index 2d4995cdd..d6e5dddcd 100644 --- a/plugins/MacAU/XBandpass/XBandpass.h +++ b/plugins/MacAU/XBandpass/XBandpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/XHighpass/XHighpass.cpp b/plugins/MacAU/XHighpass/XHighpass.cpp index 1c1f0900c..8cf426b03 100644 --- a/plugins/MacAU/XHighpass/XHighpass.cpp +++ b/plugins/MacAU/XHighpass/XHighpass.cpp @@ -228,18 +228,18 @@ void XHighpass::XHighpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; biquad[10] = biquad[9]; diff --git a/plugins/MacAU/XHighpass/XHighpass.h b/plugins/MacAU/XHighpass/XHighpass.h index 5686a1257..b99a55e7d 100644 --- a/plugins/MacAU/XHighpass/XHighpass.h +++ b/plugins/MacAU/XHighpass/XHighpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/XLowpass/XLowpass.cpp b/plugins/MacAU/XLowpass/XLowpass.cpp index 9fda88fe9..2a245f2a8 100644 --- a/plugins/MacAU/XLowpass/XLowpass.cpp +++ b/plugins/MacAU/XLowpass/XLowpass.cpp @@ -232,18 +232,18 @@ void XLowpass::XLowpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; biquad[10] = biquad[9]; diff --git a/plugins/MacAU/XLowpass/XLowpass.h b/plugins/MacAU/XLowpass/XLowpass.h index a0380d751..7527d73b8 100644 --- a/plugins/MacAU/XLowpass/XLowpass.h +++ b/plugins/MacAU/XLowpass/XLowpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/XNotch/XNotch.cpp b/plugins/MacAU/XNotch/XNotch.cpp index cbb3202a1..d587ca702 100644 --- a/plugins/MacAU/XNotch/XNotch.cpp +++ b/plugins/MacAU/XNotch/XNotch.cpp @@ -228,18 +228,18 @@ void XNotch::XNotchKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; if (inputSample > 1.57079633) inputSample = 1.57079633; if (inputSample < -1.57079633) inputSample = -1.57079633; diff --git a/plugins/MacAU/XNotch/XNotch.h b/plugins/MacAU/XNotch/XNotch.h index 07720df8e..19c7f7eb8 100644 --- a/plugins/MacAU/XNotch/XNotch.h +++ b/plugins/MacAU/XNotch/XNotch.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/XRegion/XRegion.cpp b/plugins/MacAU/XRegion/XRegion.cpp index 903b8735f..c944c2153 100644 --- a/plugins/MacAU/XRegion/XRegion.cpp +++ b/plugins/MacAU/XRegion/XRegion.cpp @@ -289,18 +289,18 @@ void XRegion::XRegionKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; inputSample *= clipFactor; if (inputSample > 1.57079633) inputSample = 1.57079633; diff --git a/plugins/MacAU/XRegion/XRegion.h b/plugins/MacAU/XRegion/XRegion.h index 1c143b1db..3f7adf52d 100644 --- a/plugins/MacAU/XRegion/XRegion.h +++ b/plugins/MacAU/XRegion/XRegion.h @@ -137,11 +137,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacAU/YBandpass/YBandpass.cpp b/plugins/MacAU/YBandpass/YBandpass.cpp index c508cb61f..9b257b779 100644 --- a/plugins/MacAU/YBandpass/YBandpass.cpp +++ b/plugins/MacAU/YBandpass/YBandpass.cpp @@ -218,7 +218,7 @@ void YBandpass::YBandpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YBandpass::YBandpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacAU/YBandpass/YBandpass.h b/plugins/MacAU/YBandpass/YBandpass.h index 214ad4ccc..e9616aa3d 100644 --- a/plugins/MacAU/YBandpass/YBandpass.h +++ b/plugins/MacAU/YBandpass/YBandpass.h @@ -165,15 +165,15 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - //long double biquadC[biq_total]; - //long double biquadD[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + //double biquadC[biq_total]; + //double biquadD[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -189,8 +189,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/YHighpass/YHighpass.cpp b/plugins/MacAU/YHighpass/YHighpass.cpp index 936a9253e..f3c1a4ccc 100644 --- a/plugins/MacAU/YHighpass/YHighpass.cpp +++ b/plugins/MacAU/YHighpass/YHighpass.cpp @@ -218,7 +218,7 @@ void YHighpass::YHighpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YHighpass::YHighpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacAU/YHighpass/YHighpass.h b/plugins/MacAU/YHighpass/YHighpass.h index 9648efcef..7006d6296 100644 --- a/plugins/MacAU/YHighpass/YHighpass.h +++ b/plugins/MacAU/YHighpass/YHighpass.h @@ -165,13 +165,13 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -187,8 +187,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/YLowpass/YLowpass.cpp b/plugins/MacAU/YLowpass/YLowpass.cpp index d981a9f27..19400d570 100644 --- a/plugins/MacAU/YLowpass/YLowpass.cpp +++ b/plugins/MacAU/YLowpass/YLowpass.cpp @@ -218,7 +218,7 @@ void YLowpass::YLowpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YLowpass::YLowpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacAU/YLowpass/YLowpass.h b/plugins/MacAU/YLowpass/YLowpass.h index 1c4f0b9d9..e176e3075 100644 --- a/plugins/MacAU/YLowpass/YLowpass.h +++ b/plugins/MacAU/YLowpass/YLowpass.h @@ -165,15 +165,15 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - //long double biquadC[biq_total]; - //long double biquadD[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + //double biquadC[biq_total]; + //double biquadD[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -189,8 +189,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/YNotch/YNotch.cpp b/plugins/MacAU/YNotch/YNotch.cpp index 27382a2ee..2e3caf4a3 100644 --- a/plugins/MacAU/YNotch/YNotch.cpp +++ b/plugins/MacAU/YNotch/YNotch.cpp @@ -218,7 +218,7 @@ void YNotch::YNotchKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YNotch::YNotchKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacAU/YNotch/YNotch.h b/plugins/MacAU/YNotch/YNotch.h index e66e18103..bf96cdc24 100644 --- a/plugins/MacAU/YNotch/YNotch.h +++ b/plugins/MacAU/YNotch/YNotch.h @@ -165,13 +165,13 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -187,8 +187,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/ZBandpass/ZBandpass.cpp b/plugins/MacAU/ZBandpass/ZBandpass.cpp index bae278aea..cd78ba168 100644 --- a/plugins/MacAU/ZBandpass/ZBandpass.cpp +++ b/plugins/MacAU/ZBandpass/ZBandpass.cpp @@ -199,7 +199,7 @@ void ZBandpass::ZBandpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,13 +248,13 @@ void ZBandpass::ZBandpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacAU/ZBandpass/ZBandpass.h b/plugins/MacAU/ZBandpass/ZBandpass.h index 1172eeb08..ab91edfb0 100644 --- a/plugins/MacAU/ZBandpass/ZBandpass.h +++ b/plugins/MacAU/ZBandpass/ZBandpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; diff --git a/plugins/MacAU/ZBandpass2/ZBandpass2.cpp b/plugins/MacAU/ZBandpass2/ZBandpass2.cpp index 810bf1db8..f9ce5d101 100644 --- a/plugins/MacAU/ZBandpass2/ZBandpass2.cpp +++ b/plugins/MacAU/ZBandpass2/ZBandpass2.cpp @@ -203,7 +203,7 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacAU/ZBandpass2/ZBandpass2.h b/plugins/MacAU/ZBandpass2/ZBandpass2.h index 7d4d7126d..c255dbe0f 100644 --- a/plugins/MacAU/ZBandpass2/ZBandpass2.h +++ b/plugins/MacAU/ZBandpass2/ZBandpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/ZHighpass/ZHighpass.cpp b/plugins/MacAU/ZHighpass/ZHighpass.cpp index c7d15e98f..4497d5cd3 100644 --- a/plugins/MacAU/ZHighpass/ZHighpass.cpp +++ b/plugins/MacAU/ZHighpass/ZHighpass.cpp @@ -199,7 +199,7 @@ void ZHighpass::ZHighpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -246,13 +246,13 @@ void ZHighpass::ZHighpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; - long double overallDrySample = drySample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacAU/ZHighpass/ZHighpass.h b/plugins/MacAU/ZHighpass/ZHighpass.h index b4383a484..e39d0ad87 100644 --- a/plugins/MacAU/ZHighpass/ZHighpass.h +++ b/plugins/MacAU/ZHighpass/ZHighpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; diff --git a/plugins/MacAU/ZHighpass2/ZHighpass2.cpp b/plugins/MacAU/ZHighpass2/ZHighpass2.cpp index bb710e2d2..2726f84d6 100644 --- a/plugins/MacAU/ZHighpass2/ZHighpass2.cpp +++ b/plugins/MacAU/ZHighpass2/ZHighpass2.cpp @@ -203,7 +203,7 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacAU/ZHighpass2/ZHighpass2.h b/plugins/MacAU/ZHighpass2/ZHighpass2.h index 55d87b397..c0d8bd6e6 100644 --- a/plugins/MacAU/ZHighpass2/ZHighpass2.h +++ b/plugins/MacAU/ZHighpass2/ZHighpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/ZLowpass/ZLowpass.cpp b/plugins/MacAU/ZLowpass/ZLowpass.cpp index b83a8aaaa..6a9e67fad 100644 --- a/plugins/MacAU/ZLowpass/ZLowpass.cpp +++ b/plugins/MacAU/ZLowpass/ZLowpass.cpp @@ -199,7 +199,7 @@ void ZLowpass::ZLowpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,13 +247,13 @@ void ZLowpass::ZLowpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacAU/ZLowpass/ZLowpass.h b/plugins/MacAU/ZLowpass/ZLowpass.h index 87390d1d4..a9c4b37f0 100644 --- a/plugins/MacAU/ZLowpass/ZLowpass.h +++ b/plugins/MacAU/ZLowpass/ZLowpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; }; diff --git a/plugins/MacAU/ZLowpass2/ZLowpass2.cpp b/plugins/MacAU/ZLowpass2/ZLowpass2.cpp index 4a4f60865..28b2cde81 100644 --- a/plugins/MacAU/ZLowpass2/ZLowpass2.cpp +++ b/plugins/MacAU/ZLowpass2/ZLowpass2.cpp @@ -203,7 +203,7 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacAU/ZLowpass2/ZLowpass2.h b/plugins/MacAU/ZLowpass2/ZLowpass2.h index 8cbf5499c..413464837 100644 --- a/plugins/MacAU/ZLowpass2/ZLowpass2.h +++ b/plugins/MacAU/ZLowpass2/ZLowpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/ZNotch/ZNotch.cpp b/plugins/MacAU/ZNotch/ZNotch.cpp index c5701740b..ee2f453b3 100644 --- a/plugins/MacAU/ZNotch/ZNotch.cpp +++ b/plugins/MacAU/ZNotch/ZNotch.cpp @@ -199,7 +199,7 @@ void ZNotch::ZNotchKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,13 +248,13 @@ void ZNotch::ZNotchKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacAU/ZNotch/ZNotch.h b/plugins/MacAU/ZNotch/ZNotch.h index 78f5cd3fe..ea6e11cf8 100644 --- a/plugins/MacAU/ZNotch/ZNotch.h +++ b/plugins/MacAU/ZNotch/ZNotch.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; }; diff --git a/plugins/MacAU/ZNotch2/ZNotch2.cpp b/plugins/MacAU/ZNotch2/ZNotch2.cpp index 024957db6..e4997aa80 100644 --- a/plugins/MacAU/ZNotch2/ZNotch2.cpp +++ b/plugins/MacAU/ZNotch2/ZNotch2.cpp @@ -203,7 +203,7 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacAU/ZNotch2/ZNotch2.h b/plugins/MacAU/ZNotch2/ZNotch2.h index 23bd41696..28609ff20 100644 --- a/plugins/MacAU/ZNotch2/ZNotch2.h +++ b/plugins/MacAU/ZNotch2/ZNotch2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacAU/curve/curve.cpp b/plugins/MacAU/curve/curve.cpp index bc34f6e46..bddf8e0bc 100755 --- a/plugins/MacAU/curve/curve.cpp +++ b/plugins/MacAU/curve/curve.cpp @@ -185,8 +185,8 @@ OSStatus curve::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, UInt32 nSampleFrames = inFramesToProcess; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; diff --git a/plugins/MacAU/curve/curve.h b/plugins/MacAU/curve/curve.h index d2c7b16f3..f90fa2a16 100755 --- a/plugins/MacAU/curve/curve.h +++ b/plugins/MacAU/curve/curve.h @@ -104,7 +104,7 @@ public: virtual ComponentResult Version() { return kcurveVersion; } private: - long double gain; + double gain; uint32_t fpd; }; diff --git a/plugins/MacAU/curvemono/curvemono.cpp b/plugins/MacAU/curvemono/curvemono.cpp index 2f9b9260d..58298db09 100755 --- a/plugins/MacAU/curvemono/curvemono.cpp +++ b/plugins/MacAU/curvemono/curvemono.cpp @@ -168,8 +168,8 @@ void curvemono::curvemonoKernel::Process( const Float32 *inSourceP, Float32 *destP = inDestP; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 0.5; if (gain < 0.0078125) gain = 0.0078125; if (gain > 1.0) gain = 1.0; diff --git a/plugins/MacAU/curvemono/curvemono.h b/plugins/MacAU/curvemono/curvemono.h index 6b224f101..0023b8aca 100755 --- a/plugins/MacAU/curvemono/curvemono.h +++ b/plugins/MacAU/curvemono/curvemono.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double gain; + double gain; uint32_t fpd; }; }; diff --git a/plugins/MacAU/uLawDecode/uLawDecode.cpp b/plugins/MacAU/uLawDecode/uLawDecode.cpp index 3f4581c77..7cb2a516d 100755 --- a/plugins/MacAU/uLawDecode/uLawDecode.cpp +++ b/plugins/MacAU/uLawDecode/uLawDecode.cpp @@ -166,7 +166,7 @@ ComponentResult uLawDecode::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void uLawDecode::uLawDecodeKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,7 +181,7 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -190,27 +190,9 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; if (gain != 1.0) { @@ -231,11 +213,11 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/uLawDecode/uLawDecode.h b/plugins/MacAU/uLawDecode/uLawDecode.h index 75726d4da..2f51f88b7 100755 --- a/plugins/MacAU/uLawDecode/uLawDecode.h +++ b/plugins/MacAU/uLawDecode/uLawDecode.h @@ -127,7 +127,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacAU/uLawEncode/uLawEncode.cpp b/plugins/MacAU/uLawEncode/uLawEncode.cpp index 9c663fb28..355853e20 100755 --- a/plugins/MacAU/uLawEncode/uLawEncode.cpp +++ b/plugins/MacAU/uLawEncode/uLawEncode.cpp @@ -166,7 +166,7 @@ ComponentResult uLawEncode::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void uLawEncode::uLawEncodeKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,7 +181,7 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -190,27 +190,9 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (gain != 1.0) { @@ -229,11 +211,11 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacAU/uLawEncode/uLawEncode.h b/plugins/MacAU/uLawEncode/uLawEncode.h index b8730054d..a12457820 100755 --- a/plugins/MacAU/uLawEncode/uLawEncode.h +++ b/plugins/MacAU/uLawEncode/uLawEncode.h @@ -127,7 +127,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ADClip7/ADClip7.cpp b/plugins/MacSignedAU/ADClip7/ADClip7.cpp index 3b2c58847..13db4e1d7 100755 --- a/plugins/MacSignedAU/ADClip7/ADClip7.cpp +++ b/plugins/MacSignedAU/ADClip7/ADClip7.cpp @@ -205,7 +205,7 @@ void ADClip7::ADClip7Kernel::Reset() refclip = 0.99; iirLowsA = 0.0; iirLowsB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -235,7 +235,7 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, Float64 calibsubs = subslift/53; Float64 invcalibsubs = 1.0 - calibsubs; Float64 subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) GetParameter( kParam_Four ); Float64 overshoot; Float64 offsetH1 = 1.84; @@ -259,35 +259,12 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, Float64 minusH3 = 1.0 - fractionH3; Float64 highs = 0.0; int count = 0; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputGain != 1.0) { inputSample *= inputGain; @@ -476,11 +453,11 @@ void ADClip7::ADClip7Kernel::Process( const Float32 *inSourceP, if (inputSample < -refclip) inputSample = -refclip; //final iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/ADClip7/ADClip7.h b/plugins/MacSignedAU/ADClip7/ADClip7.h index 215cc2c4c..0750b6057 100755 --- a/plugins/MacSignedAU/ADClip7/ADClip7.h +++ b/plugins/MacSignedAU/ADClip7/ADClip7.h @@ -141,14 +141,14 @@ public: virtual void Reset(); private: - long double lastSample; + double lastSample; Float32 b[22200]; int gcount; Float64 lows; Float64 iirLowsA; Float64 iirLowsB; - long double refclip; - long double fpNShape; + double refclip; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ADT/ADT.cpp b/plugins/MacSignedAU/ADT/ADT.cpp index 37f7f3622..2bd89c27a 100755 --- a/plugins/MacSignedAU/ADT/ADT.cpp +++ b/plugins/MacSignedAU/ADT/ADT.cpp @@ -234,9 +234,9 @@ void ADT::ADTKernel::Process( const Float32 *inSourceP, int count; Float64 temp; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fabs(offsetA - targetA) > 1000) offsetA = targetA; diff --git a/plugins/MacSignedAU/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/MacSignedAU/AQuickVoiceClip/AQuickVoiceClip.cpp index 8d8eb653c..cdd86e866 100755 --- a/plugins/MacSignedAU/AQuickVoiceClip/AQuickVoiceClip.cpp +++ b/plugins/MacSignedAU/AQuickVoiceClip/AQuickVoiceClip.cpp @@ -181,7 +181,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Reset() iirSampleC = 0.0; iirSampleD = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -227,30 +227,7 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; passThrough = ataDrySample = inputSample; @@ -433,11 +410,11 @@ void AQuickVoiceClip::AQuickVoiceClipKernel::Process( const Float32 *inSourceP if (inputSample < -cliplevel) inputSample = -cliplevel; //final iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Acceleration/Acceleration.cpp b/plugins/MacSignedAU/Acceleration/Acceleration.cpp index 63f19b0d8..0d054272b 100755 --- a/plugins/MacSignedAU/Acceleration/Acceleration.cpp +++ b/plugins/MacSignedAU/Acceleration/Acceleration.cpp @@ -170,7 +170,7 @@ void Acceleration::AccelerationKernel::Reset() s1L = s2L = s3L = 0.0; o1L = o2L = o3L = 0.0; m1L = m2L = desL = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,7 +185,7 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -198,35 +198,11 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, Float64 accumulatorSample; double drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - //This file's now been modified by all dev machines, using commandline git - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -258,11 +234,11 @@ void Acceleration::AccelerationKernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Acceleration/Acceleration.h b/plugins/MacSignedAU/Acceleration/Acceleration.h index ba5bfd437..e54b35ed4 100755 --- a/plugins/MacSignedAU/Acceleration/Acceleration.h +++ b/plugins/MacSignedAU/Acceleration/Acceleration.h @@ -138,7 +138,7 @@ public: Float64 m1L; Float64 m2L; Float64 desL; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Acceleration2/Acceleration2.cpp b/plugins/MacSignedAU/Acceleration2/Acceleration2.cpp index d4f8b5142..1f68f1d8f 100755 --- a/plugins/MacSignedAU/Acceleration2/Acceleration2.cpp +++ b/plugins/MacSignedAU/Acceleration2/Acceleration2.cpp @@ -185,7 +185,7 @@ void Acceleration2::Acceleration2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -216,11 +216,11 @@ void Acceleration2::Acceleration2Kernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; Float64 smooth = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = smooth; //DF1 diff --git a/plugins/MacSignedAU/Acceleration2/Acceleration2.h b/plugins/MacSignedAU/Acceleration2/Acceleration2.h index 1245e4b89..510b69012 100755 --- a/plugins/MacSignedAU/Acceleration2/Acceleration2.h +++ b/plugins/MacSignedAU/Acceleration2/Acceleration2.h @@ -132,8 +132,8 @@ public: Float64 s[34]; Float64 m1; Float64 m2; - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Air/Air.cpp b/plugins/MacSignedAU/Air/Air.cpp index 42426fc26..f6ca6a218 100755 --- a/plugins/MacSignedAU/Air/Air.cpp +++ b/plugins/MacSignedAU/Air/Air.cpp @@ -222,7 +222,7 @@ void Air::AirKernel::Reset() tripletC = 0.0; tripletFactor = 0.0; count = 1; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -250,37 +250,14 @@ void Air::AirKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Six ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 correction; //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; @@ -392,7 +369,7 @@ void Air::AirKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/Air/Air.h b/plugins/MacSignedAU/Air/Air.h index 6dcd06ca8..32fe255c1 100755 --- a/plugins/MacSignedAU/Air/Air.h +++ b/plugins/MacSignedAU/Air/Air.h @@ -164,7 +164,7 @@ public: Float64 tripletC; Float64 tripletFactor; int count; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Air2/Air2.cpp b/plugins/MacSignedAU/Air2/Air2.cpp index 611676f64..90fdc2da2 100644 --- a/plugins/MacSignedAU/Air2/Air2.cpp +++ b/plugins/MacSignedAU/Air2/Air2.cpp @@ -232,7 +232,7 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -261,13 +261,13 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correction = 0.0; + double correction = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorC = airPrevC - inputSample; if (flop) @@ -356,7 +356,7 @@ void Air2::Air2Kernel::Process( const Float32 *inSourceP, correction *= intensity; correction -= 1.0; - long double bridgerectifier = fabs(correction); + double bridgerectifier = fabs(correction); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correction > 0) correction = bridgerectifier; diff --git a/plugins/MacSignedAU/Air2/Air2.h b/plugins/MacSignedAU/Air2/Air2.h index dea89d48e..af1b3efae 100644 --- a/plugins/MacSignedAU/Air2/Air2.h +++ b/plugins/MacSignedAU/Air2/Air2.h @@ -159,7 +159,7 @@ public: Float64 tripletC; Float64 tripletFactor; int count; - long double postsine; + double postsine; double lastRef[10]; int cycle; diff --git a/plugins/MacSignedAU/Apicolypse/Apicolypse.cpp b/plugins/MacSignedAU/Apicolypse/Apicolypse.cpp index f034bea31..9a583cb05 100755 --- a/plugins/MacSignedAU/Apicolypse/Apicolypse.cpp +++ b/plugins/MacSignedAU/Apicolypse/Apicolypse.cpp @@ -223,8 +223,8 @@ void Apicolypse::ApicolypseKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.cpp b/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.cpp index 51ded0088..a61ea5f02 100755 --- a/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.cpp +++ b/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.cpp @@ -162,7 +162,7 @@ void AtmosphereBuss::AtmosphereBussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -206,9 +206,9 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; - long double clamp; + double inputSample; + double drySample; + double clamp; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -234,24 +234,7 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - //for Atmopshere, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -341,11 +324,11 @@ void AtmosphereBuss::AtmosphereBussKernel::Process( const Float32 *inSourceP, lastSampleA = drySample; //store the raw input sample again for use next time - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.h b/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.h index f8db61ac7..f39f90abd 100755 --- a/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.h +++ b/plugins/MacSignedAU/AtmosphereBuss/AtmosphereBuss.h @@ -128,33 +128,33 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + uint32_t fpd; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; }; }; diff --git a/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.cpp b/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.cpp index 791307d89..c8818072b 100755 --- a/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.cpp +++ b/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.cpp @@ -162,7 +162,7 @@ void AtmosphereChannel::AtmosphereChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -206,9 +206,9 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; - long double clamp; + double inputSample; + double drySample; + double clamp; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -234,25 +234,7 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -338,11 +320,11 @@ void AtmosphereChannel::AtmosphereChannelKernel::Process( const Float32 *inSou lastSampleA = drySample; //store the raw input sample again for use next time - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.h b/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.h index 30ec000e7..09ea65997 100755 --- a/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.h +++ b/plugins/MacSignedAU/AtmosphereChannel/AtmosphereChannel.h @@ -128,33 +128,33 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + uint32_t fpd; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; }; }; diff --git a/plugins/MacSignedAU/Aura/Aura.cpp b/plugins/MacSignedAU/Aura/Aura.cpp index c92791b19..7ff9abfbd 100755 --- a/plugins/MacSignedAU/Aura/Aura.cpp +++ b/plugins/MacSignedAU/Aura/Aura.cpp @@ -169,7 +169,7 @@ void Aura::AuraKernel::Reset() for(int count = 0; count < 21; count++) {b[count] = 0.0; f[count] = 0.0;} lastSample = 0.0; previousVelocity = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,7 +193,7 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, Float64 overallscale = trim * 10.0; Float64 gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSample; + double inputSample; Float64 drySample; if (gain < 1.0) gain = 1.0; @@ -245,30 +245,7 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; velocity = lastSample - inputSample; @@ -314,11 +291,11 @@ void Aura::AuraKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Aura/Aura.h b/plugins/MacSignedAU/Aura/Aura.h index 56ef4921b..9df735780 100755 --- a/plugins/MacSignedAU/Aura/Aura.h +++ b/plugins/MacSignedAU/Aura/Aura.h @@ -127,11 +127,11 @@ public: virtual void Reset(); private: - long double lastSample; + double lastSample; Float64 previousVelocity; Float64 b[21]; Float64 f[21]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/AutoPan/AutoPan.cpp b/plugins/MacSignedAU/AutoPan/AutoPan.cpp index f76ed4649..862ff7a97 100644 --- a/plugins/MacSignedAU/AutoPan/AutoPan.cpp +++ b/plugins/MacSignedAU/AutoPan/AutoPan.cpp @@ -219,7 +219,7 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -229,10 +229,10 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags double wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -248,8 +248,8 @@ OSStatus AutoPan::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; diff --git a/plugins/MacSignedAU/AverMatrix/AverMatrix.cpp b/plugins/MacSignedAU/AverMatrix/AverMatrix.cpp index 775e2de5a..971c2b544 100755 --- a/plugins/MacSignedAU/AverMatrix/AverMatrix.cpp +++ b/plugins/MacSignedAU/AverMatrix/AverMatrix.cpp @@ -231,12 +231,12 @@ void AverMatrix::AverMatrixKernel::Process( const Float32 *inSourceP, } //and now it's neatly scaled, too while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - long double previousPole = 0; + double previousPole = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) b[x+1][y] = b[x][y]; b[0][y] = previousPole = inputSample; diff --git a/plugins/MacSignedAU/Average/Average.cpp b/plugins/MacSignedAU/Average/Average.cpp index b06d81e37..be77094d7 100755 --- a/plugins/MacSignedAU/Average/Average.cpp +++ b/plugins/MacSignedAU/Average/Average.cpp @@ -170,7 +170,7 @@ void Average::AverageKernel::Reset() { register UInt32 count; for(count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,30 +221,7 @@ void Average::AverageKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; b[9] = b[8]; b[8] = b[7]; b[7] = b[6]; b[6] = b[5]; @@ -279,11 +256,11 @@ void Average::AverageKernel::Process( const Float32 *inSourceP, //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/BassAmp/BassAmp.cpp b/plugins/MacSignedAU/BassAmp/BassAmp.cpp index 5bd56319b..93865a822 100755 --- a/plugins/MacSignedAU/BassAmp/BassAmp.cpp +++ b/plugins/MacSignedAU/BassAmp/BassAmp.cpp @@ -254,7 +254,7 @@ void BassAmp::BassAmpKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -277,8 +277,8 @@ void BassAmp::BassAmpKernel::Process( const Float32 *inSourceP, Float64 altHPAmount = 1.0 - iirHPAmount; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample = *sourceP; ataHalfDrySample = ataHalfwaySample = (inputSample + ataLast1Sample + (ataLast2Sample*ataK1) + (ataLast3Sample*ataK2) + (ataLast4Sample*ataK6) + (ataLast5Sample*ataK7) + (ataLast6Sample*ataK8)) / 2.0; diff --git a/plugins/MacSignedAU/BassDrive/BassDrive.cpp b/plugins/MacSignedAU/BassDrive/BassDrive.cpp index a6f2f2084..59442f57b 100755 --- a/plugins/MacSignedAU/BassDrive/BassDrive.cpp +++ b/plugins/MacSignedAU/BassDrive/BassDrive.cpp @@ -234,8 +234,8 @@ void BassDrive::BassDriveKernel::Process( const Float32 *inSourceP, Float64 bridgerectifier; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sum = 0.0; diff --git a/plugins/MacSignedAU/BassKit/BassKit.cpp b/plugins/MacSignedAU/BassKit/BassKit.cpp index 731d62889..6815a53a0 100755 --- a/plugins/MacSignedAU/BassKit/BassKit.cpp +++ b/plugins/MacSignedAU/BassKit/BassKit.cpp @@ -248,8 +248,8 @@ ComponentResult BassKit::Reset(AudioUnitScope inScope, AudioUnitElement inEleme oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -266,7 +266,7 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -284,8 +284,8 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float64 fuzz = 0.111; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -455,7 +455,7 @@ OSStatus BassKit::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/BassKit/BassKit.h b/plugins/MacSignedAU/BassKit/BassKit.h index fbe851080..b6bffd8fb 100755 --- a/plugins/MacSignedAU/BassKit/BassKit.h +++ b/plugins/MacSignedAU/BassKit/BassKit.h @@ -168,8 +168,8 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/Baxandall/Baxandall.cpp b/plugins/MacSignedAU/Baxandall/Baxandall.cpp index 3e95b0c30..218b4f289 100755 --- a/plugins/MacSignedAU/Baxandall/Baxandall.cpp +++ b/plugins/MacSignedAU/Baxandall/Baxandall.cpp @@ -227,8 +227,8 @@ void Baxandall::BaxandallKernel::Process( const Float32 *inSourceP, bassB[6] = bassA[6] = (1.0 - K / bassA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (output != 1.0) { inputSample *= output; @@ -237,8 +237,8 @@ void Baxandall::BaxandallKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //encode Console5: good cleanness - long double trebleSample; - long double bassSample; + double trebleSample; + double bassSample; if (flip) { diff --git a/plugins/MacSignedAU/Baxandall/Baxandall.h b/plugins/MacSignedAU/Baxandall/Baxandall.h index 54d78b2b8..0bf754baf 100755 --- a/plugins/MacSignedAU/Baxandall/Baxandall.h +++ b/plugins/MacSignedAU/Baxandall/Baxandall.h @@ -131,10 +131,10 @@ public: virtual void Reset(); private: - long double trebleA[9]; - long double trebleB[9]; - long double bassA[9]; - long double bassB[9]; + double trebleA[9]; + double trebleB[9]; + double bassA[9]; + double bassB[9]; bool flip; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/Beam/Beam.cpp b/plugins/MacSignedAU/Beam/Beam.cpp index 1dfe163d6..5e17d86a6 100755 --- a/plugins/MacSignedAU/Beam/Beam.cpp +++ b/plugins/MacSignedAU/Beam/Beam.cpp @@ -205,7 +205,7 @@ void Beam::BeamKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int depth = (int)(17.0*overallscale); @@ -225,7 +225,7 @@ void Beam::BeamKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float32 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacSignedAU/Biquad/Biquad.cpp b/plugins/MacSignedAU/Biquad/Biquad.cpp index 66756a308..b566b5085 100755 --- a/plugins/MacSignedAU/Biquad/Biquad.cpp +++ b/plugins/MacSignedAU/Biquad/Biquad.cpp @@ -200,7 +200,7 @@ void Biquad::BiquadKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -271,15 +271,15 @@ void Biquad::BiquadKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquad[2]) + biquad[7]; + double tempSample = (inputSample * biquad[2]) + biquad[7]; biquad[7] = (inputSample * biquad[3]) - (tempSample * biquad[5]) + biquad[8]; biquad[8] = (inputSample * biquad[4]) - (tempSample * biquad[6]); inputSample = tempSample; diff --git a/plugins/MacSignedAU/Biquad/Biquad.h b/plugins/MacSignedAU/Biquad/Biquad.h index 973ad1306..11922285e 100755 --- a/plugins/MacSignedAU/Biquad/Biquad.h +++ b/plugins/MacSignedAU/Biquad/Biquad.h @@ -134,7 +134,7 @@ public: virtual void Reset(); private: - long double biquad[9]; + double biquad[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Biquad2/Biquad2.cpp b/plugins/MacSignedAU/Biquad2/Biquad2.cpp index 19e753368..fbfe9bcc5 100755 --- a/plugins/MacSignedAU/Biquad2/Biquad2.cpp +++ b/plugins/MacSignedAU/Biquad2/Biquad2.cpp @@ -282,9 +282,9 @@ void Biquad2::Biquad2Kernel::Process( const Float32 *inSourceP, //finished setting up average while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; Float64 chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -333,7 +333,7 @@ void Biquad2::Biquad2Kernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //encode Console5: good cleanness - long double outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; inputSample = outSample; biquad[10] = biquad[9]; biquad[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; diff --git a/plugins/MacSignedAU/Biquad2/Biquad2.h b/plugins/MacSignedAU/Biquad2/Biquad2.h index 5025f76da..f7a63c78e 100755 --- a/plugins/MacSignedAU/Biquad2/Biquad2.h +++ b/plugins/MacSignedAU/Biquad2/Biquad2.h @@ -137,7 +137,7 @@ public: virtual void Reset(); private: - long double biquad[11]; + double biquad[11]; Float64 b[11]; Float64 f[11]; Float64 frequencychase; diff --git a/plugins/MacSignedAU/BiquadDouble/BiquadDouble.cpp b/plugins/MacSignedAU/BiquadDouble/BiquadDouble.cpp index 3b1dced75..6f48cb7ff 100755 --- a/plugins/MacSignedAU/BiquadDouble/BiquadDouble.cpp +++ b/plugins/MacSignedAU/BiquadDouble/BiquadDouble.cpp @@ -200,7 +200,7 @@ void BiquadDouble::BiquadDoubleKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -274,15 +274,15 @@ void BiquadDouble::BiquadDoubleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSample * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; diff --git a/plugins/MacSignedAU/BiquadDouble/BiquadDouble.h b/plugins/MacSignedAU/BiquadDouble/BiquadDouble.h index ae50bfb6a..31b0da988 100755 --- a/plugins/MacSignedAU/BiquadDouble/BiquadDouble.h +++ b/plugins/MacSignedAU/BiquadDouble/BiquadDouble.h @@ -134,8 +134,8 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; + double biquadA[9]; + double biquadB[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.cpp b/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.cpp index 599eb8dea..67e2277c3 100755 --- a/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.cpp +++ b/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.cpp @@ -201,7 +201,7 @@ void BiquadOneHalf::BiquadOneHalfKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -279,15 +279,15 @@ void BiquadOneHalf::BiquadOneHalfKernel::Process( const Float32 *inSourceP, for (int x = 0; x < 9; x++) {biquadB[x] = biquadA[x];} while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample; + double tempSample; if (flip) { tempSample = (inputSample * biquadA[2]) + biquadA[7]; diff --git a/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.h b/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.h index fc0a45ffb..ac9eb3197 100755 --- a/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.h +++ b/plugins/MacSignedAU/BiquadOneHalf/BiquadOneHalf.h @@ -134,8 +134,8 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; + double biquadA[9]; + double biquadB[9]; bool flip; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/BiquadPlus/BiquadPlus.cpp b/plugins/MacSignedAU/BiquadPlus/BiquadPlus.cpp index f7740943c..630624999 100644 --- a/plugins/MacSignedAU/BiquadPlus/BiquadPlus.cpp +++ b/plugins/MacSignedAU/BiquadPlus/BiquadPlus.cpp @@ -199,7 +199,7 @@ void BiquadPlus::BiquadPlusKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -288,17 +288,17 @@ void BiquadPlus::BiquadPlusKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; - long double buf = (long double)nSampleFrames/inFramesToProcess; + double buf = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSample * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSample * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSample * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSample * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSample = tempSample; diff --git a/plugins/MacSignedAU/BiquadPlus/BiquadPlus.h b/plugins/MacSignedAU/BiquadPlus/BiquadPlus.h index f15918504..ba2304965 100644 --- a/plugins/MacSignedAU/BiquadPlus/BiquadPlus.h +++ b/plugins/MacSignedAU/BiquadPlus/BiquadPlus.h @@ -160,7 +160,7 @@ public: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/BiquadStereo/BiquadStereo.cpp b/plugins/MacSignedAU/BiquadStereo/BiquadStereo.cpp index c04b75af3..7dfb86b28 100755 --- a/plugins/MacSignedAU/BiquadStereo/BiquadStereo.cpp +++ b/plugins/MacSignedAU/BiquadStereo/BiquadStereo.cpp @@ -217,7 +217,7 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -290,12 +290,12 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction } while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -303,16 +303,16 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -322,12 +322,12 @@ OSStatus BiquadStereo::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacSignedAU/BiquadStereo/BiquadStereo.h b/plugins/MacSignedAU/BiquadStereo/BiquadStereo.h index ce3c3d4c4..c04f4fd87 100755 --- a/plugins/MacSignedAU/BiquadStereo/BiquadStereo.h +++ b/plugins/MacSignedAU/BiquadStereo/BiquadStereo.h @@ -118,7 +118,7 @@ public: virtual ComponentResult Version() { return kBiquadStereoVersion; } private: - long double biquad[11]; + double biquad[11]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/BiquadTriple/BiquadTriple.cpp b/plugins/MacSignedAU/BiquadTriple/BiquadTriple.cpp index ac652be2b..52c59b842 100755 --- a/plugins/MacSignedAU/BiquadTriple/BiquadTriple.cpp +++ b/plugins/MacSignedAU/BiquadTriple/BiquadTriple.cpp @@ -200,7 +200,7 @@ void BiquadTriple::BiquadTripleKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -273,15 +273,15 @@ void BiquadTriple::BiquadTripleKernel::Process( const Float32 *inSourceP, for (int x = 0; x < 7; x++) {biquadC[x] = biquadB[x] = biquadA[x];} while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSample * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; diff --git a/plugins/MacSignedAU/BiquadTriple/BiquadTriple.h b/plugins/MacSignedAU/BiquadTriple/BiquadTriple.h index 5ce324812..2ba3cb6c1 100755 --- a/plugins/MacSignedAU/BiquadTriple/BiquadTriple.h +++ b/plugins/MacSignedAU/BiquadTriple/BiquadTriple.h @@ -134,9 +134,9 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/BitGlitter/BitGlitter.cpp b/plugins/MacSignedAU/BitGlitter/BitGlitter.cpp index ded8a58b3..30fa00715 100755 --- a/plugins/MacSignedAU/BitGlitter/BitGlitter.cpp +++ b/plugins/MacSignedAU/BitGlitter/BitGlitter.cpp @@ -221,8 +221,8 @@ void BitGlitter::BitGlitterKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - long double drySample = inputSample; + double inputSample = *sourceP; + double drySample = inputSample; //first, the distortion section inputSample *= ingain; @@ -239,7 +239,7 @@ void BitGlitter::BitGlitterKernel::Process( const Float32 *inSourceP, //begin raw sample positionA += rateA; - long double outputSample = heldSampleA; + double outputSample = heldSampleA; if (positionA > 1.0) { positionA -= 1.0; diff --git a/plugins/MacSignedAU/Bite/Bite.cpp b/plugins/MacSignedAU/Bite/Bite.cpp index 0895b5cd1..a08ba2afc 100755 --- a/plugins/MacSignedAU/Bite/Bite.cpp +++ b/plugins/MacSignedAU/Bite/Bite.cpp @@ -175,7 +175,7 @@ void Bite::BiteKernel::Reset() sampleG = 0.0; sampleH = 0.0; sampleI = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -200,7 +200,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, Float64 midC; Float64 midD; Float64 trigger; - long double result; + double result; while (nSampleFrames-- > 0) { sampleI = sampleH; @@ -212,30 +212,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, sampleC = sampleB; sampleB = sampleA; sampleA = *sourceP; - if (sampleA<1.2e-38 && -sampleA<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleA = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleA)<1.18e-23) sampleA = fpd * 1.18e-17; //rotate the buffer in primitive fashion @@ -269,7 +246,7 @@ void Bite::BiteKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)result, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); result += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/BlockParty/BlockParty.cpp b/plugins/MacSignedAU/BlockParty/BlockParty.cpp index c3e72d06c..e47d78d3c 100755 --- a/plugins/MacSignedAU/BlockParty/BlockParty.cpp +++ b/plugins/MacSignedAU/BlockParty/BlockParty.cpp @@ -201,7 +201,7 @@ void BlockParty::BlockPartyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -215,28 +215,10 @@ void BlockParty::BlockPartyKernel::Process( const Float32 *inSourceP, //some insanity checking while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 muMakeupGain = 1.0 / threshold; Float64 outMakeupGain = sqrt(muMakeupGain); diff --git a/plugins/MacSignedAU/BrassRider/BrassRider.cpp b/plugins/MacSignedAU/BrassRider/BrassRider.cpp index fd5133476..b6e082098 100755 --- a/plugins/MacSignedAU/BrassRider/BrassRider.cpp +++ b/plugins/MacSignedAU/BrassRider/BrassRider.cpp @@ -220,49 +220,13 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -271,7 +235,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -280,7 +244,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -303,7 +267,7 @@ OSStatus BrassRider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/MacSignedAU/BrightAmbience/BrightAmbience.cpp b/plugins/MacSignedAU/BrightAmbience/BrightAmbience.cpp index 0cc833d31..5361c6f52 100755 --- a/plugins/MacSignedAU/BrightAmbience/BrightAmbience.cpp +++ b/plugins/MacSignedAU/BrightAmbience/BrightAmbience.cpp @@ -199,8 +199,8 @@ void BrightAmbience::BrightAmbienceKernel::Process( const Float32 *inSourceP, int temp; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; temp = 0; if (gcount < 0 || gcount > 12680) {gcount = 12680;} diff --git a/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.cpp b/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.cpp index 30ddf7863..5754f5264 100755 --- a/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.cpp +++ b/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.cpp @@ -225,14 +225,14 @@ OSStatus BrightAmbience2::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.h b/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.h index 245f11da2..24e2d8087 100755 --- a/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.h +++ b/plugins/MacSignedAU/BrightAmbience2/BrightAmbience2.h @@ -125,9 +125,9 @@ public: int gcount; Float32 pL[32768]; Float32 pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.cpp b/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.cpp index 82edceec2..2803d8c43 100644 --- a/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.cpp +++ b/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.cpp @@ -221,7 +221,7 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -249,17 +249,17 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct figureL[6] = figureR[6] = (1.0 - K / figureR[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -273,7 +273,7 @@ OSStatus BrightAmbience3::ProcessBufferLists(AudioUnitRenderActionFlags & ioAct inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; diff --git a/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.h b/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.h index c169cd303..e72eeddea 100644 --- a/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.h +++ b/plugins/MacSignedAU/BrightAmbience3/BrightAmbience3.h @@ -125,10 +125,10 @@ public: int gcount; Float32 pL[32768]; Float32 pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/MacSignedAU/BuildATPDF/BuildATPDF.cpp b/plugins/MacSignedAU/BuildATPDF/BuildATPDF.cpp index f7f46b369..fda4b55a8 100755 --- a/plugins/MacSignedAU/BuildATPDF/BuildATPDF.cpp +++ b/plugins/MacSignedAU/BuildATPDF/BuildATPDF.cpp @@ -261,30 +261,7 @@ void BuildATPDF::BuildATPDFKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacSignedAU/BussColors4/BussColors4.cpp b/plugins/MacSignedAU/BussColors4/BussColors4.cpp index 79fb734f2..7a003d4d7 100755 --- a/plugins/MacSignedAU/BussColors4/BussColors4.cpp +++ b/plugins/MacSignedAU/BussColors4/BussColors4.cpp @@ -227,7 +227,7 @@ void BussColors4::BussColors4Kernel::Reset() control = 0; gcount = 0; slowdyn = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -243,7 +243,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); if (overallscale < 1.0) overallscale = 1.0; @@ -252,7 +252,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, const int maxConvolutionBufferSize = (int)(34.0 * overallscale); //we won't use more of the buffer than we have to for (int count = 0; count < 34; count++) c[count] = (int)(count * overallscale); //assign conv taps - long double inputSample; + double inputSample; Float64 drySample; Float64 applyconv; @@ -283,30 +283,7 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gain != 1.0) { @@ -657,11 +634,11 @@ void BussColors4::BussColors4Kernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/BussColors4/BussColors4.h b/plugins/MacSignedAU/BussColors4/BussColors4.h index 321760e19..771bb1413 100755 --- a/plugins/MacSignedAU/BussColors4/BussColors4.h +++ b/plugins/MacSignedAU/BussColors4/BussColors4.h @@ -160,7 +160,7 @@ public: Float64 control; int gcount; Float64 slowdyn; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ButterComp/ButterComp.cpp b/plugins/MacSignedAU/ButterComp/ButterComp.cpp index 9ef624ba6..ef1f8de22 100755 --- a/plugins/MacSignedAU/ButterComp/ButterComp.cpp +++ b/plugins/MacSignedAU/ButterComp/ButterComp.cpp @@ -170,7 +170,7 @@ void ButterComp::ButterCompKernel::Reset() controlneg = 1.0; targetpos = 1.0; targetneg = 1.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -194,8 +194,8 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, Float64 calcneg; Float64 outputpos; Float64 outputneg; - long double totalmultiplier; - long double inputSample; + double totalmultiplier; + double inputSample; Float64 drySample; Float64 inputgain = pow(10.0,(GetParameter( kParam_One )*14.0)/20.0); Float64 wet = GetParameter( kParam_Two ); @@ -210,30 +210,7 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, divisor = 1.0 - divisor; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= inputgain; @@ -283,11 +260,11 @@ void ButterComp::ButterCompKernel::Process( const Float32 *inSourceP, inputSample /= outputgain; if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/ButterComp/ButterComp.h b/plugins/MacSignedAU/ButterComp/ButterComp.h index 0008b7403..0e70cfe36 100755 --- a/plugins/MacSignedAU/ButterComp/ButterComp.h +++ b/plugins/MacSignedAU/ButterComp/ButterComp.h @@ -132,7 +132,7 @@ public: Float64 controlneg; Float64 targetpos; Float64 targetneg; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ButterComp2/ButterComp2.cpp b/plugins/MacSignedAU/ButterComp2/ButterComp2.cpp index 60f7c67db..2136e2fa7 100755 --- a/plugins/MacSignedAU/ButterComp2/ButterComp2.cpp +++ b/plugins/MacSignedAU/ButterComp2/ButterComp2.cpp @@ -182,7 +182,7 @@ void ButterComp2::ButterComp2Kernel::Reset() targetneg = 1.0; flip = false; lastOutput = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -212,55 +212,37 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, outputgain += 1.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutput)); + double divisor = compfactor / (1.0+fabs(lastOutput)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputpos = inputSample + 1.0; + double inputpos = inputSample + 1.0; if (inputpos < 0.0) inputpos = 0.0; - long double outputpos = inputpos / 2.0; + double outputpos = inputpos / 2.0; if (outputpos > 1.0) outputpos = 1.0; inputpos *= inputpos; targetpos *= divisor; targetpos += (inputpos * remainder); - long double calcpos = pow((1.0/targetpos),2); + double calcpos = pow((1.0/targetpos),2); - long double inputneg = (-inputSample) + 1.0; + double inputneg = (-inputSample) + 1.0; if (inputneg < 0.0) inputneg = 0.0; - long double outputneg = inputneg / 2.0; + double outputneg = inputneg / 2.0; if (outputneg > 1.0) outputneg = 1.0; inputneg *= inputneg; targetneg *= divisor; targetneg += (inputneg * remainder); - long double calcneg = pow((1.0/targetneg),2); + double calcneg = pow((1.0/targetneg),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -293,7 +275,7 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplier; + double totalmultiplier; if (flip) {totalmultiplier = (controlApos * outputpos) + (controlAneg * outputneg);} else @@ -317,11 +299,11 @@ void ButterComp2::ButterComp2Kernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/ButterComp2/ButterComp2.h b/plugins/MacSignedAU/ButterComp2/ButterComp2.h index 068e00968..e91bba280 100755 --- a/plugins/MacSignedAU/ButterComp2/ButterComp2.h +++ b/plugins/MacSignedAU/ButterComp2/ButterComp2.h @@ -131,15 +131,15 @@ public: virtual void Reset(); private: - long double controlApos; - long double controlAneg; - long double controlBpos; - long double controlBneg; - long double targetpos; - long double targetneg; - long double lastOutput; + double controlApos; + double controlAneg; + double controlBpos; + double controlBneg; + double targetpos; + double targetneg; + double lastOutput; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/C5RawBuss/C5RawBuss.cpp b/plugins/MacSignedAU/C5RawBuss/C5RawBuss.cpp index 6d959e2bf..f10f244c5 100755 --- a/plugins/MacSignedAU/C5RawBuss/C5RawBuss.cpp +++ b/plugins/MacSignedAU/C5RawBuss/C5RawBuss.cpp @@ -160,7 +160,7 @@ void C5RawBuss::C5RawBussKernel::Reset() { lastFXBuss = 0.0; lastSampleBuss = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,7 +176,7 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double centering = GetParameter( kParam_One ) * 0.5; + double centering = GetParameter( kParam_One ) * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -184,34 +184,11 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, //Xmas Morning bugged-out Console5, which is the default setting for Raw Console5. Float64 difference; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; @@ -232,11 +209,11 @@ void C5RawBuss::C5RawBussKernel::Process( const Float32 *inSourceP, //build new signal off what was present in output last time //slew aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/C5RawBuss/C5RawBuss.h b/plugins/MacSignedAU/C5RawBuss/C5RawBuss.h index 1d3209e9f..c2503f09b 100755 --- a/plugins/MacSignedAU/C5RawBuss/C5RawBuss.h +++ b/plugins/MacSignedAU/C5RawBuss/C5RawBuss.h @@ -127,7 +127,7 @@ public: private: Float64 lastFXBuss; Float64 lastSampleBuss; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/C5RawChannel/C5RawChannel.cpp b/plugins/MacSignedAU/C5RawChannel/C5RawChannel.cpp index 8294002bc..50977c3e9 100755 --- a/plugins/MacSignedAU/C5RawChannel/C5RawChannel.cpp +++ b/plugins/MacSignedAU/C5RawChannel/C5RawChannel.cpp @@ -160,7 +160,7 @@ void C5RawChannel::C5RawChannelKernel::Reset() { lastFXChannel = 0.0; lastSampleChannel = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,7 +176,7 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double centering = GetParameter( kParam_One ) * 0.5; + double centering = GetParameter( kParam_One ) * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -184,34 +184,11 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, //Xmas Morning bugged-out Console5, which is the default setting for Raw Console5. Float64 difference; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; difference = lastSampleChannel - inputSample; lastSampleChannel = inputSample; @@ -233,11 +210,11 @@ void C5RawChannel::C5RawChannelKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/C5RawChannel/C5RawChannel.h b/plugins/MacSignedAU/C5RawChannel/C5RawChannel.h index c0bc73014..30993acef 100755 --- a/plugins/MacSignedAU/C5RawChannel/C5RawChannel.h +++ b/plugins/MacSignedAU/C5RawChannel/C5RawChannel.h @@ -127,7 +127,7 @@ public: private: Float64 lastSampleChannel; Float64 lastFXChannel; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/CStrip/CStrip.cpp b/plugins/MacSignedAU/CStrip/CStrip.cpp index 23dbe2ace..1348b7cb2 100755 --- a/plugins/MacSignedAU/CStrip/CStrip.cpp +++ b/plugins/MacSignedAU/CStrip/CStrip.cpp @@ -257,7 +257,7 @@ ComponentResult CStrip::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void CStrip::CStripKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSample = 0.0; last2Sample = 0.0; @@ -345,8 +345,8 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, overallscale = GetSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 inputSample; Float64 highSample = 0.0; @@ -427,30 +427,7 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; last2Sample = lastSample; lastSample = inputSample; @@ -764,11 +741,11 @@ void CStrip::CStripKernel::Process( const Float32 *inSourceP, //built in output trim and dry/wet if desired if (outputgain != 1.0) inputSample *= outputgain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Cabs/Cabs.cpp b/plugins/MacSignedAU/Cabs/Cabs.cpp new file mode 100755 index 000000000..971306590 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.cpp @@ -0,0 +1,1010 @@ +/* + * File: Cabs.cpp + * + * Version: 1.0 + * + * Created: 3/27/11 + * + * Copyright: Copyright © 2011 Airwindows, All Rights Reserved + * + * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in + * consideration of your agreement to the following terms, and your use, installation, modification + * or redistribution of this Apple software constitutes acceptance of these terms. If you do + * not agree with these terms, please do not use, install, modify or redistribute this Apple + * software. + * + * In consideration of your agreement to abide by the following terms, and subject to these terms, + * Apple grants you a personal, non-exclusive license, under Apple's copyrights in this + * original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the + * Apple Software, with or without modifications, in source and/or binary forms; provided that if you + * redistribute the Apple Software in its entirety and without modifications, you must retain this + * notice and the following text and disclaimers in all such redistributions of the Apple Software. + * Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to + * endorse or promote products derived from the Apple Software without specific prior written + * permission from Apple. Except as expressly stated in this notice, no other rights or + * licenses, express or implied, are granted by Apple herein, including but not limited to any + * patent rights that may be infringed by your derivative works or by other works in which the + * Apple Software may be incorporated. + * + * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR + * IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE + * OR IN COMBINATION WITH YOUR PRODUCTS. + * + * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, + * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER + * UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN + * IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*============================================================================= + Cabs.h + + =============================================================================*/ +#include "Cabs.h" + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +COMPONENT_ENTRY(Cabs) + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::Cabs +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Cabs::Cabs(AudioUnit component) +: AUEffectBase(component) +{ + CreateElements(); + Globals()->UseIndexedParameters(kNumberOfParameters); + SetParameter(kParam_One, kDefaultValue_ParamOne ); + SetParameter(kParam_Two, kDefaultValue_ParamTwo ); + SetParameter(kParam_Three, kDefaultValue_ParamThree ); + SetParameter(kParam_Four, kDefaultValue_ParamFour ); + SetParameter(kParam_Five, kDefaultValue_ParamFive ); + SetParameter(kParam_Six, kDefaultValue_ParamSix ); + +#if AU_DEBUG_DISPATCHER + mDebugDispatcher = new AUDebugDispatcher (this); +#endif + +} + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::GetParameterValueStrings +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Cabs::GetParameterValueStrings(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + CFArrayRef * outStrings) +{ + if ((inScope == kAudioUnitScope_Global) && (inParameterID == kParam_One)) //ID must be actual name of parameter identifier, not number + { + if (outStrings == NULL) return noErr; + CFStringRef strings [] = + { + kMenuItem_HighPowerStack, + kMenuItem_VintageStack, + kMenuItem_BoutiqueStack, + kMenuItem_LargeCombo, + kMenuItem_SmallCombo, + kMenuItem_Bass, + }; + *outStrings = CFArrayCreate ( + NULL, + (const void **) strings, + (sizeof (strings) / sizeof (strings [0])), + NULL + ); + return noErr; + } + return kAudioUnitErr_InvalidProperty; +} + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::GetParameterInfo +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Cabs::GetParameterInfo(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + AudioUnitParameterInfo &outParameterInfo ) +{ + ComponentResult result = noErr; + + outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable + | kAudioUnitParameterFlag_IsReadable; + + if (inScope == kAudioUnitScope_Global) { + switch(inParameterID) + { + case kParam_One: + AUBase::FillInParameterName (outParameterInfo, kParameterOneName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Indexed; + outParameterInfo.minValue = kHighPowerStack; + outParameterInfo.maxValue = kBass; + outParameterInfo.defaultValue = kDefaultValue_ParamOne; + break; + case kParam_Two: + AUBase::FillInParameterName (outParameterInfo, kParameterTwoName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamTwo; + break; + case kParam_Three: + AUBase::FillInParameterName (outParameterInfo, kParameterThreeName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamThree; + break; + case kParam_Four: + AUBase::FillInParameterName (outParameterInfo, kParameterFourName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamFour; + break; + case kParam_Five: + AUBase::FillInParameterName (outParameterInfo, kParameterFiveName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamFive; + break; + case kParam_Six: + AUBase::FillInParameterName (outParameterInfo, kParameterSixName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamSix; + break; + default: + result = kAudioUnitErr_InvalidParameter; + break; + } + } else { + result = kAudioUnitErr_InvalidParameter; + } + + + + return result; +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::GetPropertyInfo +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Cabs::GetPropertyInfo (AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + UInt32 & outDataSize, + Boolean & outWritable) +{ + return AUEffectBase::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable); +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::GetProperty +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Cabs::GetProperty( AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + void * outData ) +{ + return AUEffectBase::GetProperty (inID, inScope, inElement, outData); +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::Initialize +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Cabs::Initialize() +{ + ComponentResult result = AUEffectBase::Initialize(); + if (result == noErr) + Reset(kAudioUnitScope_Global, 0); + return result; +} + +#pragma mark ____CabsEffectKernel + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::CabsKernel::Reset() +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +void Cabs::CabsKernel::Reset() +{ + ataLast3Sample = ataLast2Sample = ataLast1Sample = 0.0; + ataHalfwaySample = ataHalfDrySample = ataHalfDiffSample = 0.0; + ataA = ataB = ataC = ataDrySample = ataDiffSample = ataPrevDiffSample = 0.0; + + for(int count = 0; count < 90; count++) {b[count] = 0;} + lastSample = 0.0; + lastHalfSample = 0.0; + lastPostSample = 0.0; + lastPostHalfSample = 0.0; + postPostSample = 0.0; + for(int count = 0; count < 20; count++) {d[count] = 0;} + control = 0; + iirHeadBumpA = 0.0; + iirHeadBumpB = 0.0; + iirHalfHeadBumpA = 0.0; + iirHalfHeadBumpB = 0.0; + for(int count = 0; count < 6; count++) lastRef[count] = 0.0; + + flip = false; + ataFlip = false; + gcount = 0; + cycle = 0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Cabs::CabsKernel::Process +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +void Cabs::CabsKernel::Process( const Float32 *inSourceP, + Float32 *inDestP, + UInt32 inFramesToProcess, + UInt32 inNumChannels, + bool &ioSilence ) +{ + UInt32 nSampleFrames = inFramesToProcess; + const Float32 *sourceP = inSourceP; + Float32 *destP = inDestP; + + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= GetSampleRate(); + int cycleEnd = floor(overallscale); + if (cycleEnd < 1) cycleEnd = 1; + if (cycleEnd > 4) cycleEnd = 4; + //this is going to be 2 for 88.1 or 96k, 3 for silly people, 4 for 176 or 192k + if (cycle > cycleEnd-1) cycle = cycleEnd-1; //sanity check + + int speaker = (int) GetParameter( kParam_One ); + double colorIntensity = pow(GetParameter( kParam_Two ),4); + double correctboost = 1.0 + (colorIntensity*4); + double correctdrygain = 1.0 - colorIntensity; + double threshold = pow((1.0-GetParameter( kParam_Three )),5)+0.021; //room loud is slew + double rarefaction = cbrt(threshold); + double postThreshold = sqrt(rarefaction); + double postRarefaction = cbrt(postThreshold); + double postTrim = sqrt(postRarefaction); + double HeadBumpFreq = 0.0298+((1.0-GetParameter( kParam_Four ))/8.0); + double LowsPad = 0.12 + (HeadBumpFreq*12.0); + double dcblock = pow(HeadBumpFreq,2) / 8.0; + double heavy = pow(GetParameter( kParam_Five ),3); //wet of head bump + double output = pow(GetParameter( kParam_Six ),2); + double dynamicconv = 5.0; + dynamicconv *= pow(GetParameter( kParam_Two ),2); + dynamicconv *= pow(GetParameter( kParam_Three ),2); + //set constants for sag speed + int offsetA = 4+((int)(GetParameter( kParam_Four )*5.0)); + + while (nSampleFrames-- > 0) { + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + + cycle++; + if (cycle == cycleEnd) { //hit the end point and we do a chorus sample + //everything in here is undersampled, including the dry/wet + + double ataDrySample = inputSample; + double ataHalfwaySample = (inputSample + ataLast1Sample + ((-ataLast2Sample + ataLast3Sample) * 0.05)) / 2.0; + double ataHalfDrySample = ataHalfwaySample; + ataLast3Sample = ataLast2Sample; ataLast2Sample = ataLast1Sample; ataLast1Sample = inputSample; + //setting up oversampled special antialiasing + //pre-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double clamp = inputSample - lastSample; + if (clamp > threshold) inputSample = lastSample + threshold; + if (-clamp > rarefaction) inputSample = lastSample - rarefaction; + lastSample = inputSample; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySample - lastHalfSample; + if (clamp > threshold) ataHalfwaySample = lastHalfSample + threshold; + if (-clamp > rarefaction) ataHalfwaySample = lastHalfSample - rarefaction; + lastHalfSample = ataHalfwaySample; + //end interpolated sample + + //begin center code handling conv stuff tied to 44.1K, or stuff in time domain like delays + ataHalfwaySample -= inputSample; + //retain only difference with raw signal + + if (gcount < 0 || gcount > 10) {gcount = 10;} + d[gcount+10] = d[gcount] = fabs(inputSample); + control += (d[gcount] / offsetA); + control -= (d[gcount+offsetA] / offsetA); + control -= 0.0001; + if (control < 0) {control = 0;} + if (control > 13) {control = 13;} + gcount--; + double applyconv = (control / offsetA) * dynamicconv; + //now we have a 'sag' style average to apply to the conv + b[82] = b[81]; b[81] = b[80]; b[80] = b[79]; + b[79] = b[78]; b[78] = b[77]; b[77] = b[76]; b[76] = b[75]; b[75] = b[74]; b[74] = b[73]; b[73] = b[72]; b[72] = b[71]; + b[71] = b[70]; b[70] = b[69]; b[69] = b[68]; b[68] = b[67]; b[67] = b[66]; b[66] = b[65]; b[65] = b[64]; b[64] = b[63]; + b[63] = b[62]; b[62] = b[61]; b[61] = b[60]; b[60] = b[59]; b[59] = b[58]; b[58] = b[57]; b[57] = b[56]; b[56] = b[55]; + b[55] = b[54]; b[54] = b[53]; b[53] = b[52]; b[52] = b[51]; b[51] = b[50]; b[50] = b[49]; b[49] = b[48]; b[48] = b[47]; + b[47] = b[46]; b[46] = b[45]; b[45] = b[44]; b[44] = b[43]; b[43] = b[42]; b[42] = b[41]; b[41] = b[40]; b[40] = b[39]; + b[39] = b[38]; b[38] = b[37]; b[37] = b[36]; b[36] = b[35]; b[35] = b[34]; b[34] = b[33]; b[33] = b[32]; b[32] = b[31]; + b[31] = b[30]; b[30] = b[29]; b[29] = b[28]; b[28] = b[27]; b[27] = b[26]; b[26] = b[25]; b[25] = b[24]; b[24] = b[23]; + b[23] = b[22]; b[22] = b[21]; b[21] = b[20]; b[20] = b[19]; b[19] = b[18]; b[18] = b[17]; b[17] = b[16]; b[16] = b[15]; + b[15] = b[14]; b[14] = b[13]; b[13] = b[12]; b[12] = b[11]; b[11] = b[10]; b[10] = b[9]; b[9] = b[8]; b[8] = b[7]; + b[7] = b[6]; b[6] = b[5]; b[5] = b[4]; b[4] = b[3]; b[3] = b[2]; b[2] = b[1]; b[1] = b[0]; b[0] = inputSample; + //load conv + + double tempSample = 0.0; //set up for applying the cab sound + switch (speaker) + { + case 1: + //begin HighPowerStack conv + tempSample += (b[1] * (1.29550481610475132 + (0.19713872057074355*applyconv))); + tempSample += (b[2] * (1.42302569895462616 + (0.30599505521284787*applyconv))); + tempSample += (b[3] * (1.28728195804197565 + (0.23168333460446133*applyconv))); + tempSample += (b[4] * (0.88553784290822690 + (0.14263256172918892*applyconv))); + tempSample += (b[5] * (0.37129054918432319 + (0.00150040944205920*applyconv))); + tempSample -= (b[6] * (0.12150959412556320 + (0.32776273620569107*applyconv))); + tempSample -= (b[7] * (0.44900065463203775 + (0.74101214925298819*applyconv))); + tempSample -= (b[8] * (0.54058781908186482 + (1.07821707459008387*applyconv))); + tempSample -= (b[9] * (0.49361966401791391 + (1.23540109014850508*applyconv))); + tempSample -= (b[10] * (0.39819495093078133 + (1.11247213730917749*applyconv))); + tempSample -= (b[11] * (0.31379279985435521 + (0.80330360359638298*applyconv))); + tempSample -= (b[12] * (0.30744359242808555 + (0.42132528876858205*applyconv))); + tempSample -= (b[13] * (0.33943170284673974 + (0.09183418349389982*applyconv))); + tempSample -= (b[14] * (0.33838775119286391 - (0.06453051658561271*applyconv))); + tempSample -= (b[15] * (0.30682305697961665 - (0.09549380253249232*applyconv))); + tempSample -= (b[16] * (0.23408741339295336 - (0.08083404732361277*applyconv))); + tempSample -= (b[17] * (0.10411746814025019 + (0.00253651281245780*applyconv))); + tempSample += (b[18] * (0.00133623776084696 - (0.04447267870865820*applyconv))); + tempSample += (b[19] * (0.02461903992114161 + (0.07530671732655550*applyconv))); + tempSample += (b[20] * (0.02086715842475373 + (0.22795860236804899*applyconv))); + tempSample += (b[21] * (0.02761433637100917 + (0.26108320417844094*applyconv))); + tempSample += (b[22] * (0.04475285369162533 + (0.19160705011061663*applyconv))); + tempSample += (b[23] * (0.09447338372862381 + (0.03681550508743799*applyconv))); + tempSample += (b[24] * (0.13445890343722280 - (0.13713036462146147*applyconv))); + tempSample += (b[25] * (0.13872868945088121 - (0.22401242373298191*applyconv))); + tempSample += (b[26] * (0.14915650097434549 - (0.26718804981526367*applyconv))); + tempSample += (b[27] * (0.12766643217091783 - (0.27745664795660430*applyconv))); + tempSample += (b[28] * (0.03675849788393101 - (0.18338278173550679*applyconv))); + tempSample -= (b[29] * (0.06307306864232835 + (0.06089480869040766*applyconv))); + tempSample -= (b[30] * (0.14947389348962944 + (0.04642103054798480*applyconv))); + tempSample -= (b[31] * (0.25235266566401526 + (0.08423062596460507*applyconv))); + tempSample -= (b[32] * (0.33496344048679683 + (0.09808328256677995*applyconv))); + tempSample -= (b[33] * (0.36590030482175445 + (0.10622650888958179*applyconv))); + tempSample -= (b[34] * (0.35015197011464372 + (0.08982043516016047*applyconv))); + tempSample -= (b[35] * (0.26808437585665090 + (0.00735561860229533*applyconv))); + tempSample -= (b[36] * (0.11624318543291220 - (0.07142484314510467*applyconv))); + tempSample += (b[37] * (0.05617084165377551 + (0.11785854050350089*applyconv))); + tempSample += (b[38] * (0.20540028692589385 + (0.20479174663329586*applyconv))); + tempSample += (b[39] * (0.30455415003043818 + (0.29074864580096849*applyconv))); + tempSample += (b[40] * (0.33810750937829476 + (0.29182307921316802*applyconv))); + tempSample += (b[41] * (0.31936133365277430 + (0.26535537727394987*applyconv))); + tempSample += (b[42] * (0.27388548321981876 + (0.19735049990538350*applyconv))); + tempSample += (b[43] * (0.21454597517994098 + (0.06415909270247236*applyconv))); + tempSample += (b[44] * (0.15001045817707717 - (0.03831118543404573*applyconv))); + tempSample += (b[45] * (0.07283437284653138 - (0.09281952429543777*applyconv))); + tempSample -= (b[46] * (0.03917872184241358 + (0.14306291461398810*applyconv))); + tempSample -= (b[47] * (0.16695932032148642 + (0.19138995946950504*applyconv))); + tempSample -= (b[48] * (0.27055854466909462 + (0.22531296466343192*applyconv))); + tempSample -= (b[49] * (0.33256357307578271 + (0.23305840475692102*applyconv))); + tempSample -= (b[50] * (0.33459770116834442 + (0.24091822618917569*applyconv))); + tempSample -= (b[51] * (0.27156687236338090 + (0.24062938573512443*applyconv))); + tempSample -= (b[52] * (0.17197093288412094 + (0.19083085091993421*applyconv))); + tempSample -= (b[53] * (0.06738628195910543 + (0.10268609751019808*applyconv))); + tempSample += (b[54] * (0.00222429218204290 + (0.01439664435720548*applyconv))); + tempSample += (b[55] * (0.01346992803494091 + (0.15947137113534526*applyconv))); + tempSample -= (b[56] * (0.02038911881377448 - (0.26763170752416160*applyconv))); + tempSample -= (b[57] * (0.08233579178189687 - (0.29415931086406055*applyconv))); + tempSample -= (b[58] * (0.15447855089824883 - (0.26489186990840807*applyconv))); + tempSample -= (b[59] * (0.20518281113362655 - (0.16135382257522859*applyconv))); + tempSample -= (b[60] * (0.22244686050232007 + (0.00847180390247432*applyconv))); + tempSample -= (b[61] * (0.21849243134998034 + (0.14460595245753741*applyconv))); + tempSample -= (b[62] * (0.20256105734574054 + (0.18932793221831667*applyconv))); + tempSample -= (b[63] * (0.18604070054295399 + (0.17250665610927965*applyconv))); + tempSample -= (b[64] * (0.17222844322058231 + (0.12992472027850357*applyconv))); + tempSample -= (b[65] * (0.14447856616566443 + (0.09089219002147308*applyconv))); + tempSample -= (b[66] * (0.10385520794251019 + (0.08600465834570559*applyconv))); + tempSample -= (b[67] * (0.07124435678265063 + (0.09071532210549428*applyconv))); + tempSample -= (b[68] * (0.05216857461197572 + (0.06794061706070262*applyconv))); + tempSample -= (b[69] * (0.05235381920184123 + (0.02818101717909346*applyconv))); + tempSample -= (b[70] * (0.07569701245553526 - (0.00634228544764946*applyconv))); + tempSample -= (b[71] * (0.10320125382718826 - (0.02751486906644141*applyconv))); + tempSample -= (b[72] * (0.12122120969079088 - (0.05434007312178933*applyconv))); + tempSample -= (b[73] * (0.13438969117200902 - (0.09135218559713874*applyconv))); + tempSample -= (b[74] * (0.13534390437529981 - (0.10437672041458675*applyconv))); + tempSample -= (b[75] * (0.11424128854188388 - (0.08693450726462598*applyconv))); + tempSample -= (b[76] * (0.08166894518596159 - (0.06949989431475120*applyconv))); + tempSample -= (b[77] * (0.04293976378555305 - (0.05718625137421843*applyconv))); + tempSample += (b[78] * (0.00933076320644409 + (0.01728285211520138*applyconv))); + tempSample += (b[79] * (0.06450430362918153 - (0.02492994833691022*applyconv))); + tempSample += (b[80] * (0.10187400687649277 - (0.03578455940532403*applyconv))); + tempSample += (b[81] * (0.11039763294094571 - (0.03995523517573508*applyconv))); + tempSample += (b[82] * (0.08557960776024547 - (0.03482514309492527*applyconv))); + tempSample += (b[83] * (0.02730881850805332 - (0.00514750108411127*applyconv))); + //end HighPowerStack conv + break; + case 2: + //begin VintageStack conv + tempSample += (b[1] * (1.31698250313308396 - (0.08140616497621633*applyconv))); + tempSample += (b[2] * (1.47229016949915326 - (0.27680278993637253*applyconv))); + tempSample += (b[3] * (1.30410109086044956 - (0.35629113432046489*applyconv))); + tempSample += (b[4] * (0.81766210474551260 - (0.26808782337659753*applyconv))); + tempSample += (b[5] * (0.19868872545506663 - (0.11105517193919669*applyconv))); + tempSample -= (b[6] * (0.39115909132567039 - (0.12630622002682679*applyconv))); + tempSample -= (b[7] * (0.76881891559343574 - (0.40879849500403143*applyconv))); + tempSample -= (b[8] * (0.87146861782680340 - (0.59529560488000599*applyconv))); + tempSample -= (b[9] * (0.79504575932563670 - (0.60877047551611796*applyconv))); + tempSample -= (b[10] * (0.61653017622406314 - (0.47662851438557335*applyconv))); + tempSample -= (b[11] * (0.40718195794382067 - (0.24955839378539713*applyconv))); + tempSample -= (b[12] * (0.31794900040616203 - (0.04169792259600613*applyconv))); + tempSample -= (b[13] * (0.41075032540217843 + (0.00368483996076280*applyconv))); + tempSample -= (b[14] * (0.56901352922170667 - (0.11027360805893105*applyconv))); + tempSample -= (b[15] * (0.62443222391889264 - (0.22198075154245228*applyconv))); + tempSample -= (b[16] * (0.53462856723129204 - (0.22933544545324852*applyconv))); + tempSample -= (b[17] * (0.34441703361995046 - (0.12956809502269492*applyconv))); + tempSample -= (b[18] * (0.13947052337867882 + (0.00339775055962799*applyconv))); + tempSample += (b[19] * (0.03771252648928484 - (0.10863931549251718*applyconv))); + tempSample += (b[20] * (0.18280210770271693 - (0.17413646599296417*applyconv))); + tempSample += (b[21] * (0.24621986701761467 - (0.14547053270435095*applyconv))); + tempSample += (b[22] * (0.22347075142737360 - (0.02493869490104031*applyconv))); + tempSample += (b[23] * (0.14346348482123716 + (0.11284054747963246*applyconv))); + tempSample += (b[24] * (0.00834364862916028 + (0.24284684053733926*applyconv))); + tempSample -= (b[25] * (0.11559740296078347 - (0.32623054435304538*applyconv))); + tempSample -= (b[26] * (0.18067604561283060 - (0.32311481551122478*applyconv))); + tempSample -= (b[27] * (0.22927997789035612 - (0.26991539052832925*applyconv))); + tempSample -= (b[28] * (0.28487666578669446 - (0.22437227250279349*applyconv))); + tempSample -= (b[29] * (0.31992973037153838 - (0.15289876100963865*applyconv))); + tempSample -= (b[30] * (0.35174606303520733 - (0.05656293023086628*applyconv))); + tempSample -= (b[31] * (0.36894898011375254 + (0.04333925421463558*applyconv))); + tempSample -= (b[32] * (0.32567576055307507 + (0.14594589410921388*applyconv))); + tempSample -= (b[33] * (0.27440135050585784 + (0.15529667398122521*applyconv))); + tempSample -= (b[34] * (0.21998973785078091 + (0.05083553737157104*applyconv))); + tempSample -= (b[35] * (0.10323624876862457 - (0.04651829594199963*applyconv))); + tempSample += (b[36] * (0.02091603687851074 + (0.12000046818439322*applyconv))); + tempSample += (b[37] * (0.11344930914138468 + (0.17697142512225839*applyconv))); + tempSample += (b[38] * (0.22766779627643968 + (0.13645102964003858*applyconv))); + tempSample += (b[39] * (0.38378309953638229 - (0.01997653307333791*applyconv))); + tempSample += (b[40] * (0.52789400804568076 - (0.21409137428422448*applyconv))); + tempSample += (b[41] * (0.55444630296938280 - (0.32331980931576626*applyconv))); + tempSample += (b[42] * (0.42333237669264601 - (0.26855847463044280*applyconv))); + tempSample += (b[43] * (0.21942831522035078 - (0.12051365248820624*applyconv))); + tempSample -= (b[44] * (0.00584169427830633 - (0.03706970171280329*applyconv))); + tempSample -= (b[45] * (0.24279799124660351 - (0.17296440491477982*applyconv))); + tempSample -= (b[46] * (0.40173760787507085 - (0.21717989835163351*applyconv))); + tempSample -= (b[47] * (0.43930035724188155 - (0.16425928481378199*applyconv))); + tempSample -= (b[48] * (0.41067765934041811 - (0.10390115786636855*applyconv))); + tempSample -= (b[49] * (0.34409235547165967 - (0.07268159377411920*applyconv))); + tempSample -= (b[50] * (0.26542883122568151 - (0.05483457497365785*applyconv))); + tempSample -= (b[51] * (0.22024754776138800 - (0.06484897950087598*applyconv))); + tempSample -= (b[52] * (0.20394367993632415 - (0.08746309731952180*applyconv))); + tempSample -= (b[53] * (0.17565242431124092 - (0.07611309538078760*applyconv))); + tempSample -= (b[54] * (0.10116623231246825 - (0.00642818706295112*applyconv))); + tempSample -= (b[55] * (0.00782648272053632 + (0.08004141267685004*applyconv))); + tempSample += (b[56] * (0.05059046006747323 - (0.12436676387548490*applyconv))); + tempSample += (b[57] * (0.06241531553254467 - (0.11530779547021434*applyconv))); + tempSample += (b[58] * (0.04952694587101836 - (0.08340945324333944*applyconv))); + tempSample += (b[59] * (0.00843873294401687 - (0.03279659052562903*applyconv))); + tempSample -= (b[60] * (0.05161338949440241 - (0.03428181149163798*applyconv))); + tempSample -= (b[61] * (0.08165520146902012 - (0.08196746092283110*applyconv))); + tempSample -= (b[62] * (0.06639532849935320 - (0.09797462781896329*applyconv))); + tempSample -= (b[63] * (0.02953430910661621 - (0.09175612938515763*applyconv))); + tempSample += (b[64] * (0.00741058547442938 + (0.05442091048731967*applyconv))); + tempSample += (b[65] * (0.01832866125391727 + (0.00306243693643687*applyconv))); + tempSample += (b[66] * (0.00526964230373573 - (0.04364102661136410*applyconv))); + tempSample -= (b[67] * (0.00300984373848200 + (0.09742737841278880*applyconv))); + tempSample -= (b[68] * (0.00413616769576694 + (0.14380661694523073*applyconv))); + tempSample -= (b[69] * (0.00588769034931419 + (0.16012843578892538*applyconv))); + tempSample -= (b[70] * (0.00688588239450581 + (0.14074464279305798*applyconv))); + tempSample -= (b[71] * (0.02277307992926315 + (0.07914752191801366*applyconv))); + tempSample -= (b[72] * (0.04627166091180877 - (0.00192787268067208*applyconv))); + tempSample -= (b[73] * (0.05562045897455786 - (0.05932868727665747*applyconv))); + tempSample -= (b[74] * (0.05134243784922165 - (0.08245334798868090*applyconv))); + tempSample -= (b[75] * (0.04719409472239919 - (0.07498680629253825*applyconv))); + tempSample -= (b[76] * (0.05889738914266415 - (0.06116127018043697*applyconv))); + tempSample -= (b[77] * (0.09428363535111127 - (0.06535868867863834*applyconv))); + tempSample -= (b[78] * (0.15181756953225126 - (0.08982979655234427*applyconv))); + tempSample -= (b[79] * (0.20878969456036670 - (0.10761070891499538*applyconv))); + tempSample -= (b[80] * (0.22647885581813790 - (0.08462542510349125*applyconv))); + tempSample -= (b[81] * (0.19723482443646323 - (0.02665160920736287*applyconv))); + tempSample -= (b[82] * (0.16441643451155163 + (0.02314691954338197*applyconv))); + tempSample -= (b[83] * (0.15201914054931515 + (0.04424903493886839*applyconv))); + tempSample -= (b[84] * (0.15454370641307855 + (0.04223203797913008*applyconv))); + //end VintageStack conv + break; + case 3: + //begin BoutiqueStack conv + tempSample += (b[1] * (1.30406584776167445 - (0.01410622186823351*applyconv))); + tempSample += (b[2] * (1.09350974154373559 + (0.34478044709202327*applyconv))); + tempSample += (b[3] * (0.52285510059938256 + (0.84225842837363574*applyconv))); + tempSample -= (b[4] * (0.00018126260714707 - (1.02446537989058117*applyconv))); + tempSample -= (b[5] * (0.34943699771860115 - (0.84094709567790016*applyconv))); + tempSample -= (b[6] * (0.53068048407937285 - (0.49231169327705593*applyconv))); + tempSample -= (b[7] * (0.48631669406792399 - (0.08965111766223610*applyconv))); + tempSample -= (b[8] * (0.28099201947014130 + (0.23921137841068607*applyconv))); + tempSample -= (b[9] * (0.10333290012666248 + (0.35058962687321482*applyconv))); + tempSample -= (b[10] * (0.06605032198166226 + (0.23447405567823365*applyconv))); + tempSample -= (b[11] * (0.10485808661261729 + (0.05025985449763527*applyconv))); + tempSample -= (b[12] * (0.13231190973014911 - (0.05484648240248013*applyconv))); + tempSample -= (b[13] * (0.12926184767180304 - (0.04054223744746116*applyconv))); + tempSample -= (b[14] * (0.13802696739839460 + (0.01876754906568237*applyconv))); + tempSample -= (b[15] * (0.16548980700926913 + (0.06772130758771169*applyconv))); + tempSample -= (b[16] * (0.14469310965751475 + (0.10590928840978781*applyconv))); + tempSample -= (b[17] * (0.07838457396093310 + (0.13120101199677947*applyconv))); + tempSample -= (b[18] * (0.05123031606187391 + (0.13883400806512292*applyconv))); + tempSample -= (b[19] * (0.08906103481939850 + (0.07840461228402337*applyconv))); + tempSample -= (b[20] * (0.13939265522625241 + (0.01194366471800457*applyconv))); + tempSample -= (b[21] * (0.14957600717294034 + (0.07687598594361914*applyconv))); + tempSample -= (b[22] * (0.14112708654047090 + (0.20118461131186977*applyconv))); + tempSample -= (b[23] * (0.14961020766492997 + (0.30005716443826147*applyconv))); + tempSample -= (b[24] * (0.16130382224652270 + (0.40459872030013055*applyconv))); + tempSample -= (b[25] * (0.15679868471080052 + (0.47292767226083465*applyconv))); + tempSample -= (b[26] * (0.16456530552807727 + (0.45182121471666481*applyconv))); + tempSample -= (b[27] * (0.16852385701909278 + (0.38272684270752266*applyconv))); + tempSample -= (b[28] * (0.13317562760966850 + (0.28829580273670768*applyconv))); + tempSample -= (b[29] * (0.09396196532150952 + (0.18886898332071317*applyconv))); + tempSample -= (b[30] * (0.10133496956734221 + (0.11158788414137354*applyconv))); + tempSample -= (b[31] * (0.16097596389376778 + (0.02621299102374547*applyconv))); + tempSample -= (b[32] * (0.21419006394821866 - (0.03585678078834797*applyconv))); + tempSample -= (b[33] * (0.21273234570555244 - (0.02574469802924526*applyconv))); + tempSample -= (b[34] * (0.16934948798707830 + (0.01354331184333835*applyconv))); + tempSample -= (b[35] * (0.11970436472852493 + (0.04242183865883427*applyconv))); + tempSample -= (b[36] * (0.09329023656747724 + (0.06890873292358397*applyconv))); + tempSample -= (b[37] * (0.10255328436608116 + (0.11482972519137427*applyconv))); + tempSample -= (b[38] * (0.13883223352796811 + (0.18016014431438840*applyconv))); + tempSample -= (b[39] * (0.16532844286979087 + (0.24521957638633446*applyconv))); + tempSample -= (b[40] * (0.16254607738965438 + (0.25669472097572482*applyconv))); + tempSample -= (b[41] * (0.15353207135544752 + (0.15048064682912729*applyconv))); + tempSample -= (b[42] * (0.13039046390746015 - (0.00200335414623601*applyconv))); + tempSample -= (b[43] * (0.06707245032180627 - (0.06498125592578702*applyconv))); + tempSample += (b[44] * (0.01427326441869788 + (0.01940451360783622*applyconv))); + tempSample += (b[45] * (0.06151238306578224 - (0.07335755969763329*applyconv))); + tempSample += (b[46] * (0.04685840498892526 - (0.14258849371688248*applyconv))); + tempSample -= (b[47] * (0.00950136304466093 + (0.14379354707665129*applyconv))); + tempSample -= (b[48] * (0.06245771575493557 + (0.07639718586346110*applyconv))); + tempSample -= (b[49] * (0.07159593175777741 - (0.00595536565276915*applyconv))); + tempSample -= (b[50] * (0.03167929390245019 - (0.03856769526301793*applyconv))); + tempSample += (b[51] * (0.01890898565110766 + (0.00760539424271147*applyconv))); + tempSample += (b[52] * (0.04926161137832240 - (0.06411014430053390*applyconv))); + tempSample += (b[53] * (0.05768814623421683 - (0.15068618173358578*applyconv))); + tempSample += (b[54] * (0.06144258297076708 - (0.21200636329120301*applyconv))); + tempSample += (b[55] * (0.06348341960185613 - (0.19620269813094307*applyconv))); + tempSample += (b[56] * (0.04877736350310589 - (0.11864999881200111*applyconv))); + tempSample += (b[57] * (0.01010950997574472 - (0.02630070679113791*applyconv))); + tempSample -= (b[58] * (0.02929178864801191 - (0.04439260202207482*applyconv))); + tempSample -= (b[59] * (0.03484517126321562 - (0.04508635396034735*applyconv))); + tempSample -= (b[60] * (0.00547176780437610 - (0.00205637806941426*applyconv))); + tempSample += (b[61] * (0.02278296865283977 - (0.00063732526427685*applyconv))); + tempSample += (b[62] * (0.02688982591366477 + (0.05333738901586284*applyconv))); + tempSample += (b[63] * (0.01942012754957055 + (0.10942832669749143*applyconv))); + tempSample += (b[64] * (0.01572585258756565 + (0.11189204189054594*applyconv))); + tempSample += (b[65] * (0.01490550715016034 + (0.04449822818925343*applyconv))); + tempSample += (b[66] * (0.01715683226376727 - (0.06944648050933899*applyconv))); + tempSample += (b[67] * (0.02822659878011318 - (0.17843652160132820*applyconv))); + tempSample += (b[68] * (0.03758307610456144 - (0.21986013433664692*applyconv))); + tempSample += (b[69] * (0.03275008021608433 - (0.15869878676112170*applyconv))); + tempSample += (b[70] * (0.01855749786752354 - (0.02337224995718105*applyconv))); + tempSample += (b[71] * (0.00217095395782931 + (0.10971764224593601*applyconv))); + tempSample -= (b[72] * (0.01851381451105007 - (0.17214910008793413*applyconv))); + tempSample -= (b[73] * (0.04722574936345419 - (0.14341588977845254*applyconv))); + tempSample -= (b[74] * (0.07151540514482006 - (0.04684695724814321*applyconv))); + tempSample -= (b[75] * (0.06827195484995092 + (0.07022207121861397*applyconv))); + tempSample -= (b[76] * (0.03290227240464227 + (0.16328400808152735*applyconv))); + tempSample += (b[77] * (0.01043861198275382 - (0.20184486126076279*applyconv))); + tempSample += (b[78] * (0.03236563559476477 - (0.17125821306380920*applyconv))); + tempSample += (b[79] * (0.02040121529932702 - (0.09103660189829657*applyconv))); + tempSample -= (b[80] * (0.00509649513318102 + (0.01170360991547489*applyconv))); + tempSample -= (b[81] * (0.01388353426600228 - (0.03588955538451771*applyconv))); + tempSample -= (b[82] * (0.00523671715033842 - (0.07068798057534148*applyconv))); + tempSample += (b[83] * (0.00665852487721137 + (0.11666210640054926*applyconv))); + tempSample += (b[84] * (0.01593540832939290 + (0.15844892856402149*applyconv))); + tempSample += (b[85] * (0.02080509201836796 + (0.17186274420065850*applyconv))); + //end BoutiqueStack conv + break; + case 4: + //begin LargeCombo conv + tempSample += (b[1] * (1.31819680801404560 + (0.00362521700518292*applyconv))); + tempSample += (b[2] * (1.37738284126127919 + (0.14134596126256205*applyconv))); + tempSample += (b[3] * (1.09957637225311622 + (0.33199581815501555*applyconv))); + tempSample += (b[4] * (0.62025358899656258 + (0.37476042042088142*applyconv))); + tempSample += (b[5] * (0.12926194402137478 + (0.24702655568406759*applyconv))); + tempSample -= (b[6] * (0.28927985011367602 - (0.13289168298307708*applyconv))); + tempSample -= (b[7] * (0.56518146339033448 - (0.11026641793526121*applyconv))); + tempSample -= (b[8] * (0.59843200696815069 - (0.10139909232154271*applyconv))); + tempSample -= (b[9] * (0.45219971861789204 - (0.13313355255903159*applyconv))); + tempSample -= (b[10] * (0.32520490032331351 - (0.29009061730364216*applyconv))); + tempSample -= (b[11] * (0.29773131872442909 - (0.45307495356996669*applyconv))); + tempSample -= (b[12] * (0.31738895975218867 - (0.43198591958928922*applyconv))); + tempSample -= (b[13] * (0.33336150604703757 - (0.24240412850274029*applyconv))); + tempSample -= (b[14] * (0.32461638442042151 - (0.02779297492397464*applyconv))); + tempSample -= (b[15] * (0.27812829473787770 + (0.15565718905032455*applyconv))); + tempSample -= (b[16] * (0.19413454458668097 + (0.32087693535188599*applyconv))); + tempSample -= (b[17] * (0.12378036344480114 + (0.37736575956794161*applyconv))); + tempSample -= (b[18] * (0.12550494837257106 + (0.25593811142722300*applyconv))); + tempSample -= (b[19] * (0.17725736033713696 + (0.07708896413593636*applyconv))); + tempSample -= (b[20] * (0.22023699647700670 - (0.01600371273599124*applyconv))); + tempSample -= (b[21] * (0.21987645486953747 + (0.00973336938352798*applyconv))); + tempSample -= (b[22] * (0.15014276479707978 + (0.11602269600138954*applyconv))); + tempSample -= (b[23] * (0.05176520203073560 + (0.20383164255692698*applyconv))); + tempSample -= (b[24] * (0.04276687165294867 + (0.17785002166834518*applyconv))); + tempSample -= (b[25] * (0.15951546388137597 + (0.06748854885822464*applyconv))); + tempSample -= (b[26] * (0.30211952144352616 - (0.03440494237025149*applyconv))); + tempSample -= (b[27] * (0.36462803375134506 - (0.05874284362202409*applyconv))); + tempSample -= (b[28] * (0.32283960219377539 + (0.01189623197958362*applyconv))); + tempSample -= (b[29] * (0.19245178663350720 + (0.11088858383712991*applyconv))); + tempSample += (b[30] * (0.00681589563349590 - (0.16314250963457660*applyconv))); + tempSample += (b[31] * (0.20927798345622584 - (0.16952981620487462*applyconv))); + tempSample += (b[32] * (0.25638846543430976 - (0.11462562122281153*applyconv))); + tempSample += (b[33] * (0.04584495673888605 + (0.04669671229804190*applyconv))); + tempSample -= (b[34] * (0.25221561978187662 - (0.19250758741703761*applyconv))); + tempSample -= (b[35] * (0.35662801992424953 - (0.12244680002787561*applyconv))); + tempSample -= (b[36] * (0.21498114329314663 + (0.12152120956991189*applyconv))); + tempSample += (b[37] * (0.00968605571673376 - (0.30597812512858558*applyconv))); + tempSample += (b[38] * (0.18029119870614621 - (0.31569386468576782*applyconv))); + tempSample += (b[39] * (0.22744437185251629 - (0.18028438460422197*applyconv))); + tempSample += (b[40] * (0.09725687638959078 + (0.05479918522830433*applyconv))); + tempSample -= (b[41] * (0.17970389267353537 - (0.29222750363124067*applyconv))); + tempSample -= (b[42] * (0.42371969704763018 - (0.34924957781842314*applyconv))); + tempSample -= (b[43] * (0.43313266755788055 - (0.11503731970288061*applyconv))); + tempSample -= (b[44] * (0.22178165627851801 + (0.25002925550036226*applyconv))); + tempSample -= (b[45] * (0.00410198176852576 + (0.43283281457037676*applyconv))); + tempSample += (b[46] * (0.09072426344812032 - (0.35318250460706446*applyconv))); + tempSample += (b[47] * (0.08405839183965140 - (0.16936391987143717*applyconv))); + tempSample -= (b[48] * (0.01110419756114383 - (0.01247164991313877*applyconv))); + tempSample -= (b[49] * (0.18593334646855278 - (0.14513260199423966*applyconv))); + tempSample -= (b[50] * (0.33665010871497486 - (0.14456206192169668*applyconv))); + tempSample -= (b[51] * (0.32644968491439380 + (0.01594380759082303*applyconv))); + tempSample -= (b[52] * (0.14855437679485431 + (0.23555511219002742*applyconv))); + tempSample += (b[53] * (0.05113019250820622 - (0.35556617126595202*applyconv))); + tempSample += (b[54] * (0.12915754942362243 - (0.28571671825750300*applyconv))); + tempSample += (b[55] * (0.07406865846069306 - (0.10543886479975995*applyconv))); + tempSample -= (b[56] * (0.03669573814193980 - (0.03194267657582078*applyconv))); + tempSample -= (b[57] * (0.13429103278009327 - (0.06145796486786051*applyconv))); + tempSample -= (b[58] * (0.17884021749974641 - (0.00156626902982124*applyconv))); + tempSample -= (b[59] * (0.16138212225178239 + (0.09402070836837134*applyconv))); + tempSample -= (b[60] * (0.10867028245257521 + (0.15407963447815898*applyconv))); + tempSample -= (b[61] * (0.06312416389213464 + (0.11241095544179526*applyconv))); + tempSample -= (b[62] * (0.05826376574081994 - (0.03635253545701986*applyconv))); + tempSample -= (b[63] * (0.07991631148258237 - (0.18041947557579863*applyconv))); + tempSample -= (b[64] * (0.07777397532506500 - (0.20817156738202205*applyconv))); + tempSample -= (b[65] * (0.03812528734394271 - (0.13679963125162486*applyconv))); + tempSample += (b[66] * (0.00204900323943951 + (0.04009000730101046*applyconv))); + tempSample += (b[67] * (0.01779599498119764 - (0.04218637577942354*applyconv))); + tempSample += (b[68] * (0.00950301949319113 - (0.07908911305044238*applyconv))); + tempSample -= (b[69] * (0.04283600714814891 + (0.02716262334097985*applyconv))); + tempSample -= (b[70] * (0.14478320837041933 - (0.08823515277628832*applyconv))); + tempSample -= (b[71] * (0.23250267035795688 - (0.15334197814956568*applyconv))); + tempSample -= (b[72] * (0.22369031446225857 - (0.08550989980799503*applyconv))); + tempSample -= (b[73] * (0.11142757883989868 + (0.08321482928259660*applyconv))); + tempSample += (b[74] * (0.02752318631713307 - (0.25252906099212968*applyconv))); + tempSample += (b[75] * (0.11940028414727490 - (0.34358127205009553*applyconv))); + tempSample += (b[76] * (0.12702057126698307 - (0.31808560130583663*applyconv))); + tempSample += (b[77] * (0.03639067777025356 - (0.17970282734717846*applyconv))); + tempSample -= (b[78] * (0.11389848143835518 + (0.00470616711331971*applyconv))); + tempSample -= (b[79] * (0.23024072979374310 - (0.09772245468884058*applyconv))); + tempSample -= (b[80] * (0.24389015061112601 - (0.09600959885615798*applyconv))); + tempSample -= (b[81] * (0.16680269075295703 - (0.05194978963662898*applyconv))); + tempSample -= (b[82] * (0.05108041495077725 - (0.01796071525570735*applyconv))); + tempSample += (b[83] * (0.06489835353859555 - (0.00808013770331126*applyconv))); + tempSample += (b[84] * (0.15481511440233464 - (0.02674063848284838*applyconv))); + tempSample += (b[85] * (0.18620867857907253 - (0.01786423699465214*applyconv))); + tempSample += (b[86] * (0.13879832139055756 + (0.01584446839973597*applyconv))); + tempSample += (b[87] * (0.04878235109120615 + (0.02962866516075816*applyconv))); + //end LargeCombo conv + break; + case 5: + //begin SmallCombo conv + tempSample += (b[1] * (1.42133070619855229 - (0.18270903813104500*applyconv))); + tempSample += (b[2] * (1.47209686171873821 - (0.27954009590498585*applyconv))); + tempSample += (b[3] * (1.34648011331265294 - (0.47178343556301960*applyconv))); + tempSample += (b[4] * (0.82133804036124580 - (0.41060189990353935*applyconv))); + tempSample += (b[5] * (0.21628057120466901 - (0.26062442734317454*applyconv))); + tempSample -= (b[6] * (0.30306716082877883 + (0.10067648425439185*applyconv))); + tempSample -= (b[7] * (0.69484313178531876 - (0.09655574841702286*applyconv))); + tempSample -= (b[8] * (0.88320822356980833 - (0.26501644327144314*applyconv))); + tempSample -= (b[9] * (0.81326147029423723 - (0.31115926837054075*applyconv))); + tempSample -= (b[10] * (0.56728759049069222 - (0.23304233545561287*applyconv))); + tempSample -= (b[11] * (0.33340326645198737 - (0.12361361388240180*applyconv))); + tempSample -= (b[12] * (0.20280263733605616 - (0.03531960962500105*applyconv))); + tempSample -= (b[13] * (0.15864533788751345 + (0.00355160825317868*applyconv))); + tempSample -= (b[14] * (0.12544767480555119 + (0.01979010423176500*applyconv))); + tempSample -= (b[15] * (0.06666788902658917 + (0.00188830739903378*applyconv))); + tempSample += (b[16] * (0.02977793355081072 + (0.02304216615605394*applyconv))); + tempSample += (b[17] * (0.12821526330916558 + (0.02636238376777800*applyconv))); + tempSample += (b[18] * (0.19933812710210136 - (0.02932657234709721*applyconv))); + tempSample += (b[19] * (0.18346460191225772 - (0.12859581955080629*applyconv))); + tempSample -= (b[20] * (0.00088697526755385 + (0.15855257539277415*applyconv))); + tempSample -= (b[21] * (0.28904286712096761 + (0.06226286786982616*applyconv))); + tempSample -= (b[22] * (0.49133546282552537 - (0.06512851581813534*applyconv))); + tempSample -= (b[23] * (0.52908013030763046 - (0.13606992188523465*applyconv))); + tempSample -= (b[24] * (0.45897241332311706 - (0.15527194946346906*applyconv))); + tempSample -= (b[25] * (0.35535938629924352 - (0.13634771941703441*applyconv))); + tempSample -= (b[26] * (0.26185269405237693 - (0.08736651482771546*applyconv))); + tempSample -= (b[27] * (0.19997351944186473 - (0.01714565029656306*applyconv))); + tempSample -= (b[28] * (0.18894054145105646 + (0.04557612705740050*applyconv))); + tempSample -= (b[29] * (0.24043993691153928 + (0.05267500387081067*applyconv))); + tempSample -= (b[30] * (0.29191852873822671 + (0.01922151122971644*applyconv))); + tempSample -= (b[31] * (0.29399783430587761 - (0.02238952856106585*applyconv))); + tempSample -= (b[32] * (0.26662219155294159 - (0.07760819463416335*applyconv))); + tempSample -= (b[33] * (0.20881206667122221 - (0.11930017354479640*applyconv))); + tempSample -= (b[34] * (0.12916658879944876 - (0.11798638949823513*applyconv))); + tempSample -= (b[35] * (0.07678815166012012 - (0.06826864734598684*applyconv))); + tempSample -= (b[36] * (0.08568505484529348 - (0.00510459741104792*applyconv))); + tempSample -= (b[37] * (0.13613615872486634 + (0.02288223583971244*applyconv))); + tempSample -= (b[38] * (0.17426657494209266 + (0.02723737220296440*applyconv))); + tempSample -= (b[39] * (0.17343619261009030 + (0.01412920547179825*applyconv))); + tempSample -= (b[40] * (0.14548368977428555 - (0.02640418940455951*applyconv))); + tempSample -= (b[41] * (0.10485295885802372 - (0.06334665781931498*applyconv))); + tempSample -= (b[42] * (0.06632268974717079 - (0.05960343688612868*applyconv))); + tempSample -= (b[43] * (0.06915692039882040 - (0.03541337869596061*applyconv))); + tempSample -= (b[44] * (0.11889611687783583 - (0.02250608307287119*applyconv))); + tempSample -= (b[45] * (0.14598456370320673 + (0.00280345943128246*applyconv))); + tempSample -= (b[46] * (0.12312084125613143 + (0.04947283933434576*applyconv))); + tempSample -= (b[47] * (0.11379940289994711 + (0.06590080966570636*applyconv))); + tempSample -= (b[48] * (0.12963290754003182 + (0.02597647654256477*applyconv))); + tempSample -= (b[49] * (0.12723837402978638 - (0.04942071966927938*applyconv))); + tempSample -= (b[50] * (0.09185015882996231 - (0.10420810015956679*applyconv))); + tempSample -= (b[51] * (0.04011592913036545 - (0.10234174227772008*applyconv))); + tempSample += (b[52] * (0.00992597785057113 + (0.05674042373836896*applyconv))); + tempSample += (b[53] * (0.04921452178306781 - (0.00222698867111080*applyconv))); + tempSample += (b[54] * (0.06096504883783566 - (0.04040426549982253*applyconv))); + tempSample += (b[55] * (0.04113530718724200 - (0.04190143593049960*applyconv))); + tempSample += (b[56] * (0.01292699017654650 - (0.01121994018532499*applyconv))); + tempSample -= (b[57] * (0.00437123132431870 - (0.02482497612289103*applyconv))); + tempSample -= (b[58] * (0.02090571264211918 - (0.03732746039260295*applyconv))); + tempSample -= (b[59] * (0.04749751678612051 - (0.02960060937328099*applyconv))); + tempSample -= (b[60] * (0.07675095194206227 - (0.02241927084099648*applyconv))); + tempSample -= (b[61] * (0.08879414028581609 - (0.01144281133042115*applyconv))); + tempSample -= (b[62] * (0.07378854974999530 + (0.02518742701599147*applyconv))); + tempSample -= (b[63] * (0.04677309194488959 + (0.08984657372223502*applyconv))); + tempSample -= (b[64] * (0.02911874044176449 + (0.14202665940555093*applyconv))); + tempSample -= (b[65] * (0.02103564720234969 + (0.14640411976171003*applyconv))); + tempSample -= (b[66] * (0.01940626429101940 + (0.10867274382865903*applyconv))); + tempSample -= (b[67] * (0.03965401793931531 + (0.04775225375522835*applyconv))); + tempSample -= (b[68] * (0.08102486457314527 - (0.03204447425666343*applyconv))); + tempSample -= (b[69] * (0.11794849372825778 - (0.12755667382696789*applyconv))); + tempSample -= (b[70] * (0.11946469076758266 - (0.20151394599125422*applyconv))); + tempSample -= (b[71] * (0.07404630324668053 - (0.21300634351769704*applyconv))); + tempSample -= (b[72] * (0.00477584437144086 - (0.16864707684978708*applyconv))); + tempSample += (b[73] * (0.05924822014377220 + (0.09394651445109450*applyconv))); + tempSample += (b[74] * (0.10060989907457370 + (0.00419196431884887*applyconv))); + tempSample += (b[75] * (0.10817907203844988 - (0.07459664480796091*applyconv))); + tempSample += (b[76] * (0.08701102204768002 - (0.11129477437630560*applyconv))); + tempSample += (b[77] * (0.05673785623180162 - (0.10638640242375266*applyconv))); + tempSample += (b[78] * (0.02944190197442081 - (0.08499792583420167*applyconv))); + tempSample += (b[79] * (0.01570145445652971 - (0.06190456843465320*applyconv))); + tempSample += (b[80] * (0.02770233032476748 - (0.04573713136865480*applyconv))); + tempSample += (b[81] * (0.05417160459175360 - (0.03965651064634598*applyconv))); + tempSample += (b[82] * (0.06080831637644498 - (0.02909500789113911*applyconv))); + //end SmallCombo conv + break; + case 6: + //begin Bass conv + tempSample += (b[1] * (1.35472031405494242 + (0.00220914099195157*applyconv))); + tempSample += (b[2] * (1.63534207755253003 - (0.11406232654509685*applyconv))); + tempSample += (b[3] * (1.82334575691525869 - (0.42647194712964054*applyconv))); + tempSample += (b[4] * (1.86156386235405868 - (0.76744187887586590*applyconv))); + tempSample += (b[5] * (1.67332739338852599 - (0.95161997324293013*applyconv))); + tempSample += (b[6] * (1.25054130794899021 - (0.98410433514572859*applyconv))); + tempSample += (b[7] * (0.70049121047281737 - (0.87375612110718992*applyconv))); + tempSample += (b[8] * (0.15291791448081560 - (0.61195266024519046*applyconv))); + tempSample -= (b[9] * (0.37301992914152693 + (0.16755422915252094*applyconv))); + tempSample -= (b[10] * (0.76568539228498433 - (0.28554435228965386*applyconv))); + tempSample -= (b[11] * (0.95726568749937369 - (0.61659719162806048*applyconv))); + tempSample -= (b[12] * (1.01273552193911032 - (0.81827288407943954*applyconv))); + tempSample -= (b[13] * (0.93920108117234447 - (0.80077111864205874*applyconv))); + tempSample -= (b[14] * (0.79831898832953974 - (0.65814750339694406*applyconv))); + tempSample -= (b[15] * (0.64200088100452313 - (0.46135833001232618*applyconv))); + tempSample -= (b[16] * (0.48807302802822128 - (0.15506178974799034*applyconv))); + tempSample -= (b[17] * (0.36545171501947982 + (0.16126103769376721*applyconv))); + tempSample -= (b[18] * (0.31469581455759105 + (0.32250870039053953*applyconv))); + tempSample -= (b[19] * (0.36893534817945800 + (0.25409418897237473*applyconv))); + tempSample -= (b[20] * (0.41092557722975687 + (0.13114730488878301*applyconv))); + tempSample -= (b[21] * (0.38584044480710594 + (0.06825323739722661*applyconv))); + tempSample -= (b[22] * (0.33378434007178670 + (0.04144255489164217*applyconv))); + tempSample -= (b[23] * (0.26144203061699706 + (0.06031313105098152*applyconv))); + tempSample -= (b[24] * (0.25818342000920502 + (0.03642289242586355*applyconv))); + tempSample -= (b[25] * (0.28096018498822661 + (0.00976973667327174*applyconv))); + tempSample -= (b[26] * (0.25845682019095384 + (0.02749015358080831*applyconv))); + tempSample -= (b[27] * (0.26655607865953096 - (0.00329839675455690*applyconv))); + tempSample -= (b[28] * (0.30590085026938518 - (0.07375043215328811*applyconv))); + tempSample -= (b[29] * (0.32875683916470899 - (0.12454134857516502*applyconv))); + tempSample -= (b[30] * (0.38166643180506560 - (0.19973911428609989*applyconv))); + tempSample -= (b[31] * (0.49068186937289598 - (0.34785166842136384*applyconv))); + tempSample -= (b[32] * (0.60274753867622777 - (0.48685038872711034*applyconv))); + tempSample -= (b[33] * (0.65944678627090636 - (0.49844657885975518*applyconv))); + tempSample -= (b[34] * (0.64488955808717285 - (0.40514406499806987*applyconv))); + tempSample -= (b[35] * (0.55818730353434354 - (0.28029870614987346*applyconv))); + tempSample -= (b[36] * (0.43110859113387556 - (0.15373504582939335*applyconv))); + tempSample -= (b[37] * (0.37726894966096269 - (0.11570983506028532*applyconv))); + tempSample -= (b[38] * (0.39953242355200935 - (0.17879231130484088*applyconv))); + tempSample -= (b[39] * (0.36726676379100875 - (0.22013553023983223*applyconv))); + tempSample -= (b[40] * (0.27187029469227386 - (0.18461171768478427*applyconv))); + tempSample -= (b[41] * (0.21109334552321635 - (0.14497481318083569*applyconv))); + tempSample -= (b[42] * (0.19808797405293213 - (0.14916579928186940*applyconv))); + tempSample -= (b[43] * (0.16287926785495671 - (0.15146098461120627*applyconv))); + tempSample -= (b[44] * (0.11086621477163359 - (0.13182973443924018*applyconv))); + tempSample -= (b[45] * (0.07531043236890560 - (0.08062172796472888*applyconv))); + tempSample -= (b[46] * (0.01747364473230771 + (0.02201865873632456*applyconv))); + tempSample += (b[47] * (0.03080279125662693 - (0.08721756240972101*applyconv))); + tempSample += (b[48] * (0.02354148659185142 - (0.06376361763053796*applyconv))); + tempSample -= (b[49] * (0.02835772372098715 + (0.00589978513642627*applyconv))); + tempSample -= (b[50] * (0.08983370744565244 - (0.02350960427706536*applyconv))); + tempSample -= (b[51] * (0.14148947620055380 - (0.03329826628693369*applyconv))); + tempSample -= (b[52] * (0.17576502674572581 - (0.06507546651241880*applyconv))); + tempSample -= (b[53] * (0.17168865666573860 - (0.07734801128437317*applyconv))); + tempSample -= (b[54] * (0.14107027738292105 - (0.03136459344220402*applyconv))); + tempSample -= (b[55] * (0.12287163395380074 + (0.01933408169185258*applyconv))); + tempSample -= (b[56] * (0.12276622398112971 + (0.01983508766241737*applyconv))); + tempSample -= (b[57] * (0.12349721440213673 - (0.01111031415304768*applyconv))); + tempSample -= (b[58] * (0.08649454142716655 + (0.02252815645513927*applyconv))); + tempSample -= (b[59] * (0.00953083685474757 + (0.13778878548343007*applyconv))); + tempSample += (b[60] * (0.06045983158868478 - (0.23966318224935096*applyconv))); + tempSample += (b[61] * (0.09053229817093242 - (0.27190119941572544*applyconv))); + tempSample += (b[62] * (0.08112662178843048 - (0.22456862606452327*applyconv))); + tempSample += (b[63] * (0.07503525686243730 - (0.14330154410548213*applyconv))); + tempSample += (b[64] * (0.07372595404399729 - (0.06185193766408734*applyconv))); + tempSample += (b[65] * (0.06073789200080433 + (0.01261857435786178*applyconv))); + tempSample += (b[66] * (0.04616712695742254 + (0.05851771967084609*applyconv))); + tempSample += (b[67] * (0.01036235510345900 + (0.08286534414423796*applyconv))); + tempSample -= (b[68] * (0.03708389413229191 - (0.06695282381039531*applyconv))); + tempSample -= (b[69] * (0.07092204876981217 - (0.01915829199112784*applyconv))); + tempSample -= (b[70] * (0.09443579589460312 + (0.01210082455316246*applyconv))); + tempSample -= (b[71] * (0.07824038577769601 + (0.06121988546065113*applyconv))); + tempSample -= (b[72] * (0.00854730633079399 + (0.14468518752295506*applyconv))); + tempSample += (b[73] * (0.06845589924191028 - (0.18902431382592944*applyconv))); + tempSample += (b[74] * (0.10351569998375465 - (0.13204443060279647*applyconv))); + tempSample += (b[75] * (0.10513368758532179 - (0.02993199294485649*applyconv))); + tempSample += (b[76] * (0.08896978950235003 + (0.04074499273825906*applyconv))); + tempSample += (b[77] * (0.03697537734050980 + (0.09217751130846838*applyconv))); + tempSample -= (b[78] * (0.04014322441280276 - (0.14062297149365666*applyconv))); + tempSample -= (b[79] * (0.10505934581398618 - (0.16988861157275814*applyconv))); + tempSample -= (b[80] * (0.13937661651676272 - (0.15083294570551492*applyconv))); + tempSample -= (b[81] * (0.13183458845108439 - (0.06657454442471208*applyconv))); + //end Bass conv + break; + } + inputSample *= correctdrygain; + inputSample += (tempSample*colorIntensity); + inputSample /= correctboost; + ataHalfwaySample += inputSample; + //restore interpolated signal including time domain stuff now + //end center code for handling timedomain/conv stuff + + //second wave of Cabs style slew clamping + clamp = inputSample - lastPostSample; + if (clamp > threshold) inputSample = lastPostSample + threshold; + if (-clamp > rarefaction) inputSample = lastPostSample - rarefaction; + lastPostSample = inputSample; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySample - lastPostHalfSample; + if (clamp > threshold) ataHalfwaySample = lastPostHalfSample + threshold; + if (-clamp > rarefaction) ataHalfwaySample = lastPostHalfSample - rarefaction; + lastPostHalfSample = ataHalfwaySample; + //end interpolated sample + + //post-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double HeadBump; + if (flip) + { + iirHeadBumpA += (inputSample * HeadBumpFreq); + iirHeadBumpA -= (iirHeadBumpA * iirHeadBumpA * iirHeadBumpA * HeadBumpFreq); + if (iirHeadBumpA > 0) iirHeadBumpA -= dcblock; + if (iirHeadBumpA < 0) iirHeadBumpA += dcblock; + if (fabs(iirHeadBumpA) > 100.0) + {iirHeadBumpA = 0.0; iirHeadBumpB = 0.0; iirHalfHeadBumpA = 0.0; iirHalfHeadBumpB = 0.0;} + HeadBump = iirHeadBumpA; + } + else + { + iirHeadBumpB += (inputSample * HeadBumpFreq); + iirHeadBumpB -= (iirHeadBumpB * iirHeadBumpB * iirHeadBumpB * HeadBumpFreq); + if (iirHeadBumpB > 0) iirHeadBumpB -= dcblock; + if (iirHeadBumpB < 0) iirHeadBumpB += dcblock; + if (fabs(iirHeadBumpB) > 100.0) + {iirHeadBumpA = 0.0; iirHeadBumpB = 0.0; iirHalfHeadBumpA = 0.0; iirHalfHeadBumpB = 0.0;} + HeadBump = iirHeadBumpB; + } + HeadBump /= LowsPad; + inputSample = (inputSample * (1.0-heavy)) + (HeadBump * heavy); + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + if (flip) + { + iirHalfHeadBumpA += (ataHalfwaySample * HeadBumpFreq); + iirHalfHeadBumpA -= (iirHalfHeadBumpA * iirHalfHeadBumpA * iirHalfHeadBumpA * HeadBumpFreq); + if (iirHalfHeadBumpA > 0) iirHalfHeadBumpA -= dcblock; + if (iirHalfHeadBumpA < 0) iirHalfHeadBumpA += dcblock; + if (fabs(iirHalfHeadBumpA) > 100.0) + {iirHeadBumpA = 0.0; iirHeadBumpB = 0.0; iirHalfHeadBumpA = 0.0; iirHalfHeadBumpB = 0.0;} + HeadBump = iirHalfHeadBumpA; + } + else + { + iirHalfHeadBumpB += (ataHalfwaySample * HeadBumpFreq); + iirHalfHeadBumpB -= (iirHalfHeadBumpB * iirHalfHeadBumpB * iirHalfHeadBumpB * HeadBumpFreq); + if (iirHalfHeadBumpB > 0) iirHalfHeadBumpB -= dcblock; + if (iirHalfHeadBumpB < 0) iirHalfHeadBumpB += dcblock; + if (fabs(iirHalfHeadBumpB) > 100.0) + {iirHeadBumpA = 0.0; iirHeadBumpB = 0.0; iirHalfHeadBumpA = 0.0; iirHalfHeadBumpB = 0.0;} + HeadBump = iirHalfHeadBumpB; + } + HeadBump /= LowsPad; + ataHalfwaySample = (ataHalfwaySample * (1.0-heavy)) + (HeadBump * heavy); + //end interpolated sample + + //begin antialiasing section for halfway sample + ataC = ataHalfwaySample - ataHalfDrySample; + if (flip) {ataA *= 0.94; ataB *= 0.94; ataA += ataC; ataB -= ataC; ataC = ataA;} + else {ataB *= 0.94; ataA *= 0.94; ataB += ataC; ataA -= ataC; ataC = ataB;} + ataHalfDiffSample = (ataC * 0.94); + //end antialiasing section for halfway sample + + //begin antialiasing section for raw sample + ataC = inputSample - ataDrySample; + if (flip) {ataA *= 0.94; ataB *= 0.94; ataA += ataC; ataB -= ataC; ataC = ataA;} + else {ataB *= 0.94; ataA *= 0.94; ataB += ataC; ataA -= ataC; ataC = ataB;} + ataDiffSample = (ataC * 0.94); + //end antialiasing section for input sample + flip = !flip; + + inputSample = ataDrySample; inputSample += ((ataDiffSample + ataHalfDiffSample + ataPrevDiffSample) / 1.0); + ataPrevDiffSample = ataDiffSample / 2.0; + //apply processing as difference to non-oversampled raw input + + clamp = inputSample - postPostSample; + if (clamp > postThreshold) inputSample = postPostSample + postThreshold; + if (-clamp > postRarefaction) inputSample = postPostSample - postRarefaction; + postPostSample = inputSample; + inputSample /= postTrim; + + inputSample *= output; + + if (cycleEnd == 4) { + lastRef[0] = lastRef[4]; //start from previous last + lastRef[2] = (lastRef[0] + inputSample)/2; //half + lastRef[1] = (lastRef[0] + lastRef[2])/2; //one quarter + lastRef[3] = (lastRef[2] + inputSample)/2; //three quarters + lastRef[4] = inputSample; //full + } + if (cycleEnd == 3) { + lastRef[0] = lastRef[3]; //start from previous last + lastRef[2] = (lastRef[0]+lastRef[0]+inputSample)/3; //third + lastRef[1] = (lastRef[0]+inputSample+inputSample)/3; //two thirds + lastRef[3] = inputSample; //full + } + if (cycleEnd == 2) { + lastRef[0] = lastRef[2]; //start from previous last + lastRef[1] = (lastRef[0] + inputSample)/2; //half + lastRef[2] = inputSample; //full + } + if (cycleEnd == 1) { + lastRef[0] = inputSample; + } + cycle = 0; //reset + inputSample = lastRef[cycle]; + } else { + inputSample = lastRef[cycle]; + //we are going through our references now + } + + //begin 32 bit stereo floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither + *destP = inputSample; + + sourceP += inNumChannels; destP += inNumChannels; + } +} + diff --git a/plugins/MacSignedAU/Cabs/Cabs.exp b/plugins/MacSignedAU/Cabs/Cabs.exp new file mode 100755 index 000000000..ef53f836f --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.exp @@ -0,0 +1 @@ +_CabsEntry diff --git a/plugins/MacSignedAU/Cabs/Cabs.h b/plugins/MacSignedAU/Cabs/Cabs.h new file mode 100755 index 000000000..61d1979b3 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.h @@ -0,0 +1,203 @@ +/* +* File: Cabs.h +* +* Version: 1.0 +* +* Created: 3/27/11 +* +* Copyright: Copyright © 2011 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#include "AUEffectBase.h" +#include "CabsVersion.h" + +#if AU_DEBUG_DISPATCHER + #include "AUDebugDispatcher.h" +#endif + + +#ifndef __Cabs_h__ +#define __Cabs_h__ + + +#pragma mark ____Cabs Parameters + +// parameters +static CFStringRef kParameterOneName = CFSTR("Cab Type"); +static const int kHighPowerStack = 1; +static const int kVintageStack = 2; +static const int kBoutiqueStack = 3; +static const int kLargeCombo = 4; +static const int kSmallCombo = 5; +static const int kBass = 6; +static const int kDefaultValue_ParamOne = kHighPowerStack; + +static CFStringRef kMenuItem_HighPowerStack = CFSTR ("High Power Stack"); +static CFStringRef kMenuItem_VintageStack = CFSTR ("Vintage Stack"); +static CFStringRef kMenuItem_BoutiqueStack = CFSTR ("Boutique Stack"); +static CFStringRef kMenuItem_LargeCombo = CFSTR ("Large Combo"); +static CFStringRef kMenuItem_SmallCombo = CFSTR ("Small Combo"); +static CFStringRef kMenuItem_Bass = CFSTR ("Bass Amp"); + +static CFStringRef kParameterTwoName = CFSTR("Intensity"); +static const float kDefaultValue_ParamTwo = 0.66; + +static CFStringRef kParameterThreeName = CFSTR("Rm Loud"); +static const float kDefaultValue_ParamThree = 0.33; + +static CFStringRef kParameterFourName = CFSTR("Cab Size"); +static const float kDefaultValue_ParamFour = 0.66; + + +static CFStringRef kParameterFiveName = CFSTR("Off Axis"); +static const float kDefaultValue_ParamFive = 0.33; + +static CFStringRef kParameterSixName = CFSTR("Output"); +static const float kDefaultValue_ParamSix = 0.5; + + + + +//Alter the name if desired, but using the plugin name is a start + +enum { + kParam_One =0, + kParam_Two =1, + kParam_Three =2, + kParam_Four =3, + kParam_Five =4, + kParam_Six =5, + //Add your parameters here... + kNumberOfParameters=6 +}; + +#pragma mark ____Cabs +class Cabs : public AUEffectBase +{ +public: + Cabs(AudioUnit component); +#if AU_DEBUG_DISPATCHER + virtual ~Cabs () { delete mDebugDispatcher; } +#endif + + virtual AUKernelBase * NewKernel() { return new CabsKernel(this); } + + virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + CFArrayRef * outStrings); + + virtual ComponentResult GetParameterInfo(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + AudioUnitParameterInfo &outParameterInfo); + + virtual ComponentResult GetPropertyInfo(AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + UInt32 & outDataSize, + Boolean & outWritable ); + + virtual ComponentResult GetProperty(AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + void * outData); + + virtual ComponentResult Initialize(); + virtual bool SupportsTail () { return true; } + virtual Float64 GetTailTime() {return 1.0/GetSampleRate()*91.0;} //in SECONDS! + virtual Float64 GetLatency() {return 0.0;} // in SECONDS! + + /*! @method Version */ + virtual ComponentResult Version() { return kCabsVersion; } + + + +protected: + class CabsKernel : public AUKernelBase // most of the real work happens here + { +public: + CabsKernel(AUEffectBase *inAudioUnit ) + : AUKernelBase(inAudioUnit) + { + } + + // *Required* overides for the process method for this effect + // processes one channel of interleaved samples + virtual void Process( const Float32 *inSourceP, + Float32 *inDestP, + UInt32 inFramesToProcess, + UInt32 inNumChannels, + bool &ioSilence); + + virtual void Reset(); + + private: + Float64 ataLast3Sample; + Float64 ataLast2Sample; + Float64 ataLast1Sample; + Float64 ataHalfwaySample; + Float64 ataHalfDrySample; + Float64 ataHalfDiffSample; + Float64 ataA; + Float64 ataB; + Float64 ataC; + Float64 ataDrySample; + Float64 ataDiffSample; + Float64 ataPrevDiffSample; + Float64 b[90]; + Float64 lastSample; + Float64 lastHalfSample; + Float64 lastPostSample; + Float64 lastPostHalfSample; + Float64 postPostSample; + Float64 d[21]; + Float64 control; + Float64 iirHeadBumpA; + Float64 iirHeadBumpB; + Float64 iirHalfHeadBumpA; + Float64 iirHalfHeadBumpB; + double lastRef[7]; + + bool flip; + bool ataFlip; + int gcount; + int cycle; + + uint32_t fpd; + }; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +#endif \ No newline at end of file diff --git a/plugins/MacSignedAU/Cabs/Cabs.r b/plugins/MacSignedAU/Cabs/Cabs.r new file mode 100755 index 000000000..56b834eb7 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.r @@ -0,0 +1,61 @@ +/* +* File: Cabs.r +* +* Version: 1.0 +* +* Created: 3/27/11 +* +* Copyright: Copyright © 2011 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#include + +#include "CabsVersion.h" + +// Note that resource IDs must be spaced 2 apart for the 'STR ' name and description +#define kAudioUnitResID_Cabs 1000 + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cabs~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#define RES_ID kAudioUnitResID_Cabs +#define COMP_TYPE kAudioUnitType_Effect +#define COMP_SUBTYPE Cabs_COMP_SUBTYPE +#define COMP_MANUF Cabs_COMP_MANF + +#define VERSION kCabsVersion +#define NAME "Airwindows: Cabs" +#define DESCRIPTION "Cabs AU" +#define ENTRY_POINT "CabsEntry" + +#include "AUResources.r" \ No newline at end of file diff --git a/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.mode1v3 b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.mode1v3 new file mode 100644 index 000000000..842f4f02d --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.mode1v3 @@ -0,0 +1,1367 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 8BD3CCBC148831C90062E48C + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + build + debugger-enable-breakpoints + get-info + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 2 + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 518 360 788 504 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + Cabs.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + Cabs.cpp + _historyCapacity + 0 + bookmark + 8BE89C5E15E1AF2500F2ABFD + history + + 8BE89C5D15E1AF2500F2ABFD + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 232}} + RubberWindowFrame + 518 360 788 504 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 232pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 237}, {580, 226}} + RubberWindowFrame + 518 360 788 504 0 0 1440 878 + + Module + XCDetailModule + Proportion + 226pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 8BE89C5F15E1AF2500F2ABFD + 1CE0B1FE06471DED0097A5F4 + 8BE89C6015E1AF2500F2ABFD + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 8BE89C6215E1AF2500F2ABFD + 8BD3CCBD148831C90062E48C + /Users/christopherjohnson/Desktop/Dropbox/AU/Cabs/Cabs.xcodeproj + + WindowString + 518 360 788 504 0 0 1440 878 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 668 222 500 500 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 668 222 500 500 0 0 1440 878 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 8BD3CCBD148831C90062E48C + 8BE89C6115E1AF2500F2ABFD + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 668 222 500 500 0 0 1440 878 + WindowToolGUID + 8BD3CCBD148831C90062E48C + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser new file mode 100644 index 000000000..428332682 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser @@ -0,0 +1,137 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Cabs */; + breakpoints = ( + ); + codeSenseManager = 8BD3CCB9148830B20062E48C /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 364, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 301, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 667089481; + PBXWorkspaceStateSaveDate = 667089481; + }; + perUserProjectItems = { + 8B8A15DC27C18150006BFCCB /* PBXTextBookmark */ = 8B8A15DC27C18150006BFCCB /* PBXTextBookmark */; + 8B9D6B1F27C2FA6600C49ABD /* PBXTextBookmark */ = 8B9D6B1F27C2FA6600C49ABD /* PBXTextBookmark */; + 8BCCEDAE27C2F69700202ED0 /* PBXTextBookmark */ = 8BCCEDAE27C2F69700202ED0 /* PBXTextBookmark */; + }; + sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; + userBuildSettings = { + }; + }; + 8B8A15DC27C18150006BFCCB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BC6025B073B072D006C4272 /* Cabs.h */; + name = "Cabs.h: 57"; + rLen = 725; + rLoc = 2793; + rType = 0; + vrLen = 204; + vrLoc = 3; + }; + 8B9D6B1F27C2FA6600C49ABD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Cabs.cpp */; + name = "Cabs.cpp: 956"; + rLen = 0; + rLoc = 63267; + rType = 0; + vrLen = 24; + vrLoc = 46; + }; + 8BA05A660720730100365D66 /* Cabs.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {840, 18468}}"; + sepNavSelRange = "{63267, 0}"; + sepNavVisRange = "{46, 24}"; + sepNavWindowFrame = "{{513, 184}, {918, 694}}"; + }; + }; + 8BA05A670720730100365D66 /* Cabs.exp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1085, 437}}"; + sepNavSelRange = "{11, 0}"; + sepNavVisRange = "{0, 11}"; + sepNavWindowFrame = "{{15, 128}, {1132, 565}}"; + }; + }; + 8BC6025B073B072D006C4272 /* Cabs.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1056, 3438}}"; + sepNavSelRange = "{4067, 0}"; + sepNavVisRange = "{2703, 1148}"; + sepNavWindowFrame = "{{819, 174}, {834, 694}}"; + }; + }; + 8BCCEDAE27C2F69700202ED0 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Cabs.cpp */; + name = "Cabs.cpp: 956"; + rLen = 0; + rLoc = 63267; + rType = 0; + vrLen = 28; + vrLoc = 42; + }; + 8BD3CCB8148830B20062E48C /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 8BD3CCB9148830B20062E48C /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D01CCC60486CAD60068D4B7 /* Cabs */ = { + activeExec = 0; + }; +} diff --git a/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 new file mode 100644 index 000000000..7cc1c1729 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 @@ -0,0 +1,1505 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + AIODescriptionKey + DockingSystemVisible + + Extension + perspectivev3 + FavBarConfig + + PBXProjectModuleGUID + 8BB3DEBA27B9956500DC535D + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.defaultV3 + MajorVersion + 34 + MinorVersion + 0 + Name + All-In-One + Notifications + + + XCObserverAutoDisconnectKey + + XCObserverDefintionKey + + PBXStatusErrorsKey + 0 + + XCObserverFactoryKey + XCPerspectivesSpecificationIdentifier + XCObserverGUIDKey + XCObserverProjectIdentifier + XCObserverNotificationKey + PBXStatusBuildStateMessageNotification + XCObserverTargetKey + XCMainBuildResultsModuleGUID + XCObserverTriggerKey + awakenModuleWithObserver: + XCObserverValidationKey + + PBXStatusErrorsKey + 2 + + + + OpenEditors + + PerspectiveWidths + + 810 + 810 + + Perspectives + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CA23ED40692098700951B8B + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 185 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 8BA05A56072072A900365D66 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 4 + 2 + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {185, 428}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {202, 446}} + GroupTreeTableConfiguration + + MainColumn + 185 + + RubberWindowFrame + 611 224 810 487 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 202pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 8BB3DEB327B9956500DC535D + PBXProjectModuleLabel + Cabs.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 8BB3DEB427B9956500DC535D + PBXProjectModuleLabel + Cabs.cpp + _historyCapacity + 0 + bookmark + 8B9D6B1F27C2FA6600C49ABD + history + + 8B8A15DC27C18150006BFCCB + 8BCCEDAE27C2F69700202ED0 + + + SplitCount + 1 + + StatusBarVisibility + + XCSharingToken + com.apple.Xcode.CommonNavigatorGroupSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {603, 51}} + RubberWindowFrame + 611 224 810 487 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 51pt + + + Proportion + 390pt + Tabs + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EDF0692099D00951B8B + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{10, 27}, {603, 363}} + RubberWindowFrame + 611 224 810 487 0 0 1440 878 + + Module + XCDetailModule + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EE00692099D00951B8B + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXProjectFindModule + + + ContentConfiguration + + PBXCVSModuleFilterTypeKey + 1032 + PBXProjectModuleGUID + 1CA23EE10692099D00951B8B + PBXProjectModuleLabel + SCM Results + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXCVSModule + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1023 + XCBuildResultsTrigger_Open + 1012 + + GeometryConfiguration + + Frame + {{10, 27}, {603, 297}} + + Module + PBXBuildResultsModule + + + + + Proportion + 603pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDockableTabModule + XCDetailModule + PBXProjectFindModule + PBXCVSModule + PBXBuildResultsModule + + TableOfContents + + 8B9D6B2027C2FA6600C49ABD + 1CA23ED40692098700951B8B + 8B9D6B2127C2FA6600C49ABD + 8BB3DEB327B9956500DC535D + 8B9D6B2227C2FA6600C49ABD + 1CA23EDF0692099D00951B8B + 1CA23EE00692099D00951B8B + 1CA23EE10692099D00951B8B + XCMainBuildResultsModuleGUID + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + debugger-restart-executable + debugger-pause + debugger-step-over + debugger-step-into + debugger-step-out + NSToolbarFlexibleSpaceItem + servicesModulebreakpoints + debugger-show-console-window + + ControllerClassBaseName + PBXDebugSessionModule + IconName + DebugTabIcon + Identifier + perspective.debug + IsVertical + + Layout + + + ContentConfiguration + + PBXProjectModuleGUID + 1CCC7628064C1048000F2A68 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {424, 270}} + + Module + PBXDebugCLIModule + Proportion + 270pt + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {395, 213}} + {{395, 0}, {415, 213}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {810, 213}} + {{0, 213}, {810, 225}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1CCC7629064C1048000F2A68 + PBXProjectModuleLabel + Debug + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 7}, {810, 438}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 120 + Value + 85 + Summary + 185 + + Frame + {{395, 0}, {415, 213}} + + + Module + PBXDebugSessionModule + Proportion + 438pt + + + Name + Debug + ServiceClasses + + XCModuleDock + PBXDebugCLIModule + PBXDebugSessionModule + PBXDebugProcessAndThreadModule + PBXDebugProcessViewModule + PBXDebugThreadViewModule + PBXDebugStackFrameViewModule + PBXNavigatorGroup + + TableOfContents + + 8B8A173027C2E1D2006BFCCB + 1CCC7628064C1048000F2A68 + 1CCC7629064C1048000F2A68 + 8B8A173127C2E1D2006BFCCB + 8B8A173227C2E1D2006BFCCB + 8B8A173327C2E1D2006BFCCB + 8B8A173427C2E1D2006BFCCB + 8B8A173527C2E1D2006BFCCB + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.debugV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' + StatusbarIsVisible + + TimeStamp + 667089510.88117802 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + + WindowJustification + 5 + WindowOrderList + + 8B9D6B2327C2FA6600C49ABD + /Users/christopherjohnson/Desktop/airwindows/plugins/MacAU/Cabs/Cabs.xcodeproj + + WindowString + 611 224 810 487 0 0 1440 878 + WindowToolsV3 + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.build + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {500, 215}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + + GeometryConfiguration + + Frame + {{0, 222}, {500, 236}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 458pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 192 257 500 500 0 0 1280 1002 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {700, 358}} + RubberWindowFrame + 149 87 700 400 0 0 1440 878 + + Module + PBXDebugCLIModule + Proportion + 358pt + + + Proportion + 358pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D5B069F1CE1000CFCEE + 1C530D5C069F1CE1000CFCEE + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 149 87 440 400 0 0 1440 878 + WindowToolGUID + 1C530D5B069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.09500122070312 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scmV3 + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 166pt + + + Proportion + 166pt + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {369, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {616, 353}} + MembersFrame + {{0, 105}, {369, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 94 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 597 125 616 374 0 0 1280 1002 + + Module + PBXClassBrowserModule + Proportion + 354pt + + + Proportion + 354pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C78EABA065D492600B07095 + 1C78EABB065D492600B07095 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 597 125 616 374 0 0 1280 1002 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/project.pbxproj b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/project.pbxproj new file mode 100644 index 000000000..d0b5f82de --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 3EEA126E089847F5002C6BFC /* CAVectorUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */; }; + 3EEA126F089847F5002C6BFC /* CAVectorUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */; }; + 3EEA1270089847F5002C6BFC /* CAVectorUnitTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */; }; + 8B4119B70749654200361ABE /* Cabs.r in Rez */ = {isa = PBXBuildFile; fileRef = 8BA05A680720730100365D66 /* Cabs.r */; }; + 8BA05A6B0720730100365D66 /* Cabs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A660720730100365D66 /* Cabs.cpp */; }; + 8BA05A6E0720730100365D66 /* CabsVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A690720730100365D66 /* CabsVersion.h */; }; + 8BA05AAE072073D300365D66 /* AUBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A7F072073D200365D66 /* AUBase.cpp */; }; + 8BA05AAF072073D300365D66 /* AUBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A80072073D200365D66 /* AUBase.h */; }; + 8BA05AB0072073D300365D66 /* AUDispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A81072073D200365D66 /* AUDispatch.cpp */; }; + 8BA05AB1072073D300365D66 /* AUDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A82072073D200365D66 /* AUDispatch.h */; }; + 8BA05AB2072073D300365D66 /* AUInputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A83072073D200365D66 /* AUInputElement.cpp */; }; + 8BA05AB3072073D300365D66 /* AUInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A84072073D200365D66 /* AUInputElement.h */; }; + 8BA05AB4072073D300365D66 /* AUOutputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A85072073D200365D66 /* AUOutputElement.cpp */; }; + 8BA05AB5072073D300365D66 /* AUOutputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A86072073D200365D66 /* AUOutputElement.h */; }; + 8BA05AB7072073D300365D66 /* AUScopeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A88072073D200365D66 /* AUScopeElement.cpp */; }; + 8BA05AB8072073D300365D66 /* AUScopeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A89072073D200365D66 /* AUScopeElement.h */; }; + 8BA05AB9072073D300365D66 /* ComponentBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A8A072073D200365D66 /* ComponentBase.cpp */; }; + 8BA05ABA072073D300365D66 /* ComponentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A8B072073D200365D66 /* ComponentBase.h */; }; + 8BA05AC6072073D300365D66 /* AUEffectBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */; }; + 8BA05AC7072073D300365D66 /* AUEffectBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A9B072073D200365D66 /* AUEffectBase.h */; }; + 8BA05AD2072073D300365D66 /* AUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AA7072073D200365D66 /* AUBuffer.cpp */; }; + 8BA05AD3072073D300365D66 /* AUBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AA8072073D200365D66 /* AUBuffer.h */; }; + 8BA05AD4072073D300365D66 /* AUDebugDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */; }; + 8BA05AD5072073D300365D66 /* AUDebugDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */; }; + 8BA05AD6072073D300365D66 /* AUInputFormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */; }; + 8BA05AD7072073D300365D66 /* AUSilentTimeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */; }; + 8BA05AD8072073D300365D66 /* AUTimestampGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */; }; + 8BA05AE50720742100365D66 /* CAAudioChannelLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */; }; + 8BA05AE60720742100365D66 /* CAAudioChannelLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */; }; + 8BA05AE70720742100365D66 /* CAMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AE10720742100365D66 /* CAMutex.cpp */; }; + 8BA05AE80720742100365D66 /* CAMutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE20720742100365D66 /* CAMutex.h */; }; + 8BA05AE90720742100365D66 /* CAStreamBasicDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */; }; + 8BA05AEA0720742100365D66 /* CAStreamBasicDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */; }; + 8BA05AFC072074E100365D66 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05AF9072074E100365D66 /* AudioToolbox.framework */; }; + 8BA05AFD072074E100365D66 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05AFA072074E100365D66 /* AudioUnit.framework */; }; + 8BA05B02072074F900365D66 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05B01072074F900365D66 /* CoreServices.framework */; }; + 8BA05B070720754400365D66 /* CAAUParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05B050720754400365D66 /* CAAUParameter.cpp */; }; + 8BA05B080720754400365D66 /* CAAUParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05B060720754400365D66 /* CAAUParameter.h */; }; + 8BC6025C073B072D006C4272 /* Cabs.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BC6025B073B072D006C4272 /* Cabs.h */; }; + 8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; + F7C347F00ECE5AF8008ADFB6 /* AUBaseHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */; }; + F7C347F10ECE5AF8008ADFB6 /* AUBaseHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAVectorUnit.cpp; sourceTree = ""; }; + 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAVectorUnit.h; sourceTree = ""; }; + 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAVectorUnitTypes.h; sourceTree = ""; }; + 8B5C7FBF076FB2C200A15F61 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; + 8BA05A660720730100365D66 /* Cabs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cabs.cpp; sourceTree = ""; }; + 8BA05A670720730100365D66 /* Cabs.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = Cabs.exp; sourceTree = ""; }; + 8BA05A680720730100365D66 /* Cabs.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = Cabs.r; sourceTree = ""; }; + 8BA05A690720730100365D66 /* CabsVersion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CabsVersion.h; sourceTree = ""; }; + 8BA05A7F072073D200365D66 /* AUBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUBase.cpp; sourceTree = ""; }; + 8BA05A80072073D200365D66 /* AUBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUBase.h; sourceTree = ""; }; + 8BA05A81072073D200365D66 /* AUDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUDispatch.cpp; sourceTree = ""; }; + 8BA05A82072073D200365D66 /* AUDispatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUDispatch.h; sourceTree = ""; }; + 8BA05A83072073D200365D66 /* AUInputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUInputElement.cpp; sourceTree = ""; }; + 8BA05A84072073D200365D66 /* AUInputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUInputElement.h; sourceTree = ""; }; + 8BA05A85072073D200365D66 /* AUOutputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUOutputElement.cpp; sourceTree = ""; }; + 8BA05A86072073D200365D66 /* AUOutputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUOutputElement.h; sourceTree = ""; }; + 8BA05A87072073D200365D66 /* AUResources.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = AUResources.r; sourceTree = ""; }; + 8BA05A88072073D200365D66 /* AUScopeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUScopeElement.cpp; sourceTree = ""; }; + 8BA05A89072073D200365D66 /* AUScopeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUScopeElement.h; sourceTree = ""; }; + 8BA05A8A072073D200365D66 /* ComponentBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ComponentBase.cpp; sourceTree = ""; }; + 8BA05A8B072073D200365D66 /* ComponentBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ComponentBase.h; sourceTree = ""; }; + 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUEffectBase.cpp; sourceTree = ""; }; + 8BA05A9B072073D200365D66 /* AUEffectBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUEffectBase.h; sourceTree = ""; }; + 8BA05AA7072073D200365D66 /* AUBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUBuffer.cpp; sourceTree = ""; }; + 8BA05AA8072073D200365D66 /* AUBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUBuffer.h; sourceTree = ""; }; + 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUDebugDispatcher.cpp; sourceTree = ""; }; + 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUDebugDispatcher.h; sourceTree = ""; }; + 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUInputFormatConverter.h; sourceTree = ""; }; + 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUSilentTimeout.h; sourceTree = ""; }; + 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUTimestampGenerator.h; sourceTree = ""; }; + 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAAudioChannelLayout.cpp; sourceTree = ""; }; + 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAAudioChannelLayout.h; sourceTree = ""; }; + 8BA05AE10720742100365D66 /* CAMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAMutex.cpp; sourceTree = ""; }; + 8BA05AE20720742100365D66 /* CAMutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAMutex.h; sourceTree = ""; }; + 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAStreamBasicDescription.cpp; sourceTree = ""; }; + 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAStreamBasicDescription.h; sourceTree = ""; }; + 8BA05AF9072074E100365D66 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; + 8BA05AFA072074E100365D66 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; + 8BA05B01072074F900365D66 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; + 8BA05B050720754400365D66 /* CAAUParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAAUParameter.cpp; sourceTree = ""; }; + 8BA05B060720754400365D66 /* CAAUParameter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAAUParameter.h; sourceTree = ""; }; + 8BC6025B073B072D006C4272 /* Cabs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Cabs.h; sourceTree = ""; }; + 8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* Cabs.component */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Cabs.component; sourceTree = BUILT_PRODUCTS_DIR; }; + F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBaseHelper.cpp; path = Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; }; + F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBaseHelper.h; path = Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h; sourceTree = SYSTEM_DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05AFC072074E100365D66 /* AudioToolbox.framework in Frameworks */, + 8BA05AFD072074E100365D66 /* AudioUnit.framework in Frameworks */, + 8BA05B02072074F900365D66 /* CoreServices.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* Cabs */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = Cabs; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 8B5C7FBF076FB2C200A15F61 /* CoreAudio.framework */, + 8BA05B01072074F900365D66 /* CoreServices.framework */, + 8BA05AF9072074E100365D66 /* AudioToolbox.framework */, + 8BA05AFA072074E100365D66 /* AudioUnit.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D01CCD10486CAD60068D4B7 /* Info.plist */, + 089C167DFE841241C02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 8BA05A56072072A900365D66 /* AU Source */, + 8BA05AEB0720742700365D66 /* PublicUtility */, + 8BA05A7D072073D200365D66 /* AUPublic */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* Cabs.component */, + ); + name = Products; + sourceTree = ""; + }; + 8BA05A56072072A900365D66 /* AU Source */ = { + isa = PBXGroup; + children = ( + 8BC6025B073B072D006C4272 /* Cabs.h */, + 8BA05A660720730100365D66 /* Cabs.cpp */, + 8BA05A670720730100365D66 /* Cabs.exp */, + 8BA05A680720730100365D66 /* Cabs.r */, + 8BA05A690720730100365D66 /* CabsVersion.h */, + ); + name = "AU Source"; + sourceTree = ""; + }; + 8BA05A7D072073D200365D66 /* AUPublic */ = { + isa = PBXGroup; + children = ( + 8BA05A7E072073D200365D66 /* AUBase */, + 8BA05A99072073D200365D66 /* OtherBases */, + 8BA05AA6072073D200365D66 /* Utility */, + ); + name = AUPublic; + path = Extras/CoreAudio/AudioUnits/AUPublic; + sourceTree = SYSTEM_DEVELOPER_DIR; + }; + 8BA05A7E072073D200365D66 /* AUBase */ = { + isa = PBXGroup; + children = ( + 8BA05A7F072073D200365D66 /* AUBase.cpp */, + 8BA05A80072073D200365D66 /* AUBase.h */, + 8BA05A81072073D200365D66 /* AUDispatch.cpp */, + 8BA05A82072073D200365D66 /* AUDispatch.h */, + 8BA05A83072073D200365D66 /* AUInputElement.cpp */, + 8BA05A84072073D200365D66 /* AUInputElement.h */, + 8BA05A85072073D200365D66 /* AUOutputElement.cpp */, + 8BA05A86072073D200365D66 /* AUOutputElement.h */, + 8BA05A87072073D200365D66 /* AUResources.r */, + 8BA05A88072073D200365D66 /* AUScopeElement.cpp */, + 8BA05A89072073D200365D66 /* AUScopeElement.h */, + 8BA05A8A072073D200365D66 /* ComponentBase.cpp */, + 8BA05A8B072073D200365D66 /* ComponentBase.h */, + ); + path = AUBase; + sourceTree = ""; + }; + 8BA05A99072073D200365D66 /* OtherBases */ = { + isa = PBXGroup; + children = ( + 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */, + 8BA05A9B072073D200365D66 /* AUEffectBase.h */, + ); + path = OtherBases; + sourceTree = ""; + }; + 8BA05AA6072073D200365D66 /* Utility */ = { + isa = PBXGroup; + children = ( + F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */, + F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */, + 8BA05AA7072073D200365D66 /* AUBuffer.cpp */, + 8BA05AA8072073D200365D66 /* AUBuffer.h */, + 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */, + 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */, + 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */, + 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */, + 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */, + ); + path = Utility; + sourceTree = ""; + }; + 8BA05AEB0720742700365D66 /* PublicUtility */ = { + isa = PBXGroup; + children = ( + 8BA05B050720754400365D66 /* CAAUParameter.cpp */, + 8BA05B060720754400365D66 /* CAAUParameter.h */, + 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */, + 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */, + 8BA05AE10720742100365D66 /* CAMutex.cpp */, + 8BA05AE20720742100365D66 /* CAMutex.h */, + 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */, + 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */, + 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */, + 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */, + 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */, + ); + name = PublicUtility; + path = Extras/CoreAudio/PublicUtility; + sourceTree = SYSTEM_DEVELOPER_DIR; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05A6E0720730100365D66 /* CabsVersion.h in Headers */, + 8BA05AAF072073D300365D66 /* AUBase.h in Headers */, + 8BA05AB1072073D300365D66 /* AUDispatch.h in Headers */, + 8BA05AB3072073D300365D66 /* AUInputElement.h in Headers */, + 8BA05AB5072073D300365D66 /* AUOutputElement.h in Headers */, + 8BA05AB8072073D300365D66 /* AUScopeElement.h in Headers */, + 8BA05ABA072073D300365D66 /* ComponentBase.h in Headers */, + 8BA05AC7072073D300365D66 /* AUEffectBase.h in Headers */, + 8BA05AD3072073D300365D66 /* AUBuffer.h in Headers */, + 8BA05AD5072073D300365D66 /* AUDebugDispatcher.h in Headers */, + 8BA05AD6072073D300365D66 /* AUInputFormatConverter.h in Headers */, + 8BA05AD7072073D300365D66 /* AUSilentTimeout.h in Headers */, + 8BA05AD8072073D300365D66 /* AUTimestampGenerator.h in Headers */, + 8BA05AE60720742100365D66 /* CAAudioChannelLayout.h in Headers */, + 8BA05AE80720742100365D66 /* CAMutex.h in Headers */, + 8BA05AEA0720742100365D66 /* CAStreamBasicDescription.h in Headers */, + 8BA05B080720754400365D66 /* CAAUParameter.h in Headers */, + 8BC6025C073B072D006C4272 /* Cabs.h in Headers */, + 3EEA126F089847F5002C6BFC /* CAVectorUnit.h in Headers */, + 3EEA1270089847F5002C6BFC /* CAVectorUnitTypes.h in Headers */, + F7C347F10ECE5AF8008ADFB6 /* AUBaseHelper.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* Cabs */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3E4BA243089833B7007656EC /* Build configuration list for PBXNativeTarget "Cabs" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Cabs; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = Cabs; + productReference = 8D01CCD20486CAD60068D4B7 /* Cabs.component */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 3E4BA247089833B7007656EC /* Build configuration list for PBXProject "Cabs" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 089C166AFE841209C02AAC07 /* Cabs */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* Cabs */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + 8B4119B70749654200361ABE /* Cabs.r in Rez */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05A6B0720730100365D66 /* Cabs.cpp in Sources */, + 8BA05AAE072073D300365D66 /* AUBase.cpp in Sources */, + 8BA05AB0072073D300365D66 /* AUDispatch.cpp in Sources */, + 8BA05AB2072073D300365D66 /* AUInputElement.cpp in Sources */, + 8BA05AB4072073D300365D66 /* AUOutputElement.cpp in Sources */, + 8BA05AB7072073D300365D66 /* AUScopeElement.cpp in Sources */, + 8BA05AB9072073D300365D66 /* ComponentBase.cpp in Sources */, + 8BA05AC6072073D300365D66 /* AUEffectBase.cpp in Sources */, + 8BA05AD2072073D300365D66 /* AUBuffer.cpp in Sources */, + 8BA05AD4072073D300365D66 /* AUDebugDispatcher.cpp in Sources */, + 8BA05AE50720742100365D66 /* CAAudioChannelLayout.cpp in Sources */, + 8BA05AE70720742100365D66 /* CAMutex.cpp in Sources */, + 8BA05AE90720742100365D66 /* CAStreamBasicDescription.cpp in Sources */, + 8BA05B070720754400365D66 /* CAAUParameter.cpp in Sources */, + 3EEA126E089847F5002C6BFC /* CAVectorUnit.cpp in Sources */, + F7C347F00ECE5AF8008ADFB6 /* AUBaseHelper.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C167EFE841241C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3E4BA244089833B7007656EC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXPORTED_SYMBOLS_FILE = Cabs.exp; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GENERATE_PKGINFO_FILE = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Audio/Plug-Ins/Components/"; + LIBRARY_STYLE = Bundle; + OTHER_LDFLAGS = "-bundle"; + OTHER_REZFLAGS = "-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64 -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers -I \"$(DEVELOPER_DIR)/Examples/CoreAudio/AudioUnits/AUPublic/AUBase\""; + PRODUCT_NAME = Cabs; + WRAPPER_EXTENSION = component; + }; + name = Debug; + }; + 3E4BA245089833B7007656EC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + x86_64, + ); + EXPORTED_SYMBOLS_FILE = Cabs.exp; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GENERATE_PKGINFO_FILE = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Audio/Plug-Ins/Components/"; + LIBRARY_STYLE = Bundle; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_LDFLAGS = "-bundle"; + OTHER_REZFLAGS = "-d ppc_$ppc -d i386_$i386 -d x86_64_$x86_64 -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers -I \"$(DEVELOPER_DIR)/Examples/CoreAudio/AudioUnits/AUPublic/AUBase\""; + PRODUCT_NAME = Cabs; + SDKROOT = macosx10.5; + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WRAPPER_EXTENSION = component; + }; + name = Release; + }; + 3E4BA248089833B7007656EC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + SDKROOT = macosx10.6; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Debug; + }; + 3E4BA249089833B7007656EC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + SDKROOT = macosx10.6; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3E4BA243089833B7007656EC /* Build configuration list for PBXNativeTarget "Cabs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E4BA244089833B7007656EC /* Debug */, + 3E4BA245089833B7007656EC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 3E4BA247089833B7007656EC /* Build configuration list for PBXProject "Cabs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E4BA248089833B7007656EC /* Debug */, + 3E4BA249089833B7007656EC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/plugins/MacSignedAU/Cabs/CabsVersion.h b/plugins/MacSignedAU/Cabs/CabsVersion.h new file mode 100755 index 000000000..428e8d74b --- /dev/null +++ b/plugins/MacSignedAU/Cabs/CabsVersion.h @@ -0,0 +1,68 @@ +/* +* File: CabsVersion.h +* +* Version: 1.0 +* +* Created: 3/27/11 +* +* Copyright: Copyright © 2011 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#ifndef __CabsVersion_h__ +#define __CabsVersion_h__ + + +#ifdef DEBUG + #define kCabsVersion 0xFFFFFFFF +#else + #define kCabsVersion 0x00010000 +#endif + +//#error A unique component subtype needs to be defined +// Mac OS X identifies your plug-in (components) through its signature, a unique four-character sequence. +// Registering your creator code with Apple helps ensure that your creator code is unique and +// will not conflict with the signature of any other application or plug-in. +// Please visit http://developer.apple.com/datatype/creatorcode.html to register your creator code. + +//~~~~~~~~~~~~~~ Change to your creator code ~~~~~~~~~~~~~~~~~~~~~// +#define Cabs_COMP_MANF 'Dthr' + +//~~~~~~~~~~~~~~ Specify the subtype of Cabs~~~~~~~~~~~~~~~~~~~~~// +#define Cabs_COMP_SUBTYPE 'kabz' + +//This will be a unique identifier within the host + + +#endif + diff --git a/plugins/MacSignedAU/Cabs/Cabs_Prefix.pch b/plugins/MacSignedAU/Cabs/Cabs_Prefix.pch new file mode 100755 index 000000000..40a2e5a99 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Cabs_Prefix.pch @@ -0,0 +1,5 @@ +// +// Prefix header for all source files of the 'Cabs' target in the 'Cabs' project. +// + +#include diff --git a/plugins/MacSignedAU/Cabs/English.lproj/InfoPlist.strings b/plugins/MacSignedAU/Cabs/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..699156ca4bcc41187c503d480176bd9a05da9ff4 GIT binary patch literal 360 zcmZ{fT?+w07=_QZUoq{a3#=lM3lu4&w%jkv5_UD~BYr%dowB89nt5m6Iq%u$yq;B+ zWi(N$l|mh~(?e@T^sZE^j83YAYN#8|F<%?*6`hXc)u0t-WaMomjD0& literal 0 HcmV?d00001 diff --git a/plugins/MacSignedAU/Cabs/Info.plist b/plugins/MacSignedAU/Cabs/Info.plist new file mode 100644 index 000000000..12f0517b5 --- /dev/null +++ b/plugins/MacSignedAU/Cabs/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.airwindows.audiounit.${PRODUCT_NAME:identifier} + CFBundleName + ${PROJECTNAMEASIDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + Dthr + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/plugins/MacSignedAU/Cabs/version.plist b/plugins/MacSignedAU/Cabs/version.plist new file mode 100644 index 000000000..11edf8a1b --- /dev/null +++ b/plugins/MacSignedAU/Cabs/version.plist @@ -0,0 +1,16 @@ + + + + + BuildVersion + 3 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + ProjectName + ${EXECUTABLE_NAME} + SourceVersion + 590000 + + diff --git a/plugins/MacSignedAU/Calibre/Calibre.cpp b/plugins/MacSignedAU/Calibre/Calibre.cpp index 7015d1f94..fd58aead7 100755 --- a/plugins/MacSignedAU/Calibre/Calibre.cpp +++ b/plugins/MacSignedAU/Calibre/Calibre.cpp @@ -222,8 +222,8 @@ void Calibre::CalibreKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = *sourceP * indrive; diff --git a/plugins/MacSignedAU/Capacitor/Capacitor.cpp b/plugins/MacSignedAU/Capacitor/Capacitor.cpp index 099a695f6..9cfaf821e 100755 --- a/plugins/MacSignedAU/Capacitor/Capacitor.cpp +++ b/plugins/MacSignedAU/Capacitor/Capacitor.cpp @@ -196,7 +196,7 @@ void Capacitor::CapacitorKernel::Reset() lastLowpass = 1000.0; lastHighpass = 1000.0; lastWet = 1000.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -228,35 +228,12 @@ void Capacitor::CapacitorKernel::Process( const Float32 *inSourceP, Float64 invHighpass; Float64 dry; - long double inputSample; + double inputSample; Float32 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; lowpassAmount = (((lowpassAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); invLowpass = 1.0 - lowpassAmount; @@ -319,11 +296,11 @@ void Capacitor::CapacitorKernel::Process( const Float32 *inSourceP, inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Capacitor/Capacitor.h b/plugins/MacSignedAU/Capacitor/Capacitor.h index 7608462c8..0cf166044 100755 --- a/plugins/MacSignedAU/Capacitor/Capacitor.h +++ b/plugins/MacSignedAU/Capacitor/Capacitor.h @@ -158,7 +158,7 @@ public: Float64 lastHighpass; Float64 lastWet; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Capacitor2/Capacitor2.cpp b/plugins/MacSignedAU/Capacitor2/Capacitor2.cpp index 6f0dcc189..488cb9803 100755 --- a/plugins/MacSignedAU/Capacitor2/Capacitor2.cpp +++ b/plugins/MacSignedAU/Capacitor2/Capacitor2.cpp @@ -235,9 +235,9 @@ void Capacitor2::Capacitor2Kernel::Process( const Float32 *inSourceP, lastWet = wetChase; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 dielectricScale = fabs(2.0-((inputSample+nonLin)/nonLin)); lowpassBaseAmount = (((lowpassBaseAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); diff --git a/plugins/MacSignedAU/Chamber/Chamber.cpp b/plugins/MacSignedAU/Chamber/Chamber.cpp index 79bebc3f8..20ed4e3c7 100644 --- a/plugins/MacSignedAU/Chamber/Chamber.cpp +++ b/plugins/MacSignedAU/Chamber/Chamber.cpp @@ -251,7 +251,7 @@ void Chamber::ChamberKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -294,7 +294,7 @@ void Chamber::ChamberKernel::Process( const Float32 *inSourceP, //sustain infinitely. while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; diff --git a/plugins/MacSignedAU/Chamber/Chamber.h b/plugins/MacSignedAU/Chamber/Chamber.h index 77dc3149c..d9c5f3fae 100644 --- a/plugins/MacSignedAU/Chamber/Chamber.h +++ b/plugins/MacSignedAU/Chamber/Chamber.h @@ -163,7 +163,7 @@ public: Float64 previousC; Float64 previousD; - long double lastRef[10]; + double lastRef[10]; int countA, delayA; int countB, delayB; diff --git a/plugins/MacSignedAU/Channel4/Channel4.cpp b/plugins/MacSignedAU/Channel4/Channel4.cpp index 576e8737e..005623364 100755 --- a/plugins/MacSignedAU/Channel4/Channel4.cpp +++ b/plugins/MacSignedAU/Channel4/Channel4.cpp @@ -207,11 +207,11 @@ void Channel4::Channel4Kernel::Process( const Float32 *inSourceP, overallscale *= GetSampleRate(); int console = (int) GetParameter( kParam_One ); Float64 density = pow(GetParameter( kParam_Two )/100.0,2); - long double bridgerectifier; + double bridgerectifier; Float64 iirAmount = 0.005832; Float64 threshold = 0.33362176; Float64 clamp; - long double inputSample; + double inputSample; Float32 fpTemp; Float64 fpOld = 0.618033988749894848204586; //golden ratio! Float64 fpNew = 1.0 - fpOld; @@ -227,30 +227,7 @@ void Channel4::Channel4Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { diff --git a/plugins/MacSignedAU/Channel5/Channel5.cpp b/plugins/MacSignedAU/Channel5/Channel5.cpp index 0ca6623b0..e496e9772 100755 --- a/plugins/MacSignedAU/Channel5/Channel5.cpp +++ b/plugins/MacSignedAU/Channel5/Channel5.cpp @@ -190,7 +190,7 @@ ComponentResult Channel5::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Channel5::Channel5Kernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; iirSampleA = 0.0; iirSampleB = 0.0; flip = false; @@ -227,27 +227,9 @@ void Channel5::Channel5Kernel::Process( const Float32 *inSourceP, threshold /= overallscale; //now with 96K AND working selector! while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -260,7 +242,7 @@ void Channel5::Channel5Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double bridgerectifier = fabs(inputSample)*1.57079633; + double bridgerectifier = fabs(inputSample)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSample > 0) inputSample = (inputSample*(1-density))+(bridgerectifier*density); diff --git a/plugins/MacSignedAU/Channel6/Channel6.cpp b/plugins/MacSignedAU/Channel6/Channel6.cpp index a144a03cf..a81cd40e8 100755 --- a/plugins/MacSignedAU/Channel6/Channel6.cpp +++ b/plugins/MacSignedAU/Channel6/Channel6.cpp @@ -227,9 +227,9 @@ void Channel6::Channel6Kernel::Process( const Float32 *inSourceP, threshold /= overallscale; //now with 96K AND working selector! while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -242,14 +242,14 @@ void Channel6::Channel6Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = (drySample*(1-density))+(distSample*density); //drive section diff --git a/plugins/MacSignedAU/Channel6/Channel6.h b/plugins/MacSignedAU/Channel6/Channel6.h index b6b2975e4..8f8cc8706 100755 --- a/plugins/MacSignedAU/Channel6/Channel6.h +++ b/plugins/MacSignedAU/Channel6/Channel6.h @@ -142,10 +142,10 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSample; + double lastSample; }; }; diff --git a/plugins/MacSignedAU/Channel7/Channel7.cpp b/plugins/MacSignedAU/Channel7/Channel7.cpp index 58c4f9430..d88c5b5bb 100755 --- a/plugins/MacSignedAU/Channel7/Channel7.cpp +++ b/plugins/MacSignedAU/Channel7/Channel7.cpp @@ -230,8 +230,8 @@ void Channel7::Channel7Kernel::Process( const Float32 *inSourceP, iirAmount /= overallscale; //we've learned not to try and adjust threshold for sample rate while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -244,15 +244,15 @@ void Channel7::Channel7Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect diff --git a/plugins/MacSignedAU/Channel7/Channel7.h b/plugins/MacSignedAU/Channel7/Channel7.h index 836e48943..eb3b5bb64 100755 --- a/plugins/MacSignedAU/Channel7/Channel7.h +++ b/plugins/MacSignedAU/Channel7/Channel7.h @@ -142,10 +142,10 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSample; + double lastSample; }; }; diff --git a/plugins/MacSignedAU/Channel8/Channel8.cpp b/plugins/MacSignedAU/Channel8/Channel8.cpp index fcdf87e7f..74a0f1aae 100755 --- a/plugins/MacSignedAU/Channel8/Channel8.cpp +++ b/plugins/MacSignedAU/Channel8/Channel8.cpp @@ -229,8 +229,8 @@ void Channel8::Channel8Kernel::Process( const Float32 *inSourceP, iirAmount /= overallscale; //we've learned not to try and adjust threshold for sample rate while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 dielectricScale = fabs(2.0-((inputSample+nonLin)/nonLin)); @@ -245,15 +245,15 @@ void Channel8::Channel8Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section including capacitor modeling nonlinearity - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect diff --git a/plugins/MacSignedAU/Channel8/Channel8.h b/plugins/MacSignedAU/Channel8/Channel8.h index 65e4c9933..c8e9ae070 100755 --- a/plugins/MacSignedAU/Channel8/Channel8.h +++ b/plugins/MacSignedAU/Channel8/Channel8.h @@ -142,12 +142,12 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; + double lastSampleA; + double lastSampleB; + double lastSampleC; }; }; diff --git a/plugins/MacSignedAU/Channel9/Channel9.cpp b/plugins/MacSignedAU/Channel9/Channel9.cpp index 6bacbe15c..7f96ef1ff 100755 --- a/plugins/MacSignedAU/Channel9/Channel9.cpp +++ b/plugins/MacSignedAU/Channel9/Channel9.cpp @@ -257,11 +257,11 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; if (fabs(tempSample)<1.18e-37) tempSample = 0.0; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } @@ -281,15 +281,15 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, inputSample = inputSample - iirSampleB; } //highpass section including capacitor modeling nonlinearity - long double drySample = inputSample; + double drySample = inputSample; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double phatSample = sin(inputSample * 1.57079633); + double phatSample = sin(inputSample * 1.57079633); inputSample *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); + double distSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); inputSample = distSample; //purest form is full Spiral if (density < 1.0) inputSample = (drySample*(1-density))+(distSample*density); //fade Spiral aspect @@ -318,7 +318,7 @@ void Channel9::Channel9Kernel::Process( const Float32 *inSourceP, } if (biquadB[0] < 0.49999) { - long double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; + double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSample; if (fabs(tempSample)<1.18e-37) tempSample = 0.0; inputSample = tempSample; biquadB[10] = biquadB[9]; biquadB[9] = inputSample; //DF1 } diff --git a/plugins/MacSignedAU/Channel9/Channel9.h b/plugins/MacSignedAU/Channel9/Channel9.h index 4b46c7456..5fa4a8f25 100755 --- a/plugins/MacSignedAU/Channel9/Channel9.h +++ b/plugins/MacSignedAU/Channel9/Channel9.h @@ -145,14 +145,14 @@ public: private: uint32_t fpd; - long double iirSampleA; - long double iirSampleB; + double iirSampleA; + double iirSampleB; bool flip; - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double biquadA[11]; - long double biquadB[11]; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double biquadA[11]; + double biquadB[11]; }; }; diff --git a/plugins/MacSignedAU/Chorus/Chorus.cpp b/plugins/MacSignedAU/Chorus/Chorus.cpp index 367670fd1..fb5c99069 100755 --- a/plugins/MacSignedAU/Chorus/Chorus.cpp +++ b/plugins/MacSignedAU/Chorus/Chorus.cpp @@ -181,7 +181,7 @@ void Chorus::ChorusKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -214,35 +214,12 @@ void Chorus::ChorusKernel::Process( const Float32 *inSourceP, Float64 offset; //this is a double buffer so we will be splitting it in two - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -277,11 +254,11 @@ void Chorus::ChorusKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/Chorus/Chorus.h b/plugins/MacSignedAU/Chorus/Chorus.h index ff1fdf2b1..07762c345 100755 --- a/plugins/MacSignedAU/Chorus/Chorus.h +++ b/plugins/MacSignedAU/Chorus/Chorus.h @@ -139,7 +139,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.cpp b/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.cpp index a9a015e61..540f7f22f 100755 --- a/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.cpp +++ b/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.cpp @@ -181,7 +181,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -214,7 +214,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, Float64 offset; Float64 start[4]; - long double inputSample; + double inputSample; Float64 drySample; //now we'll precalculate some stuff that needn't be in every sample start[0] = range; @@ -224,30 +224,7 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -307,11 +284,11 @@ void ChorusEnsemble::ChorusEnsembleKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.h b/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.h index 7012d5866..3e2117519 100755 --- a/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.h +++ b/plugins/MacSignedAU/ChorusEnsemble/ChorusEnsemble.h @@ -139,7 +139,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/ChromeOxide/ChromeOxide.cpp b/plugins/MacSignedAU/ChromeOxide/ChromeOxide.cpp index e2d262af7..51902cd1e 100755 --- a/plugins/MacSignedAU/ChromeOxide/ChromeOxide.cpp +++ b/plugins/MacSignedAU/ChromeOxide/ChromeOxide.cpp @@ -220,8 +220,8 @@ void ChromeOxide::ChromeOxideKernel::Process( const Float32 *inSourceP, //everything runs off Intensity now while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; bassSample = inputSample; diff --git a/plugins/MacSignedAU/Cider/Cider.cpp b/plugins/MacSignedAU/Cider/Cider.cpp index 076895309..26a2f40dd 100755 --- a/plugins/MacSignedAU/Cider/Cider.cpp +++ b/plugins/MacSignedAU/Cider/Cider.cpp @@ -222,8 +222,8 @@ void Cider::CiderKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacSignedAU/ClipOnly2/ClipOnly2.cpp b/plugins/MacSignedAU/ClipOnly2/ClipOnly2.cpp index 91199db74..f7a5246b9 100644 --- a/plugins/MacSignedAU/ClipOnly2/ClipOnly2.cpp +++ b/plugins/MacSignedAU/ClipOnly2/ClipOnly2.cpp @@ -169,7 +169,7 @@ void ClipOnly2::ClipOnly2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); diff --git a/plugins/MacSignedAU/Coils/Coils.cpp b/plugins/MacSignedAU/Coils/Coils.cpp index d6f508902..88a1d8450 100755 --- a/plugins/MacSignedAU/Coils/Coils.cpp +++ b/plugins/MacSignedAU/Coils/Coils.cpp @@ -210,11 +210,11 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP, figure[6] = (1.0 - K / figure[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -225,7 +225,7 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP, //the full frequencies but distorts like a real transformer. Purest case, and since //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSample * figure[2]) + figure[7]; + double tempSample = (inputSample * figure[2]) + figure[7]; figure[7] = -(tempSample * figure[5]) + figure[8]; figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/MacSignedAU/Coils/Coils.h b/plugins/MacSignedAU/Coils/Coils.h index 733aabc4b..9d8c46a00 100755 --- a/plugins/MacSignedAU/Coils/Coils.h +++ b/plugins/MacSignedAU/Coils/Coils.h @@ -131,7 +131,7 @@ public: virtual void Reset(); private: - long double figure[9]; + double figure[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Coils2/Coils2.cpp b/plugins/MacSignedAU/Coils2/Coils2.cpp index 5f4ac4bbe..7de0270d7 100644 --- a/plugins/MacSignedAU/Coils2/Coils2.cpp +++ b/plugins/MacSignedAU/Coils2/Coils2.cpp @@ -191,7 +191,7 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -199,7 +199,7 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/GetSampleRate(); biquadA[1] = 0.01+(pow(GetParameter( kParam_Two ),2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -218,19 +218,19 @@ void Coils2::Coils2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); inputSample = tempSample; //create bandpass of clean tone } - long double diffSample = (drySample-inputSample)/distScaling; //mids notched out + double diffSample = (drySample-inputSample)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSample * biquadB[2]) + biquadB[7]; + double tempSample = (diffSample * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSample * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSample * biquadB[4]) - (tempSample * biquadB[6]); diffSample = tempSample; //lowpass filter the notch content before distorting diff --git a/plugins/MacSignedAU/Coils2/Coils2.h b/plugins/MacSignedAU/Coils2/Coils2.h index 769fc0d7d..c7088c199 100644 --- a/plugins/MacSignedAU/Coils2/Coils2.h +++ b/plugins/MacSignedAU/Coils2/Coils2.h @@ -129,9 +129,9 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double hysteresis; + double biquadA[9]; + double biquadB[9]; + double hysteresis; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Cojones/Cojones.cpp b/plugins/MacSignedAU/Cojones/Cojones.cpp index ad34f7c42..a7bf389d1 100755 --- a/plugins/MacSignedAU/Cojones/Cojones.cpp +++ b/plugins/MacSignedAU/Cojones/Cojones.cpp @@ -192,7 +192,7 @@ void Cojones::CojonesKernel::Reset() { stored[0] = stored[1] = 0.0; diff[0] = diff[1] = diff[2] = diff[3] = diff[4] = diff[5] = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -216,28 +216,10 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, Float64 average[5]; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; stored[1] = stored[0]; stored[0] = inputSample; @@ -260,17 +242,17 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, average[3] /= 5.0; average[4] /= 6.0; - long double meanA = diff[0]; - long double meanB = diff[0]; + double meanA = diff[0]; + double meanB = diff[0]; if (fabs(average[4]) < fabs(meanB)) {meanA = meanB; meanB = average[4];} if (fabs(average[3]) < fabs(meanB)) {meanA = meanB; meanB = average[3];} if (fabs(average[2]) < fabs(meanB)) {meanA = meanB; meanB = average[2];} if (fabs(average[1]) < fabs(meanB)) {meanA = meanB; meanB = average[1];} if (fabs(average[0]) < fabs(meanB)) {meanA = meanB; meanB = average[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); stored[0] = (stored[1] + meanOut); - long double outputSample = stored[0]*body; + double outputSample = stored[0]*body; //presubtract cojones outputSample += (((inputSample - stored[0])-average[1])*cojones); @@ -286,11 +268,11 @@ void Cojones::CojonesKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * (1.0-wet)); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Cojones/Cojones.h b/plugins/MacSignedAU/Cojones/Cojones.h index fba3b00c2..6424da7fa 100755 --- a/plugins/MacSignedAU/Cojones/Cojones.h +++ b/plugins/MacSignedAU/Cojones/Cojones.h @@ -137,9 +137,9 @@ public: virtual void Reset(); private: - long double stored[2]; - long double diff[6]; - long double fpNShape; + double stored[2]; + double diff[6]; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Compresaturator/Compresaturator.cpp b/plugins/MacSignedAU/Compresaturator/Compresaturator.cpp index 0787610ef..771ac1460 100755 --- a/plugins/MacSignedAU/Compresaturator/Compresaturator.cpp +++ b/plugins/MacSignedAU/Compresaturator/Compresaturator.cpp @@ -221,29 +221,11 @@ void Compresaturator::CompresaturatorKernel::Process( const Float32 *inSourceP Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - long double temp = inputSample; + double inputSample = *sourceP; + double temp = inputSample; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (dCount < 1 || dCount > 5000) {dCount = 5000;} @@ -258,7 +240,7 @@ void Compresaturator::CompresaturatorKernel::Process( const Float32 *inSourceP } } - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); Float64 overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/MacSignedAU/Console4Buss/Console4Buss.cpp b/plugins/MacSignedAU/Console4Buss/Console4Buss.cpp index 6b8c481cc..f96285d7d 100755 --- a/plugins/MacSignedAU/Console4Buss/Console4Buss.cpp +++ b/plugins/MacSignedAU/Console4Buss/Console4Buss.cpp @@ -162,7 +162,7 @@ void Console4Buss::Console4BussKernel::Reset() gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -184,9 +184,9 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, overallscale /= 44100.0; // 1 for CD rate, more if it's a high sample rate - long double inputSample; - long double half; - long double falf; + double inputSample; + double half; + double falf; Float64 slewcompensation; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { @@ -200,30 +200,7 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; //if we're going to do a gain, we must apply it to everything here - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; @@ -258,11 +235,11 @@ void Console4Buss::Console4BussKernel::Process( const Float32 *inSourceP, //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Console4Buss/Console4Buss.h b/plugins/MacSignedAU/Console4Buss/Console4Buss.h index dc7e15fbe..9001f3adb 100755 --- a/plugins/MacSignedAU/Console4Buss/Console4Buss.h +++ b/plugins/MacSignedAU/Console4Buss/Console4Buss.h @@ -131,7 +131,7 @@ public: Float64 gainchase; Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console4Channel/Console4Channel.cpp b/plugins/MacSignedAU/Console4Channel/Console4Channel.cpp index f3a33fc5b..1c0954779 100755 --- a/plugins/MacSignedAU/Console4Channel/Console4Channel.cpp +++ b/plugins/MacSignedAU/Console4Channel/Console4Channel.cpp @@ -161,7 +161,7 @@ void Console4Channel::Console4ChannelKernel::Reset() gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,9 +176,9 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; - long double half; - long double falf; + double inputSample; + double half; + double falf; Float64 inputgain = GetParameter( kParam_One ); if (settingchase != inputgain) { chasespeed *= 2.0; @@ -190,30 +190,7 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; //if we're going to do a gain, we must apply it to everything here @@ -237,11 +214,11 @@ void Console4Channel::Console4ChannelKernel::Process( const Float32 *inSourceP //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //force 80 bit into 32 bit output diff --git a/plugins/MacSignedAU/Console4Channel/Console4Channel.h b/plugins/MacSignedAU/Console4Channel/Console4Channel.h index 665d892c1..12023fc07 100755 --- a/plugins/MacSignedAU/Console4Channel/Console4Channel.h +++ b/plugins/MacSignedAU/Console4Channel/Console4Channel.h @@ -129,7 +129,7 @@ public: Float64 gainchase; Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console5Buss/Console5Buss.cpp b/plugins/MacSignedAU/Console5Buss/Console5Buss.cpp index f4ed5f34f..1ed4ec04e 100755 --- a/plugins/MacSignedAU/Console5Buss/Console5Buss.cpp +++ b/plugins/MacSignedAU/Console5Buss/Console5Buss.cpp @@ -165,7 +165,7 @@ void Console5Buss::Console5BussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -189,7 +189,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -273,11 +250,11 @@ void Console5Buss::Console5BussKernel::Process( const Float32 *inSourceP, lastFXBuss *= (1.0 - (nearZero * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Console5Buss/Console5Buss.h b/plugins/MacSignedAU/Console5Buss/Console5Buss.h index c7f16380c..205b48254 100755 --- a/plugins/MacSignedAU/Console5Buss/Console5Buss.h +++ b/plugins/MacSignedAU/Console5Buss/Console5Buss.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console5Channel/Console5Channel.cpp b/plugins/MacSignedAU/Console5Channel/Console5Channel.cpp index 6ac0c1649..0ff78f7f6 100755 --- a/plugins/MacSignedAU/Console5Channel/Console5Channel.cpp +++ b/plugins/MacSignedAU/Console5Channel/Console5Channel.cpp @@ -165,7 +165,7 @@ void Console5Channel::Console5ChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -189,7 +189,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -274,11 +251,11 @@ void Console5Channel::Console5ChannelKernel::Process( const Float32 *inSourceP inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Console5Channel/Console5Channel.h b/plugins/MacSignedAU/Console5Channel/Console5Channel.h index 3b4104ef6..ae782b070 100755 --- a/plugins/MacSignedAU/Console5Channel/Console5Channel.h +++ b/plugins/MacSignedAU/Console5Channel/Console5Channel.h @@ -131,7 +131,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.cpp b/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.cpp index bbf28adb8..d9bf6ffe2 100755 --- a/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.cpp +++ b/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.cpp @@ -165,7 +165,7 @@ void Console5DarkCh::Console5DarkChKernel::Reset() settingchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 inputgain = GetParameter( kParam_One ); @@ -188,7 +188,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, Float64 nearZero; Float64 servoTrim = 0.0000001 / overallscale; Float64 bassTrim = 0.005 / overallscale; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,30 +200,7 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -273,11 +250,11 @@ void Console5DarkCh::Console5DarkChKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.h b/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.h index 157ad9b80..2148c8784 100755 --- a/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.h +++ b/plugins/MacSignedAU/Console5DarkCh/Console5DarkCh.h @@ -131,7 +131,7 @@ public: Float64 settingchase; Float64 chasespeed; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console6Buss/Console6Buss.cpp b/plugins/MacSignedAU/Console6Buss/Console6Buss.cpp index ec0006318..36ac21257 100755 --- a/plugins/MacSignedAU/Console6Buss/Console6Buss.cpp +++ b/plugins/MacSignedAU/Console6Buss/Console6Buss.cpp @@ -176,8 +176,8 @@ void Console6Buss::Console6BussKernel::Process( const Float32 *inSourceP, Float64 gain = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gain != 1.0) { inputSample *= gain; diff --git a/plugins/MacSignedAU/Console6Channel/Console6Channel.cpp b/plugins/MacSignedAU/Console6Channel/Console6Channel.cpp index 05a207462..8860bb600 100755 --- a/plugins/MacSignedAU/Console6Channel/Console6Channel.cpp +++ b/plugins/MacSignedAU/Console6Channel/Console6Channel.cpp @@ -176,8 +176,8 @@ void Console6Channel::Console6ChannelKernel::Process( const Float32 *inSourceP Float64 gain = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gain != 1.0) { inputSample *= gain; diff --git a/plugins/MacSignedAU/Console7Buss/Console7Buss.cpp b/plugins/MacSignedAU/Console7Buss/Console7Buss.cpp index 428bade6b..2b5a416ff 100755 --- a/plugins/MacSignedAU/Console7Buss/Console7Buss.cpp +++ b/plugins/MacSignedAU/Console7Buss/Console7Buss.cpp @@ -176,7 +176,7 @@ void Console7Buss::Console7BussKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = GetParameter( kParam_One ) * 1.03; + double inputgain = GetParameter( kParam_One ) * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > inFramesToProcess) chasespeed = inFramesToProcess; @@ -203,10 +203,10 @@ void Console7Buss::Console7BussKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Console7Buss/Console7Buss.h b/plugins/MacSignedAU/Console7Buss/Console7Buss.h index 9d50dfb97..56289c529 100755 --- a/plugins/MacSignedAU/Console7Buss/Console7Buss.h +++ b/plugins/MacSignedAU/Console7Buss/Console7Buss.h @@ -127,8 +127,8 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console7Cascade/Console7Cascade.cpp b/plugins/MacSignedAU/Console7Cascade/Console7Cascade.cpp index d322ecc22..1af1cf6a7 100755 --- a/plugins/MacSignedAU/Console7Cascade/Console7Cascade.cpp +++ b/plugins/MacSignedAU/Console7Cascade/Console7Cascade.cpp @@ -177,7 +177,7 @@ void Console7Cascade::Console7CascadeKernel::Process( const Float32 *inSourceP const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); + double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) //Neutral gain through the whole system with a full scale sine ia 0.772 on the gain knob @@ -233,10 +233,10 @@ void Console7Cascade::Console7CascadeKernel::Process( const Float32 *inSourceP biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Console7Cascade/Console7Cascade.h b/plugins/MacSignedAU/Console7Cascade/Console7Cascade.h index dd3683c12..8376a30f3 100755 --- a/plugins/MacSignedAU/Console7Cascade/Console7Cascade.h +++ b/plugins/MacSignedAU/Console7Cascade/Console7Cascade.h @@ -127,11 +127,11 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console7Channel/Console7Channel.cpp b/plugins/MacSignedAU/Console7Channel/Console7Channel.cpp index 7609f38e9..3f3f6877a 100755 --- a/plugins/MacSignedAU/Console7Channel/Console7Channel.cpp +++ b/plugins/MacSignedAU/Console7Channel/Console7Channel.cpp @@ -176,7 +176,7 @@ void Console7Channel::Console7ChannelKernel::Process( const Float32 *inSourceP UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = GetParameter( kParam_One )*1.272019649514069; + double inputgain = GetParameter( kParam_One )*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -197,10 +197,10 @@ void Console7Channel::Console7ChannelKernel::Process( const Float32 *inSourceP biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Console7Channel/Console7Channel.h b/plugins/MacSignedAU/Console7Channel/Console7Channel.h index 24ed7ba5b..8366db4f1 100755 --- a/plugins/MacSignedAU/Console7Channel/Console7Channel.h +++ b/plugins/MacSignedAU/Console7Channel/Console7Channel.h @@ -127,7 +127,7 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Console7Crunch/Console7Crunch.cpp b/plugins/MacSignedAU/Console7Crunch/Console7Crunch.cpp index a002f6dee..b00cf2123 100644 --- a/plugins/MacSignedAU/Console7Crunch/Console7Crunch.cpp +++ b/plugins/MacSignedAU/Console7Crunch/Console7Crunch.cpp @@ -177,7 +177,7 @@ void Console7Crunch::Console7CrunchKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); + double inputgain = 1.0-(pow(1.0-GetParameter( kParam_One ),2)); //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) //Neutral gain through the whole system with a full scale sine ia 0.772 on the gain knob @@ -233,10 +233,10 @@ void Console7Crunch::Console7CrunchKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Console7Crunch/Console7Crunch.h b/plugins/MacSignedAU/Console7Crunch/Console7Crunch.h index 82e2921b3..e3f0fc6da 100644 --- a/plugins/MacSignedAU/Console7Crunch/Console7Crunch.h +++ b/plugins/MacSignedAU/Console7Crunch/Console7Crunch.h @@ -127,11 +127,11 @@ public: private: Float64 gainchase; Float64 chasespeed; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp b/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp index c0b592c0a..e97c1281d 100755 --- a/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp +++ b/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.cpp @@ -177,7 +177,7 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Reset() bMidPrev = 0.0; cMidPrev = 0.0; dMidPrev = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,36 +269,13 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou Float64 dDry = 1.0 - dWet; Float64 drySample; - long double inputSample; + double inputSample; Float64 accumulatorSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (aWet > 0.0) { @@ -444,11 +421,11 @@ void CrunchyGrooveWear::CrunchyGrooveWearKernel::Process( const Float32 *inSou inputSample = (inputSample * dWet) + (drySample * dDry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.h b/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.h index 07db5c78a..2bb17c358 100755 --- a/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.h +++ b/plugins/MacSignedAU/CrunchyGrooveWear/CrunchyGrooveWear.h @@ -138,7 +138,7 @@ public: Float64 cMidPrev; Float64 dMidPrev; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Crystal/Crystal.cpp b/plugins/MacSignedAU/Crystal/Crystal.cpp index d5c881815..13609dbe4 100755 --- a/plugins/MacSignedAU/Crystal/Crystal.cpp +++ b/plugins/MacSignedAU/Crystal/Crystal.cpp @@ -184,7 +184,7 @@ void Crystal::CrystalKernel::Reset() { for(int count = 0; count < 34; count++) {b[count] = 0;} lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -222,27 +222,9 @@ void Crystal::CrystalKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction @@ -302,11 +284,11 @@ void Crystal::CrystalKernel::Process( const Float32 *inSourceP, //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Crystal/Crystal.h b/plugins/MacSignedAU/Crystal/Crystal.h index e2046ab7f..201f0d31f 100755 --- a/plugins/MacSignedAU/Crystal/Crystal.h +++ b/plugins/MacSignedAU/Crystal/Crystal.h @@ -137,7 +137,7 @@ public: private: Float64 b[35]; Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Dark/Dark.cpp b/plugins/MacSignedAU/Dark/Dark.cpp index 54da64307..4829168ca 100755 --- a/plugins/MacSignedAU/Dark/Dark.cpp +++ b/plugins/MacSignedAU/Dark/Dark.cpp @@ -197,7 +197,7 @@ void Dark::DarkKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int depth = (int)(17.0*overallscale); @@ -217,7 +217,7 @@ void Dark::DarkKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float32 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacSignedAU/DarkNoise/DarkNoise.cpp b/plugins/MacSignedAU/DarkNoise/DarkNoise.cpp index 4a5b10dcf..6bea60093 100755 --- a/plugins/MacSignedAU/DarkNoise/DarkNoise.cpp +++ b/plugins/MacSignedAU/DarkNoise/DarkNoise.cpp @@ -243,8 +243,8 @@ void DarkNoise::DarkNoiseKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (freqTarget < freq) { @@ -269,7 +269,7 @@ void DarkNoise::DarkNoiseKernel::Process( const Float32 *inSourceP, Float64 nondarkSample = inputSample; - long double previousPole = 0; + double previousPole = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) b[x+1][y] = b[x][y]; b[0][y] = previousPole = inputSample; diff --git a/plugins/MacSignedAU/DeBess/DeBess.cpp b/plugins/MacSignedAU/DeBess/DeBess.cpp index 781264d9f..5355576d5 100755 --- a/plugins/MacSignedAU/DeBess/DeBess.cpp +++ b/plugins/MacSignedAU/DeBess/DeBess.cpp @@ -210,7 +210,7 @@ void DeBess::DeBessKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -223,7 +223,7 @@ void DeBess::DeBessKernel::Process( const Float32 *inSourceP, int monitoring = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; s[0] = inputSample; //set up so both [0] and [1] will be input sample diff --git a/plugins/MacSignedAU/DeBess/DeBess.h b/plugins/MacSignedAU/DeBess/DeBess.h index e9dd418e6..feeba336d 100755 --- a/plugins/MacSignedAU/DeBess/DeBess.h +++ b/plugins/MacSignedAU/DeBess/DeBess.h @@ -137,7 +137,7 @@ public: virtual void Reset(); private: - long double s[41], m[41], c[41]; + double s[41], m[41], c[41]; Float64 ratioA; Float64 ratioB; Float64 iirSampleA; diff --git a/plugins/MacSignedAU/DeEss/DeEss.cpp b/plugins/MacSignedAU/DeEss/DeEss.cpp index 0e14f19a2..0d80ff985 100755 --- a/plugins/MacSignedAU/DeEss/DeEss.cpp +++ b/plugins/MacSignedAU/DeEss/DeEss.cpp @@ -181,7 +181,7 @@ void DeEss::DeEssKernel::Reset() iirSampleA = 0.0; iirSampleB = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,32 +208,9 @@ void DeEss::DeEssKernel::Process( const Float32 *inSourceP, Float64 attackspeed; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; s3 = s2; s2 = s1; @@ -276,11 +253,11 @@ void DeEss::DeEssKernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/DeEss/DeEss.h b/plugins/MacSignedAU/DeEss/DeEss.h index e0cc7901e..72067f434 100755 --- a/plugins/MacSignedAU/DeEss/DeEss.h +++ b/plugins/MacSignedAU/DeEss/DeEss.h @@ -155,7 +155,7 @@ public: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/DeHiss/DeHiss.cpp b/plugins/MacSignedAU/DeHiss/DeHiss.cpp index 88d6a653b..57c7a9c88 100755 --- a/plugins/MacSignedAU/DeHiss/DeHiss.cpp +++ b/plugins/MacSignedAU/DeHiss/DeHiss.cpp @@ -185,7 +185,7 @@ void DeHiss::DeHissKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -198,8 +198,8 @@ void DeHiss::DeHissKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; stored[1] = stored[0]; diff --git a/plugins/MacSignedAU/DeRez/DeRez.cpp b/plugins/MacSignedAU/DeRez/DeRez.cpp index cecba5c25..62e6744de 100755 --- a/plugins/MacSignedAU/DeRez/DeRez.cpp +++ b/plugins/MacSignedAU/DeRez/DeRez.cpp @@ -171,7 +171,7 @@ void DeRez::DeRezKernel::Reset() position = 0.0; incrementA = 0.0; incrementB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -201,39 +201,16 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, targetA /= overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23 && (targetB == 0)) inputSample = fpd * 1.18e-17; + double drySample = inputSample; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; //incrementA is the frequency derez //incrementB is the bit depth derez position += incrementA; - long double outputSample = heldSample; + double outputSample = heldSample; if (position > 1.0) { position -= 1.0; @@ -242,7 +219,7 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, //softens the edge of the derez } inputSample = outputSample; - long double offset = inputSample; + double offset = inputSample; if (incrementB > 0.0005) { if (inputSample > 0) @@ -260,11 +237,11 @@ void DeRez::DeRezKernel::Process( const Float32 *inSourceP, inputSample *= (1.0 - incrementB); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; lastSample = drySample; diff --git a/plugins/MacSignedAU/DeRez/DeRez.h b/plugins/MacSignedAU/DeRez/DeRez.h index e592bcbaa..c5ba1de6c 100755 --- a/plugins/MacSignedAU/DeRez/DeRez.h +++ b/plugins/MacSignedAU/DeRez/DeRez.h @@ -133,7 +133,7 @@ public: Float64 position; Float64 incrementA; Float64 incrementB; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/DeRez2/DeRez2.cpp b/plugins/MacSignedAU/DeRez2/DeRez2.cpp index 576cd2491..7b5a1d194 100755 --- a/plugins/MacSignedAU/DeRez2/DeRez2.cpp +++ b/plugins/MacSignedAU/DeRez2/DeRez2.cpp @@ -216,9 +216,9 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, targetA /= overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -226,7 +226,7 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, //incrementA is the frequency derez //incrementB is the bit depth derez position += incrementA; - long double outputSample = heldSample; + double outputSample = heldSample; if (position > 1.0) { position -= 1.0; @@ -236,7 +236,7 @@ void DeRez2::DeRez2Kernel::Process( const Float32 *inSourceP, } inputSample = outputSample; - long double temp = inputSample; + double temp = inputSample; if (inputSample != lastOutputSample) { temp = inputSample; diff --git a/plugins/MacSignedAU/Deckwrecka/Deckwrecka.cpp b/plugins/MacSignedAU/Deckwrecka/Deckwrecka.cpp index 0e85358fe..88cad371d 100755 --- a/plugins/MacSignedAU/Deckwrecka/Deckwrecka.cpp +++ b/plugins/MacSignedAU/Deckwrecka/Deckwrecka.cpp @@ -223,7 +223,7 @@ void Deckwrecka::DeckwreckaKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; randy = (rand()/(double)RAND_MAX); randy += (rand()/(double)RAND_MAX); diff --git a/plugins/MacSignedAU/Density/Density.cpp b/plugins/MacSignedAU/Density/Density.cpp index 65e4a0a53..b62f4327c 100755 --- a/plugins/MacSignedAU/Density/Density.cpp +++ b/plugins/MacSignedAU/Density/Density.cpp @@ -184,7 +184,7 @@ void Density::DensityKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -222,30 +222,7 @@ void Density::DensityKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (fpFlip) @@ -289,11 +266,11 @@ void Density::DensityKernel::Process( const Float32 *inSourceP, //number, we really don't want to meaninglessly multiply that by 1.0. fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Density/Density.h b/plugins/MacSignedAU/Density/Density.h index 0d9af2970..918c607df 100755 --- a/plugins/MacSignedAU/Density/Density.h +++ b/plugins/MacSignedAU/Density/Density.h @@ -138,7 +138,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/Density2/Density2.cpp b/plugins/MacSignedAU/Density2/Density2.cpp index 0b4cfb18f..a511efb4c 100755 --- a/plugins/MacSignedAU/Density2/Density2.cpp +++ b/plugins/MacSignedAU/Density2/Density2.cpp @@ -199,7 +199,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 density = GetParameter( kParam_One ); @@ -211,18 +211,18 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; - long double halfwaySample = (inputSample + last1Sample + ((-last2Sample + last3Sample) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySample = halfwaySample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double halfwaySample = (inputSample + last1Sample + ((-last2Sample + last3Sample) * 0.0414213562373095048801688)) / 2.0; + double halfDrySample = halfwaySample; last3Sample = last2Sample; last2Sample = last1Sample; last1Sample = inputSample; iirSampleB = (iirSampleB * (1.0 - iirAmount)) + (halfwaySample * iirAmount); halfwaySample -= iirSampleB; //highpass section double count = density; - long double bridgerectifier; + double bridgerectifier; while (count > 1.0) { bridgerectifier = fabs(halfwaySample)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; @@ -241,7 +241,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, ataC = halfwaySample - halfDrySample; ataA *= 0.915965594177219015; ataB *= 0.915965594177219015; ataB += ataC; ataA -= ataC; ataC = ataB; - long double halfDiffSample = ataC * 0.915965594177219015; + double halfDiffSample = ataC * 0.915965594177219015; iirSampleA = (iirSampleA * (1.0 - iirAmount)) + (inputSample * iirAmount); inputSample -= iirSampleA; //highpass section @@ -264,7 +264,7 @@ void Density2::Density2Kernel::Process( const Float32 *inSourceP, ataC = inputSample - drySample; ataA *= 0.915965594177219015; ataB *= 0.915965594177219015; ataA += ataC; ataB -= ataC; ataC = ataA; - long double diffSample = ataC * 0.915965594177219015; + double diffSample = ataC * 0.915965594177219015; inputSample = drySample + ((diffSample + halfDiffSample + lastDiffSample) / 1.187); lastDiffSample = diffSample / 2.0; diff --git a/plugins/MacSignedAU/Density2/Density2.h b/plugins/MacSignedAU/Density2/Density2.h index 571245366..37da2b82b 100755 --- a/plugins/MacSignedAU/Density2/Density2.h +++ b/plugins/MacSignedAU/Density2/Density2.h @@ -135,15 +135,15 @@ public: virtual void Reset(); private: - long double last3Sample; - long double last2Sample; - long double last1Sample; - long double ataA; - long double ataB; - long double ataC; - long double lastDiffSample; - long double iirSampleA; - long double iirSampleB; + double last3Sample; + double last2Sample; + double last1Sample; + double ataA; + double ataB; + double ataC; + double lastDiffSample; + double iirSampleA; + double iirSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Desk/Desk.cpp b/plugins/MacSignedAU/Desk/Desk.cpp index 97b42e2a7..a38a4e019 100755 --- a/plugins/MacSignedAU/Desk/Desk.cpp +++ b/plugins/MacSignedAU/Desk/Desk.cpp @@ -152,7 +152,7 @@ void Desk::DeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,35 +181,12 @@ void Desk::DeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; slew = inputSample - lastSample; @@ -245,11 +222,11 @@ void Desk::DeskKernel::Process( const Float32 *inSourceP, //drive section inputSample /= gain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Desk/Desk.h b/plugins/MacSignedAU/Desk/Desk.h index 119399589..29f4bec76 100755 --- a/plugins/MacSignedAU/Desk/Desk.h +++ b/plugins/MacSignedAU/Desk/Desk.h @@ -117,10 +117,10 @@ public: virtual void Reset(); private: - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Desk4/Desk4.cpp b/plugins/MacSignedAU/Desk4/Desk4.cpp index 3e543e345..2cb734c0c 100755 --- a/plugins/MacSignedAU/Desk4/Desk4.cpp +++ b/plugins/MacSignedAU/Desk4/Desk4.cpp @@ -204,7 +204,7 @@ void Desk4::Desk4Kernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -219,7 +219,7 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,34 +248,11 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, Float64 combSample; Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -349,11 +326,11 @@ void Desk4::Desk4Kernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Desk4/Desk4.h b/plugins/MacSignedAU/Desk4/Desk4.h index 8cd019328..7d51187c6 100755 --- a/plugins/MacSignedAU/Desk4/Desk4.h +++ b/plugins/MacSignedAU/Desk4/Desk4.h @@ -146,7 +146,7 @@ public: Float64 lastSample; Float64 lastOutSample; Float64 lastSlew; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/DigitalBlack/DigitalBlack.cpp b/plugins/MacSignedAU/DigitalBlack/DigitalBlack.cpp index d6d7e26b1..f8723f205 100755 --- a/plugins/MacSignedAU/DigitalBlack/DigitalBlack.cpp +++ b/plugins/MacSignedAU/DigitalBlack/DigitalBlack.cpp @@ -184,7 +184,7 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -193,9 +193,9 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (inputSample > 0) { if (WasNegative == true) ZeroCross = 0; @@ -218,7 +218,7 @@ void DigitalBlack::DigitalBlackKernel::Process( const Float32 *inSourceP, Float64 gate = 1.0; if (gateroller < 1.0) gate = gateroller; - long double bridgerectifier = 1-cos(fabs(inputSample)); + double bridgerectifier = 1-cos(fabs(inputSample)); if (inputSample > 0) inputSample = (inputSample*gate)+(bridgerectifier*(1-gate)); else inputSample = (inputSample*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/MacSignedAU/Distance/Distance.cpp b/plugins/MacSignedAU/Distance/Distance.cpp index 5e0b26101..24cd83721 100755 --- a/plugins/MacSignedAU/Distance/Distance.cpp +++ b/plugins/MacSignedAU/Distance/Distance.cpp @@ -169,7 +169,7 @@ void Distance::DistanceKernel::Reset() { thirdresult = prevresult = lastclamp = clamp = change = last = 0.0; //just an example - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -207,30 +207,7 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -256,11 +233,11 @@ void Distance::DistanceKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Distance/Distance.h b/plugins/MacSignedAU/Distance/Distance.h index cade7a527..d1a626c7c 100755 --- a/plugins/MacSignedAU/Distance/Distance.h +++ b/plugins/MacSignedAU/Distance/Distance.h @@ -137,7 +137,7 @@ public: Float64 thirdresult; Float64 prevresult; Float64 last; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacSignedAU/Distance2/Distance2.cpp b/plugins/MacSignedAU/Distance2/Distance2.cpp index 1bd8a008f..13396d9b4 100755 --- a/plugins/MacSignedAU/Distance2/Distance2.cpp +++ b/plugins/MacSignedAU/Distance2/Distance2.cpp @@ -175,7 +175,7 @@ ComponentResult Distance2::Initialize() void Distance2::Distance2Kernel::Reset() { thirdSample = lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; lastSampleA = 0.0; lastSampleB = 0.0; lastSampleC = 0.0; @@ -246,34 +246,16 @@ void Distance2::Distance2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; double offset = offsetScale - (lastSample - inputSample); inputSample += (offset*offsetScale); //extra bit from Loud: offset air compression inputSample *= wet; //clean up w. dry introduced inputSample *= softslew; //scale into Atmosphere algorithm - long double clamp = inputSample - lastSampleA; + double clamp = inputSample - lastSampleA; if (clamp > thresholdA) inputSample = lastSampleA + thresholdA; if (-clamp > thresholdA) inputSample = lastSampleA - thresholdA; @@ -359,11 +341,11 @@ void Distance2::Distance2Kernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Distance2/Distance2.h b/plugins/MacSignedAU/Distance2/Distance2.h index 91c471091..a630e52d4 100755 --- a/plugins/MacSignedAU/Distance2/Distance2.h +++ b/plugins/MacSignedAU/Distance2/Distance2.h @@ -131,37 +131,37 @@ public: virtual void Reset(); private: - long double lastSampleA; - long double lastSampleB; - long double lastSampleC; - long double lastSampleD; - long double lastSampleE; - long double lastSampleF; - long double lastSampleG; - long double lastSampleH; - long double lastSampleI; - long double lastSampleJ; - long double lastSampleK; - long double lastSampleL; - long double lastSampleM; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double lastSampleA; + double lastSampleB; + double lastSampleC; + double lastSampleD; + double lastSampleE; + double lastSampleF; + double lastSampleG; + double lastSampleH; + double lastSampleI; + double lastSampleJ; + double lastSampleK; + double lastSampleL; + double lastSampleM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; Float64 thirdSample; Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.cpp b/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.cpp index d9c2d5e99..1bb14cf17 100755 --- a/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.cpp +++ b/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.cpp @@ -273,31 +273,31 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double contingentRnd; - long double absSample; - long double contingent; - long double overallscale = 1.0; + double contingentRnd; + double absSample; + double contingent; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double inputSample; - long double outputSample; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double inputSample; + double outputSample; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 int dtype = (int) GetParameter( kParam_One ); // +1 for Reaper bug workaround bool highRes = false; bool dithering = true; @@ -311,30 +311,7 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.h b/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.h index 1e22c4d46..8833e7316 100755 --- a/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.h +++ b/plugins/MacSignedAU/Distance2/Ditherbox/Ditherbox.h @@ -176,44 +176,44 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double contingentErr; + double byn[13]; + double noiseShaping; + double contingentErr; double currentDither; - long double NSOdd; - long double NSEven; - long double prev; - long double ns[16]; + double NSOdd; + double NSEven; + double prev; + double ns[16]; int Position; bool flip; - long double lastSample; - long double outSample; - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double iirSampleG; - long double iirSampleH; - long double iirSampleI; - long double iirSampleJ; - long double iirSampleK; - long double iirSampleL; - long double iirSampleM; - long double iirSampleN; - long double iirSampleO; - long double iirSampleP; - long double iirSampleQ; - long double iirSampleR; - long double iirSampleS; - long double iirSampleT; - long double iirSampleU; - long double iirSampleV; - long double iirSampleW; - long double iirSampleX; - long double iirSampleY; - long double iirSampleZ; + double lastSample; + double outSample; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; }; }; diff --git a/plugins/MacSignedAU/Distortion/Distortion.cpp b/plugins/MacSignedAU/Distortion/Distortion.cpp index 82f6083d2..186132840 100755 --- a/plugins/MacSignedAU/Distortion/Distortion.cpp +++ b/plugins/MacSignedAU/Distortion/Distortion.cpp @@ -224,14 +224,14 @@ void Distortion::DistortionKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSample+previousIn[x])*0.5; previousIn[x] = inputSample; inputSample = temp; @@ -258,19 +258,19 @@ void Distortion::DistortionKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSample),4); + double dyno; dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy break; } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSample+previousOut[x])*0.5; previousOut[x] = inputSample; inputSample = temp; diff --git a/plugins/MacSignedAU/Distortion/Distortion.h b/plugins/MacSignedAU/Distortion/Distortion.h index e375682c1..49dd4b003 100755 --- a/plugins/MacSignedAU/Distortion/Distortion.h +++ b/plugins/MacSignedAU/Distortion/Distortion.h @@ -145,8 +145,8 @@ public: virtual void Reset(); private: - long double previousIn[9]; - long double previousOut[9]; + double previousIn[9]; + double previousOut[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/DitherFloat/DitherFloat.cpp b/plugins/MacSignedAU/DitherFloat/DitherFloat.cpp index 39e4b2e01..d066baa87 100755 --- a/plugins/MacSignedAU/DitherFloat/DitherFloat.cpp +++ b/plugins/MacSignedAU/DitherFloat/DitherFloat.cpp @@ -180,14 +180,14 @@ void DitherFloat::DitherFloatKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int floatOffset = GetParameter( kParam_One ); - long double blend = GetParameter( kParam_Two ); + double blend = GetParameter( kParam_Two ); - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -229,7 +229,7 @@ void DitherFloat::DitherFloatKernel::Process( const Float32 *inSourceP, //gain *= gain; //for testing with double precision, 64 bit while (nSampleFrames-- > 0) { - long double inputSample = *sourceP + (gain-1); //this offsets the float into total truncation-land. + double inputSample = *sourceP + (gain-1); //this offsets the float into total truncation-land. diff --git a/plugins/MacSignedAU/DitherMeDiskers/DitherMeDiskers.h b/plugins/MacSignedAU/DitherMeDiskers/DitherMeDiskers.h index 3e835e5cb..61b1d97ab 100755 --- a/plugins/MacSignedAU/DitherMeDiskers/DitherMeDiskers.h +++ b/plugins/MacSignedAU/DitherMeDiskers/DitherMeDiskers.h @@ -116,7 +116,7 @@ public: virtual void Reset(); private: - long double noiseShaping; + double noiseShaping; Float64 lastSample; Float64 lastSample2; }; diff --git a/plugins/MacSignedAU/DitherMeTimbers/DitherMeTimbers.h b/plugins/MacSignedAU/DitherMeTimbers/DitherMeTimbers.h index abc959dc0..d14202f49 100755 --- a/plugins/MacSignedAU/DitherMeTimbers/DitherMeTimbers.h +++ b/plugins/MacSignedAU/DitherMeTimbers/DitherMeTimbers.h @@ -118,9 +118,9 @@ public: virtual void Reset(); private: - long double noiseShaping; - long double lastSample; - long double lastSample2; + double noiseShaping; + double lastSample; + double lastSample2; }; }; diff --git a/plugins/MacSignedAU/Ditherbox/Ditherbox.cpp b/plugins/MacSignedAU/Ditherbox/Ditherbox.cpp index d9c2d5e99..1bb14cf17 100755 --- a/plugins/MacSignedAU/Ditherbox/Ditherbox.cpp +++ b/plugins/MacSignedAU/Ditherbox/Ditherbox.cpp @@ -273,31 +273,31 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double contingentRnd; - long double absSample; - long double contingent; - long double overallscale = 1.0; + double contingentRnd; + double absSample; + double contingent; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double inputSample; - long double outputSample; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double inputSample; + double outputSample; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 int dtype = (int) GetParameter( kParam_One ); // +1 for Reaper bug workaround bool highRes = false; bool dithering = true; @@ -311,30 +311,7 @@ void Ditherbox::DitherboxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Ditherbox/Ditherbox.h b/plugins/MacSignedAU/Ditherbox/Ditherbox.h index 1e22c4d46..8833e7316 100755 --- a/plugins/MacSignedAU/Ditherbox/Ditherbox.h +++ b/plugins/MacSignedAU/Ditherbox/Ditherbox.h @@ -176,44 +176,44 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double contingentErr; + double byn[13]; + double noiseShaping; + double contingentErr; double currentDither; - long double NSOdd; - long double NSEven; - long double prev; - long double ns[16]; + double NSOdd; + double NSEven; + double prev; + double ns[16]; int Position; bool flip; - long double lastSample; - long double outSample; - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double iirSampleG; - long double iirSampleH; - long double iirSampleI; - long double iirSampleJ; - long double iirSampleK; - long double iirSampleL; - long double iirSampleM; - long double iirSampleN; - long double iirSampleO; - long double iirSampleP; - long double iirSampleQ; - long double iirSampleR; - long double iirSampleS; - long double iirSampleT; - long double iirSampleU; - long double iirSampleV; - long double iirSampleW; - long double iirSampleX; - long double iirSampleY; - long double iirSampleZ; + double lastSample; + double outSample; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; }; }; diff --git a/plugins/MacSignedAU/DoublePaul/DoublePaul.cpp b/plugins/MacSignedAU/DoublePaul/DoublePaul.cpp index a04bec364..9f5361729 100755 --- a/plugins/MacSignedAU/DoublePaul/DoublePaul.cpp +++ b/plugins/MacSignedAU/DoublePaul/DoublePaul.cpp @@ -170,30 +170,7 @@ void DoublePaul::DoublePaulKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacSignedAU/Drive/Drive.cpp b/plugins/MacSignedAU/Drive/Drive.cpp index cf16ecfe3..f452b38a1 100755 --- a/plugins/MacSignedAU/Drive/Drive.cpp +++ b/plugins/MacSignedAU/Drive/Drive.cpp @@ -184,7 +184,7 @@ void Drive::DriveKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -221,30 +221,7 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (fpFlip) @@ -279,11 +256,11 @@ void Drive::DriveKernel::Process( const Float32 *inSourceP, //number, we really don't want to meaninglessly multiply that by 1.0. fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Drive/Drive.h b/plugins/MacSignedAU/Drive/Drive.h index 0e4af2a81..3dda14bde 100755 --- a/plugins/MacSignedAU/Drive/Drive.h +++ b/plugins/MacSignedAU/Drive/Drive.h @@ -139,7 +139,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/DrumSlam/DrumSlam.cpp b/plugins/MacSignedAU/DrumSlam/DrumSlam.cpp index 0c23dc979..445d20f4b 100755 --- a/plugins/MacSignedAU/DrumSlam/DrumSlam.cpp +++ b/plugins/MacSignedAU/DrumSlam/DrumSlam.cpp @@ -183,7 +183,7 @@ void DrumSlam::DrumSlamKernel::Reset() iirSampleG = 0.0; iirSampleH = 0.0; lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -217,35 +217,12 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySample = inputSample; - long double lowSample; - long double midSample; - long double highSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double lowSample; + double midSample; + double highSample; inputSample *= drive; if (fpFlip) @@ -280,10 +257,10 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, highSample *= drive; midSample = midSample * drive; - long double skew = (midSample - lastSample); + double skew = (midSample - lastSample); lastSample = midSample; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -319,11 +296,11 @@ void DrumSlam::DrumSlamKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/DrumSlam/DrumSlam.h b/plugins/MacSignedAU/DrumSlam/DrumSlam.h index 99d305805..70b9ce804 100755 --- a/plugins/MacSignedAU/DrumSlam/DrumSlam.h +++ b/plugins/MacSignedAU/DrumSlam/DrumSlam.h @@ -140,7 +140,7 @@ public: Float64 iirSampleG; Float64 iirSampleH; Float64 lastSample; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/DubCenter/DubCenter.cpp b/plugins/MacSignedAU/DubCenter/DubCenter.cpp index c5a0a614a..4b9f74db5 100755 --- a/plugins/MacSignedAU/DubCenter/DubCenter.cpp +++ b/plugins/MacSignedAU/DubCenter/DubCenter.cpp @@ -302,8 +302,8 @@ ComponentResult DubCenter::Reset(AudioUnitScope inScope, AudioUnitElement inEle oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -320,7 +320,7 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 driveone = pow(GetParameter( kParam_One )*3.0,2); @@ -352,8 +352,8 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float64 tempSample; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -390,8 +390,8 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -610,7 +610,7 @@ OSStatus DubCenter::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/DubCenter/DubCenter.h b/plugins/MacSignedAU/DubCenter/DubCenter.h index 325a486c5..2fdc597f6 100755 --- a/plugins/MacSignedAU/DubCenter/DubCenter.h +++ b/plugins/MacSignedAU/DubCenter/DubCenter.h @@ -192,8 +192,8 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/DubSub/DubSub.cpp b/plugins/MacSignedAU/DubSub/DubSub.cpp index 4c4698954..bff1f87c8 100755 --- a/plugins/MacSignedAU/DubSub/DubSub.cpp +++ b/plugins/MacSignedAU/DubSub/DubSub.cpp @@ -281,7 +281,7 @@ void DubSub::DubSubKernel::Reset() oscGate = 1.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -326,28 +326,10 @@ void DubSub::DubSubKernel::Process( const Float32 *inSourceP, Float64 tempSample; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; // here's the plan. // Grind Boost @@ -523,11 +505,11 @@ void DubSub::DubSubKernel::Process( const Float32 *inSourceP, bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/DubSub/DubSub.h b/plugins/MacSignedAU/DubSub/DubSub.h index 43a046450..6cdbcc2f5 100755 --- a/plugins/MacSignedAU/DubSub/DubSub.h +++ b/plugins/MacSignedAU/DubSub/DubSub.h @@ -202,7 +202,7 @@ public: Float64 iirSampleZ; Float64 oscGate; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/DustBunny/DustBunny.cpp b/plugins/MacSignedAU/DustBunny/DustBunny.cpp index a363aecf2..f4f26ef61 100755 --- a/plugins/MacSignedAU/DustBunny/DustBunny.cpp +++ b/plugins/MacSignedAU/DustBunny/DustBunny.cpp @@ -164,7 +164,7 @@ void DustBunny::DustBunnyKernel::Reset() ataUpsampleHighTweak = 0.0414213562373095048801688; //more adds treble to upsampling ataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity ataFlip = false; //end reset of antialias parameters - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -186,30 +186,7 @@ void DustBunny::DustBunnyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample; @@ -242,11 +219,11 @@ void DustBunny::DustBunnyKernel::Process( const Float32 *inSourceP, ataPrevDiffSample = ataDiffSample / 2.0; //apply processing as difference to non-oversampled raw input - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacSignedAU/DustBunny/DustBunny.h b/plugins/MacSignedAU/DustBunny/DustBunny.h index ce73aa5bf..25658bcb3 100755 --- a/plugins/MacSignedAU/DustBunny/DustBunny.h +++ b/plugins/MacSignedAU/DustBunny/DustBunny.h @@ -140,7 +140,7 @@ public: Float32 ataDiffSample; Float32 ataPrevDiffSample; bool ataFlip; //end defining of antialiasing variables - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Dyno/Dyno.cpp b/plugins/MacSignedAU/Dyno/Dyno.cpp index 2a1e7bee5..fcd4b14ad 100755 --- a/plugins/MacSignedAU/Dyno/Dyno.cpp +++ b/plugins/MacSignedAU/Dyno/Dyno.cpp @@ -176,15 +176,15 @@ void Dyno::DynoKernel::Process( const Float32 *inSourceP, Float64 gain = pow(10.0,GetParameter( kParam_One )/20.0); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - //long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + //double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double dyno = pow(fabs(inputSample),4); + double dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy diff --git a/plugins/MacSignedAU/EQ/EQ.cpp b/plugins/MacSignedAU/EQ/EQ.cpp index f3f8b20d1..ff12a7646 100755 --- a/plugins/MacSignedAU/EQ/EQ.cpp +++ b/plugins/MacSignedAU/EQ/EQ.cpp @@ -222,7 +222,7 @@ ComponentResult EQ::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void EQ::EQKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; iirHighSampleA = 0.0; iirHighSampleB = 0.0; @@ -321,30 +321,7 @@ void EQ::EQKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; last2Sample = lastSample; lastSample = inputSample; @@ -516,11 +493,11 @@ void EQ::EQKernel::Process( const Float32 *inSourceP, //built in output trim and dry/wet if desired if (outputgain != 1.0) inputSample *= outputgain; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/EQ/EQ.h b/plugins/MacSignedAU/EQ/EQ.h index a3b0194e2..5b9043fd0 100755 --- a/plugins/MacSignedAU/EQ/EQ.h +++ b/plugins/MacSignedAU/EQ/EQ.h @@ -197,7 +197,7 @@ public: Float64 lastSample; Float64 last2Sample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/EdIsDim/EdIsDim.cpp b/plugins/MacSignedAU/EdIsDim/EdIsDim.cpp index 0f18618c0..ed5808af4 100755 --- a/plugins/MacSignedAU/EdIsDim/EdIsDim.cpp +++ b/plugins/MacSignedAU/EdIsDim/EdIsDim.cpp @@ -171,8 +171,8 @@ ComponentResult EdIsDim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult EdIsDim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -192,10 +192,10 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 midgain = GetParameter( kParam_One ) * 2.0; Float64 sidegain = 2.0 - midgain; @@ -204,44 +204,8 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -251,7 +215,7 @@ OSStatus EdIsDim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/EdIsDim/EdIsDim.h b/plugins/MacSignedAU/EdIsDim/EdIsDim.h index e5d5e46bf..4eb106785 100755 --- a/plugins/MacSignedAU/EdIsDim/EdIsDim.h +++ b/plugins/MacSignedAU/EdIsDim/EdIsDim.h @@ -111,8 +111,8 @@ public: virtual ComponentResult Version() { return kEdIsDimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacSignedAU/Elation/Elation.cpp b/plugins/MacSignedAU/Elation/Elation.cpp index 0f0ce2290..b74124bdb 100755 --- a/plugins/MacSignedAU/Elation/Elation.cpp +++ b/plugins/MacSignedAU/Elation/Elation.cpp @@ -221,8 +221,8 @@ void Elation::ElationKernel::Process( const Float32 *inSourceP, Float64 outputSample; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample *= indrive; diff --git a/plugins/MacSignedAU/ElectroHat/ElectroHat.cpp b/plugins/MacSignedAU/ElectroHat/ElectroHat.cpp index 620c05642..d6ed31aee 100755 --- a/plugins/MacSignedAU/ElectroHat/ElectroHat.cpp +++ b/plugins/MacSignedAU/ElectroHat/ElectroHat.cpp @@ -214,7 +214,7 @@ void ElectroHat::ElectroHatKernel::Reset() tik = 3746926; lok = 0; flip = true; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -229,7 +229,7 @@ void ElectroHat::ElectroHatKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); bool highSample = false; @@ -312,11 +312,11 @@ void ElectroHat::ElectroHatKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //moving average combats that near-Nyquist stuff diff --git a/plugins/MacSignedAU/Energy/Energy.cpp b/plugins/MacSignedAU/Energy/Energy.cpp index f14a6b400..b44293437 100755 --- a/plugins/MacSignedAU/Energy/Energy.cpp +++ b/plugins/MacSignedAU/Energy/Energy.cpp @@ -299,7 +299,7 @@ void Energy::EnergyKernel::Reset() PrevB = 0.0; PrevA = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -326,29 +326,11 @@ void Energy::EnergyKernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double correction = 0.0; + double correction = 0.0; duoFactor = PrevA - inputSample; if (flip) @@ -733,11 +715,11 @@ void Energy::EnergyKernel::Process( const Float32 *inSourceP, //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Energy/Energy.h b/plugins/MacSignedAU/Energy/Energy.h index 62648f236..7eeaf7691 100755 --- a/plugins/MacSignedAU/Energy/Energy.h +++ b/plugins/MacSignedAU/Energy/Energy.h @@ -225,7 +225,7 @@ public: Float64 PrevB; Float64 PrevA; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Energy2/Energy2.cpp b/plugins/MacSignedAU/Energy2/Energy2.cpp index 353f50af0..17ca07a37 100644 --- a/plugins/MacSignedAU/Energy2/Energy2.cpp +++ b/plugins/MacSignedAU/Energy2/Energy2.cpp @@ -279,7 +279,7 @@ void Energy2::Energy2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -301,13 +301,13 @@ void Energy2::Energy2Kernel::Process( const Float32 *inSourceP, //all types of air band are running in parallel, not series while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correction = 0.0; + double correction = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactor = PrevA - inputSample; diff --git a/plugins/MacSignedAU/Energy2/Energy2.h b/plugins/MacSignedAU/Energy2/Energy2.h index 2f59439fc..7266577b1 100644 --- a/plugins/MacSignedAU/Energy2/Energy2.h +++ b/plugins/MacSignedAU/Energy2/Energy2.h @@ -226,7 +226,7 @@ public: Float64 PrevB; Float64 PrevA; - long double lastRef[10]; + double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacSignedAU/Ensemble/Ensemble.cpp b/plugins/MacSignedAU/Ensemble/Ensemble.cpp index ef963db8d..b45e882b9 100755 --- a/plugins/MacSignedAU/Ensemble/Ensemble.cpp +++ b/plugins/MacSignedAU/Ensemble/Ensemble.cpp @@ -190,7 +190,7 @@ void Ensemble::EnsembleKernel::Reset() airEven = 0.0; airOdd = 0.0; airFactor = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -228,7 +228,7 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, int count; int ensemble; Float64 temp; - long double inputSample; + double inputSample; Float64 drySample; //now we'll precalculate some stuff that needn't be in every sample @@ -242,30 +242,7 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; airFactor = airPrev - inputSample; @@ -304,11 +281,11 @@ void Ensemble::EnsembleKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/Ensemble/Ensemble.h b/plugins/MacSignedAU/Ensemble/Ensemble.h index af1c3aac2..08ce6ec37 100755 --- a/plugins/MacSignedAU/Ensemble/Ensemble.h +++ b/plugins/MacSignedAU/Ensemble/Ensemble.h @@ -143,7 +143,7 @@ public: Float64 airEven; Float64 airOdd; Float64 airFactor; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/EveryTrim/EveryTrim.cpp b/plugins/MacSignedAU/EveryTrim/EveryTrim.cpp index 03223936a..26f875112 100755 --- a/plugins/MacSignedAU/EveryTrim/EveryTrim.cpp +++ b/plugins/MacSignedAU/EveryTrim/EveryTrim.cpp @@ -203,8 +203,8 @@ ComponentResult EveryTrim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult EveryTrim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -224,10 +224,10 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 leftgain = pow(10.0,GetParameter( kParam_One )/20.0); Float64 rightgain = pow(10.0,GetParameter( kParam_Two )/20.0); @@ -242,44 +242,8 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -291,7 +255,7 @@ OSStatus EveryTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/EveryTrim/EveryTrim.h b/plugins/MacSignedAU/EveryTrim/EveryTrim.h index 58ffc7264..3aaa10b3c 100755 --- a/plugins/MacSignedAU/EveryTrim/EveryTrim.h +++ b/plugins/MacSignedAU/EveryTrim/EveryTrim.h @@ -121,8 +121,8 @@ public: virtual ComponentResult Version() { return kEveryTrimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/MacSignedAU/Facet/Facet.cpp b/plugins/MacSignedAU/Facet/Facet.cpp index c112be880..d52f4206b 100755 --- a/plugins/MacSignedAU/Facet/Facet.cpp +++ b/plugins/MacSignedAU/Facet/Facet.cpp @@ -177,8 +177,8 @@ void Facet::FacetKernel::Process( const Float32 *inSourceP, Float64 pos = GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacSignedAU/FathomFive/FathomFive.cpp b/plugins/MacSignedAU/FathomFive/FathomFive.cpp index 885c141db..a7d0b4873 100755 --- a/plugins/MacSignedAU/FathomFive/FathomFive.cpp +++ b/plugins/MacSignedAU/FathomFive/FathomFive.cpp @@ -188,7 +188,7 @@ void FathomFive::FathomFiveKernel::Reset() iirSampleB = 0.0; iirSampleC = 0.0; iirSampleD = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -218,30 +218,7 @@ void FathomFive::FathomFiveKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 0) @@ -277,7 +254,7 @@ void FathomFive::FathomFiveKernel::Process( const Float32 *inSourceP, //further ones work to rein in that DC offset issue. //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/FathomFive/FathomFive.h b/plugins/MacSignedAU/FathomFive/FathomFive.h index 4d0b2f16f..ccb24a676 100755 --- a/plugins/MacSignedAU/FathomFive/FathomFive.h +++ b/plugins/MacSignedAU/FathomFive/FathomFive.h @@ -140,7 +140,7 @@ public: Float64 iirSampleB; Float64 iirSampleC; Float64 iirSampleD; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Floor/Floor.cpp b/plugins/MacSignedAU/Floor/Floor.cpp index 8e88f1568..23847659e 100755 --- a/plugins/MacSignedAU/Floor/Floor.cpp +++ b/plugins/MacSignedAU/Floor/Floor.cpp @@ -185,7 +185,7 @@ void Floor::FloorKernel::Reset() iirSample2C = 0.0; iirSample2D = 0.0; iirSample2E = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,28 +221,10 @@ void Floor::FloorKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0-wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -346,11 +328,11 @@ void Floor::FloorKernel::Process( const Float32 *inSourceP, if (wet < 1.0) inputSample = (drySample * dry)+(inputSample*wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Floor/Floor.h b/plugins/MacSignedAU/Floor/Floor.h index 1645f9a1d..0389f291c 100755 --- a/plugins/MacSignedAU/Floor/Floor.h +++ b/plugins/MacSignedAU/Floor/Floor.h @@ -142,7 +142,7 @@ public: Float64 iirSample2C; Float64 iirSample2D; Float64 iirSample2E; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Focus/Focus.cpp b/plugins/MacSignedAU/Focus/Focus.cpp index 4bab9ba52..47da19348 100755 --- a/plugins/MacSignedAU/Focus/Focus.cpp +++ b/plugins/MacSignedAU/Focus/Focus.cpp @@ -243,15 +243,15 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, figure[6] = (1.0 - K / figure[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * figure[2]) + figure[7]; + double tempSample = (inputSample * figure[2]) + figure[7]; figure[7] = -(tempSample * figure[5]) + figure[8]; figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); inputSample = tempSample; @@ -261,7 +261,7 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, inputSample = asin(inputSample); //decode Console5 - long double groundSample = drySample - inputSample; //set up UnBox + double groundSample = drySample - inputSample; //set up UnBox inputSample *= boost; //now, focussed area gets cranked before distort switch (mode) @@ -285,12 +285,12 @@ void Focus::FocusKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSample),4); + double dyno; dyno = pow(fabs(inputSample),4); if (dyno > 0.0) inputSample = (sin(inputSample * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy break; diff --git a/plugins/MacSignedAU/Focus/Focus.h b/plugins/MacSignedAU/Focus/Focus.h index 7103db84b..c24d74933 100755 --- a/plugins/MacSignedAU/Focus/Focus.h +++ b/plugins/MacSignedAU/Focus/Focus.h @@ -148,7 +148,7 @@ public: virtual void Reset(); private: - long double figure[9]; + double figure[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Fracture/Fracture.cpp b/plugins/MacSignedAU/Fracture/Fracture.cpp index e4593ca96..803fc50f7 100755 --- a/plugins/MacSignedAU/Fracture/Fracture.cpp +++ b/plugins/MacSignedAU/Fracture/Fracture.cpp @@ -182,7 +182,7 @@ ComponentResult Fracture::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Fracture::FractureKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,30 +213,7 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -255,11 +232,11 @@ void Fracture::FractureKernel::Process( const Float32 *inSourceP, inputSample = (drySample * dry)+(inputSample*wet); //that simple. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Fracture/Fracture.h b/plugins/MacSignedAU/Fracture/Fracture.h index 1dccb926e..b96b6f39f 100755 --- a/plugins/MacSignedAU/Fracture/Fracture.h +++ b/plugins/MacSignedAU/Fracture/Fracture.h @@ -134,7 +134,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/FromTape/FromTape.cpp b/plugins/MacSignedAU/FromTape/FromTape.cpp index 663350c06..48a06fe3c 100755 --- a/plugins/MacSignedAU/FromTape/FromTape.cpp +++ b/plugins/MacSignedAU/FromTape/FromTape.cpp @@ -220,8 +220,7 @@ void FromTape::FromTapeKernel::Reset() iirSampleY = 0.0; iirSampleZ = 0.0; flip = 0; - //noisesource = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -256,34 +255,11 @@ void FromTape::FromTapeKernel::Process( const Float32 *inSourceP, Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -373,11 +349,11 @@ void FromTape::FromTapeKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/FromTape/FromTape.h b/plugins/MacSignedAU/FromTape/FromTape.h index e9156d53b..926d70017 100755 --- a/plugins/MacSignedAU/FromTape/FromTape.h +++ b/plugins/MacSignedAU/FromTape/FromTape.h @@ -169,7 +169,7 @@ public: Float64 iirSampleZ; int flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Galactic/Galactic.cpp b/plugins/MacSignedAU/Galactic/Galactic.cpp index ae3b8adeb..42df3ef60 100644 --- a/plugins/MacSignedAU/Galactic/Galactic.cpp +++ b/plugins/MacSignedAU/Galactic/Galactic.cpp @@ -305,8 +305,8 @@ OSStatus Galactic::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag delayM = 256; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; diff --git a/plugins/MacSignedAU/Gatelinked/Gatelinked.cpp b/plugins/MacSignedAU/Gatelinked/Gatelinked.cpp index fbb2b14bb..258d3aade 100755 --- a/plugins/MacSignedAU/Gatelinked/Gatelinked.cpp +++ b/plugins/MacSignedAU/Gatelinked/Gatelinked.cpp @@ -216,8 +216,8 @@ ComponentResult Gatelinked::Reset(AudioUnitScope inScope, AudioUnitElement inEl treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -234,7 +234,7 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); //speed settings around release @@ -253,8 +253,8 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 highestSample; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; static int noisesourceL = 0; static int noisesourceR = 850010; int residue; @@ -414,7 +414,7 @@ OSStatus Gatelinked::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Gatelinked/Gatelinked.h b/plugins/MacSignedAU/Gatelinked/Gatelinked.h index 1aecad135..a79e65342 100755 --- a/plugins/MacSignedAU/Gatelinked/Gatelinked.h +++ b/plugins/MacSignedAU/Gatelinked/Gatelinked.h @@ -131,8 +131,8 @@ public: Float64 treblefreq; Float64 bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + double fpNShapeL; + double fpNShapeR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/Gatelope/Gatelope.cpp b/plugins/MacSignedAU/Gatelope/Gatelope.cpp index a2b9cbf34..4d5cefb1f 100755 --- a/plugins/MacSignedAU/Gatelope/Gatelope.cpp +++ b/plugins/MacSignedAU/Gatelope/Gatelope.cpp @@ -197,7 +197,7 @@ void Gatelope::GatelopeKernel::Reset() treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -212,7 +212,7 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); //speed settings around release @@ -230,27 +230,9 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, Float64 attackSpeed; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; attackSpeed = slowAttack - (fabs(inputSample)*slowAttack*0.5); @@ -334,11 +316,11 @@ void Gatelope::GatelopeKernel::Process( const Float32 *inSourceP, flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Gatelope/Gatelope.h b/plugins/MacSignedAU/Gatelope/Gatelope.h index e2ecc0b1f..34d3f3d10 100755 --- a/plugins/MacSignedAU/Gatelope/Gatelope.h +++ b/plugins/MacSignedAU/Gatelope/Gatelope.h @@ -143,7 +143,7 @@ public: Float64 treblefreq; Float64 bassfreq; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/GlitchShifter/GlitchShifter.cpp b/plugins/MacSignedAU/GlitchShifter/GlitchShifter.cpp index 3bc41186c..9d474d5a4 100755 --- a/plugins/MacSignedAU/GlitchShifter/GlitchShifter.cpp +++ b/plugins/MacSignedAU/GlitchShifter/GlitchShifter.cpp @@ -235,8 +235,8 @@ void GlitchShifter::GlitchShifterKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; airFactor = airPrev - inputSample; if (flip) {airEven += airFactor; airOdd -= airFactor; airFactor = airEven;} diff --git a/plugins/MacSignedAU/Golem/Golem.cpp b/plugins/MacSignedAU/Golem/Golem.cpp index 5c75d3c24..190cf0c7a 100755 --- a/plugins/MacSignedAU/Golem/Golem.cpp +++ b/plugins/MacSignedAU/Golem/Golem.cpp @@ -210,8 +210,8 @@ ComponentResult Golem::Reset(AudioUnitScope inScope, AudioUnitElement inElement { for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -249,50 +249,14 @@ OSStatus Golem::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, int far = near + 1; Float64 nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -329,7 +293,7 @@ OSStatus Golem::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Golem/Golem.h b/plugins/MacSignedAU/Golem/Golem.h index d66b91f8e..8de93792b 100755 --- a/plugins/MacSignedAU/Golem/Golem.h +++ b/plugins/MacSignedAU/Golem/Golem.h @@ -132,8 +132,8 @@ public: private: Float64 p[4099]; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/Gringer/Gringer.cpp b/plugins/MacSignedAU/Gringer/Gringer.cpp index ee2799728..72b810819 100755 --- a/plugins/MacSignedAU/Gringer/Gringer.cpp +++ b/plugins/MacSignedAU/Gringer/Gringer.cpp @@ -166,7 +166,7 @@ void Gringer::GringerKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); inband[0] = 0.025/overallscale; @@ -190,13 +190,13 @@ void Gringer::GringerKernel::Process( const Float32 *inSourceP, outband[6] = (1.0 - K / outband[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = (inputSample * inband[2]) + inband[7]; + double tempSample = (inputSample * inband[2]) + inband[7]; inband[7] = -(tempSample * inband[5]) + inband[8]; inband[8] = (inputSample * inband[4]) - (tempSample * inband[6]); diff --git a/plugins/MacSignedAU/Gringer/Gringer.h b/plugins/MacSignedAU/Gringer/Gringer.h index 921cf0aaf..82eca4178 100755 --- a/plugins/MacSignedAU/Gringer/Gringer.h +++ b/plugins/MacSignedAU/Gringer/Gringer.h @@ -120,8 +120,8 @@ public: virtual void Reset(); private: - long double inband[9]; - long double outband[9]; + double inband[9]; + double outband[9]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/GrooveWear/GrooveWear.cpp b/plugins/MacSignedAU/GrooveWear/GrooveWear.cpp index 6bb8ca159..f0e0b843c 100755 --- a/plugins/MacSignedAU/GrooveWear/GrooveWear.cpp +++ b/plugins/MacSignedAU/GrooveWear/GrooveWear.cpp @@ -177,7 +177,7 @@ void GrooveWear::GrooveWearKernel::Reset() bMidPrev = 0.0; cMidPrev = 0.0; dMidPrev = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,36 +269,13 @@ void GrooveWear::GrooveWearKernel::Process( const Float32 *inSourceP, Float64 dDry = 1.0 - dWet; Float64 drySample; - long double inputSample; + double inputSample; Float64 accumulatorSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (aWet > 0.0) { @@ -444,11 +421,11 @@ void GrooveWear::GrooveWearKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * dWet) + (drySample * dDry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/GrooveWear/GrooveWear.h b/plugins/MacSignedAU/GrooveWear/GrooveWear.h index 5f86da892..315b8c765 100755 --- a/plugins/MacSignedAU/GrooveWear/GrooveWear.h +++ b/plugins/MacSignedAU/GrooveWear/GrooveWear.h @@ -138,7 +138,7 @@ public: Float64 cMidPrev; Float64 dMidPrev; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.cpp b/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.cpp index cff4f31e8..543f836e7 100755 --- a/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.cpp +++ b/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.cpp @@ -150,7 +150,7 @@ ComponentResult GuitarConditioner::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void GuitarConditioner::GuitarConditionerKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; lastSampleT = 0.0; lastSampleB = 0.0; //for Slews. T for treble, B for bass @@ -172,12 +172,12 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double treble; - long double bass; + double inputSample; + double treble; + double bass; Float64 iirTreble = 0.287496/overallscale; //tight is -1 Float64 iirBass = 0.085184/overallscale; //tight is 1 iirTreble += iirTreble; @@ -192,30 +192,7 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; treble = bass = inputSample; @@ -262,11 +239,11 @@ void GuitarConditioner::GuitarConditionerKernel::Process( const Float32 *inSou inputSample = treble + bass; //final merge fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; destP += inNumChannels; diff --git a/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.h b/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.h index 4ad66691a..461f7db1d 100755 --- a/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.h +++ b/plugins/MacSignedAU/GuitarConditioner/GuitarConditioner.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; bool fpFlip; Float64 lastSampleT; Float64 lastSampleB; //for Slews diff --git a/plugins/MacSignedAU/HardVacuum/HardVacuum.cpp b/plugins/MacSignedAU/HardVacuum/HardVacuum.cpp index 7ab3ee625..6f31d261c 100755 --- a/plugins/MacSignedAU/HardVacuum/HardVacuum.cpp +++ b/plugins/MacSignedAU/HardVacuum/HardVacuum.cpp @@ -191,7 +191,7 @@ ComponentResult HardVacuum::Initialize() void HardVacuum::HardVacuumKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -222,35 +222,12 @@ void HardVacuum::HardVacuumKernel::Process( const Float32 *inSourceP, Float64 negative; Float64 bridgerectifier; Float64 skew; - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; skew = (inputSample - lastSample); @@ -314,11 +291,11 @@ void HardVacuum::HardVacuumKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/HardVacuum/HardVacuum.h b/plugins/MacSignedAU/HardVacuum/HardVacuum.h index b5b4116a9..42a1ffe04 100755 --- a/plugins/MacSignedAU/HardVacuum/HardVacuum.h +++ b/plugins/MacSignedAU/HardVacuum/HardVacuum.h @@ -139,7 +139,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/HermeTrim/HermeTrim.cpp b/plugins/MacSignedAU/HermeTrim/HermeTrim.cpp index 7d1715558..405702917 100755 --- a/plugins/MacSignedAU/HermeTrim/HermeTrim.cpp +++ b/plugins/MacSignedAU/HermeTrim/HermeTrim.cpp @@ -203,8 +203,8 @@ ComponentResult HermeTrim::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult HermeTrim::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -224,10 +224,10 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 leftgain = pow(10.0,GetParameter( kParam_One )/20.0); Float64 rightgain = pow(10.0,GetParameter( kParam_Two )/20.0); @@ -242,44 +242,8 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -291,7 +255,7 @@ OSStatus HermeTrim::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/HermeTrim/HermeTrim.h b/plugins/MacSignedAU/HermeTrim/HermeTrim.h index 28ed59989..da24fea06 100755 --- a/plugins/MacSignedAU/HermeTrim/HermeTrim.h +++ b/plugins/MacSignedAU/HermeTrim/HermeTrim.h @@ -121,8 +121,8 @@ public: virtual ComponentResult Version() { return kHermeTrimVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacSignedAU/Hermepass/Hermepass.cpp b/plugins/MacSignedAU/Hermepass/Hermepass.cpp index d4d96dd15..a83215dbf 100755 --- a/plugins/MacSignedAU/Hermepass/Hermepass.cpp +++ b/plugins/MacSignedAU/Hermepass/Hermepass.cpp @@ -174,7 +174,7 @@ void Hermepass::HermepassKernel::Reset() iirF = 0.0; iirG = 0.0; iirH = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -190,11 +190,11 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 rangescale = 0.1 / overallscale; @@ -241,36 +241,13 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSample; + double inputSample; Float64 tempSample; Float64 correction; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; tempSample = inputSample; if (fpFlip) { @@ -301,11 +278,11 @@ void Hermepass::HermepassKernel::Process( const Float32 *inSourceP, inputSample -= correction; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Hermepass/Hermepass.h b/plugins/MacSignedAU/Hermepass/Hermepass.h index 3483edc52..56b4c4a5f 100755 --- a/plugins/MacSignedAU/Hermepass/Hermepass.h +++ b/plugins/MacSignedAU/Hermepass/Hermepass.h @@ -139,7 +139,7 @@ public: Float64 iirH; //seven poles max, and the final pole is always at 20hz directly. - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/HighGlossDither/HighGlossDither.cpp b/plugins/MacSignedAU/HighGlossDither/HighGlossDither.cpp index fc7f7765a..869bbc4eb 100755 --- a/plugins/MacSignedAU/HighGlossDither/HighGlossDither.cpp +++ b/plugins/MacSignedAU/HighGlossDither/HighGlossDither.cpp @@ -167,35 +167,12 @@ void HighGlossDither::HighGlossDitherKernel::Process( const Float32 *inSourceP const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; int hotbinA; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacSignedAU/HighImpact/HighImpact.cpp b/plugins/MacSignedAU/HighImpact/HighImpact.cpp index 854852212..1239c2492 100755 --- a/plugins/MacSignedAU/HighImpact/HighImpact.cpp +++ b/plugins/MacSignedAU/HighImpact/HighImpact.cpp @@ -175,7 +175,7 @@ ComponentResult HighImpact::Initialize() void HighImpact::HighImpactKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -205,30 +205,7 @@ void HighImpact::HighImpactKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -273,11 +250,11 @@ void HighImpact::HighImpactKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Highpass/Highpass.cpp b/plugins/MacSignedAU/Highpass/Highpass.cpp index 4329ef9b8..13b258fd9 100755 --- a/plugins/MacSignedAU/Highpass/Highpass.cpp +++ b/plugins/MacSignedAU/Highpass/Highpass.cpp @@ -175,7 +175,7 @@ void Highpass::HighpassKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -218,30 +218,7 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -262,11 +239,11 @@ void Highpass::HighpassKernel::Process( const Float32 *inSourceP, if (wet < 1.0) outputSample = (outputSample * wet) + (inputSample * dry); fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = outputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Highpass/Highpass.h b/plugins/MacSignedAU/Highpass/Highpass.h index d29dcf95c..87591e997 100755 --- a/plugins/MacSignedAU/Highpass/Highpass.h +++ b/plugins/MacSignedAU/Highpass/Highpass.h @@ -136,7 +136,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/Highpass2/Highpass2.cpp b/plugins/MacSignedAU/Highpass2/Highpass2.cpp index 5cd6e736f..bbc6e40d4 100755 --- a/plugins/MacSignedAU/Highpass2/Highpass2.cpp +++ b/plugins/MacSignedAU/Highpass2/Highpass2.cpp @@ -228,28 +228,10 @@ void Highpass2::Highpass2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); else offset = (1 + tight) + ((1-fabs(inputSample))*tight); diff --git a/plugins/MacSignedAU/Holt/Holt.cpp b/plugins/MacSignedAU/Holt/Holt.cpp index 56c973fb7..894e6edd9 100755 --- a/plugins/MacSignedAU/Holt/Holt.cpp +++ b/plugins/MacSignedAU/Holt/Holt.cpp @@ -220,8 +220,8 @@ void Holt::HoltKernel::Process( const Float32 *inSourceP, alpha += ((1.0-beta)*pow(GetParameter( kParam_One ),3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times Float64 aWet = 1.0; Float64 bWet = 1.0; @@ -241,10 +241,10 @@ void Holt::HoltKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (aWet > 0.0) { trend = (beta * (inputSample - previousSampleA) + ((0.999-beta) * previousTrendA)); diff --git a/plugins/MacSignedAU/Holt/Holt.h b/plugins/MacSignedAU/Holt/Holt.h index ae955b069..11ffa2d1f 100755 --- a/plugins/MacSignedAU/Holt/Holt.h +++ b/plugins/MacSignedAU/Holt/Holt.h @@ -137,14 +137,14 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousTrendA; - long double previousSampleB; - long double previousTrendB; - long double previousSampleC; - long double previousTrendC; - long double previousSampleD; - long double previousTrendD; + double previousSampleA; + double previousTrendA; + double previousSampleB; + double previousTrendB; + double previousSampleC; + double previousTrendC; + double previousSampleD; + double previousTrendD; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Hombre/Hombre.cpp b/plugins/MacSignedAU/Hombre/Hombre.cpp index 57bedbad1..c08576fb3 100755 --- a/plugins/MacSignedAU/Hombre/Hombre.cpp +++ b/plugins/MacSignedAU/Hombre/Hombre.cpp @@ -169,7 +169,7 @@ void Hombre::HombreKernel::Reset() for(int count = 0; count < 4000; count++) {p[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -194,37 +194,14 @@ void Hombre::HombreKernel::Process( const Float32 *inSourceP, int widthB = (int)(7.0*overallscale); //max 364 at 44.1, 792 at 96K Float64 wet = GetParameter( kParam_Two ); Float64 dry = 1.0 - wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 total; int count; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; slide = (slide * 0.9997)+(target*0.0003); @@ -266,11 +243,11 @@ void Hombre::HombreKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Hombre/Hombre.h b/plugins/MacSignedAU/Hombre/Hombre.h index 0f2225b5d..517e88d9d 100755 --- a/plugins/MacSignedAU/Hombre/Hombre.h +++ b/plugins/MacSignedAU/Hombre/Hombre.h @@ -131,7 +131,7 @@ public: Float64 p[4001]; Float64 slide; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Hull/Hull.cpp b/plugins/MacSignedAU/Hull/Hull.cpp index ca22e33e3..a2154eb72 100644 --- a/plugins/MacSignedAU/Hull/Hull.cpp +++ b/plugins/MacSignedAU/Hull/Hull.cpp @@ -185,31 +185,31 @@ void Hull::HullKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 96000.0; overallscale *= GetSampleRate(); //this one's scaled to 96k for the deepest bass if (overallscale > 1.0) overallscale = 1.0; //and if you go for 192k, rather than crash //it just cuts out the maximum (2000) depth of averaging you can get Float64 hullSetting = pow(GetParameter( kParam_One ),3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; Float64 wet = -GetParameter( kParam_Two ); //functions as dark/bright while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; bPointer--; if (bPointer < 0) bPointer += 2000; b[bPointer] = b[bPointer+2000] = inputSample; int x = bPointer; - long double longAverage = 0.0; - long double shortAverage = 0.0; + double longAverage = 0.0; + double shortAverage = 0.0; while (x < bPointer+limitB) { shortAverage += b[x]; longAverage += b[x]; @@ -227,7 +227,7 @@ void Hull::HullKernel::Process( const Float32 *inSourceP, c[cPointer] = c[cPointer+50] = shortAverage+(shortAverage-longAverage); x = cPointer; - long double shortestAverage = 0.0; + double shortestAverage = 0.0; while (x < cPointer+limitC) { shortestAverage += c[x]; x++; diff --git a/plugins/MacSignedAU/Hull/Hull.h b/plugins/MacSignedAU/Hull/Hull.h index 7436017c7..e8746c157 100644 --- a/plugins/MacSignedAU/Hull/Hull.h +++ b/plugins/MacSignedAU/Hull/Hull.h @@ -127,9 +127,9 @@ public: virtual void Reset(); private: - long double b[4005]; + double b[4005]; int bPointer; - long double c[105]; + double c[105]; int cPointer; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/Infinity/Infinity.cpp b/plugins/MacSignedAU/Infinity/Infinity.cpp index 185e40505..34c14ca04 100755 --- a/plugins/MacSignedAU/Infinity/Infinity.cpp +++ b/plugins/MacSignedAU/Infinity/Infinity.cpp @@ -291,11 +291,11 @@ void Infinity::InfinityKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -303,10 +303,10 @@ void Infinity::InfinityKernel::Process( const Float32 *inSourceP, //we're going to use this as a kind of balance since the reverb buildup can be so large inputSample *= 0.5; - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} diff --git a/plugins/MacSignedAU/Infinity/Infinity.h b/plugins/MacSignedAU/Infinity/Infinity.h index 8fe50533b..f18d4ce5f 100755 --- a/plugins/MacSignedAU/Infinity/Infinity.h +++ b/plugins/MacSignedAU/Infinity/Infinity.h @@ -133,9 +133,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacSignedAU/Infinity2/Infinity2.cpp b/plugins/MacSignedAU/Infinity2/Infinity2.cpp index fbcb4bd83..b98bb0201 100644 --- a/plugins/MacSignedAU/Infinity2/Infinity2.cpp +++ b/plugins/MacSignedAU/Infinity2/Infinity2.cpp @@ -306,18 +306,18 @@ void Infinity2::Infinity2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} diff --git a/plugins/MacSignedAU/Infinity2/Infinity2.h b/plugins/MacSignedAU/Infinity2/Infinity2.h index c9f9d957e..71c2852dd 100644 --- a/plugins/MacSignedAU/Infinity2/Infinity2.h +++ b/plugins/MacSignedAU/Infinity2/Infinity2.h @@ -140,9 +140,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacSignedAU/Infrasonic/Infrasonic.cpp b/plugins/MacSignedAU/Infrasonic/Infrasonic.cpp index b1da7a7ab..c84fa5137 100755 --- a/plugins/MacSignedAU/Infrasonic/Infrasonic.cpp +++ b/plugins/MacSignedAU/Infrasonic/Infrasonic.cpp @@ -215,10 +215,10 @@ void Infrasonic::InfrasonicKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Infrasonic/Infrasonic.h b/plugins/MacSignedAU/Infrasonic/Infrasonic.h index 76788591c..3a1601a87 100755 --- a/plugins/MacSignedAU/Infrasonic/Infrasonic.h +++ b/plugins/MacSignedAU/Infrasonic/Infrasonic.h @@ -118,11 +118,11 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Interstage/Interstage.cpp b/plugins/MacSignedAU/Interstage/Interstage.cpp index c5426bdbe..4b193e539 100755 --- a/plugins/MacSignedAU/Interstage/Interstage.cpp +++ b/plugins/MacSignedAU/Interstage/Interstage.cpp @@ -173,7 +173,7 @@ void Interstage::InterstageKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -182,9 +182,9 @@ void Interstage::InterstageKernel::Process( const Float32 *inSourceP, Float64 threshold = 0.381966011250105; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = (inputSample+lastSample)*0.5; //start the lowpassing with an average diff --git a/plugins/MacSignedAU/Interstage/Interstage.h b/plugins/MacSignedAU/Interstage/Interstage.h index d1cdd2d73..be12dd469 100755 --- a/plugins/MacSignedAU/Interstage/Interstage.h +++ b/plugins/MacSignedAU/Interstage/Interstage.h @@ -125,7 +125,7 @@ public: Float64 iirSampleD; Float64 iirSampleE; Float64 iirSampleF; - long double lastSample; + double lastSample; uint32_t fpd; bool flip; }; diff --git a/plugins/MacSignedAU/IronOxide5/IronOxide5.cpp b/plugins/MacSignedAU/IronOxide5/IronOxide5.cpp index 735b8358b..cb4ca6160 100755 --- a/plugins/MacSignedAU/IronOxide5/IronOxide5.cpp +++ b/plugins/MacSignedAU/IronOxide5/IronOxide5.cpp @@ -224,7 +224,7 @@ void IronOxide5::IronOxide5Kernel::Reset() sweep = 0.0; rateof = 0.5; nextmax = 0.5; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -257,7 +257,7 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, Float64 fastTaper = ips/15.0; Float64 slowTaper = 2.0/(lps*lps); Float64 lowspeedscale = (5.0/ips); - long double inputSample; + double inputSample; Float64 drySample; SInt32 count; SInt32 flutcount; @@ -288,30 +288,7 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; flutterrandy = (rand()/(double)RAND_MAX); @@ -477,11 +454,11 @@ void IronOxide5::IronOxide5Kernel::Process( const Float32 *inSourceP, if (fabs(drySample) > 0.0) inputSample += drySample; //end invdrywet block with outputgain - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/IronOxide5/IronOxide5.h b/plugins/MacSignedAU/IronOxide5/IronOxide5.h index 2b3c655d4..3353a8004 100755 --- a/plugins/MacSignedAU/IronOxide5/IronOxide5.h +++ b/plugins/MacSignedAU/IronOxide5/IronOxide5.h @@ -167,7 +167,7 @@ public: Float64 rateof; Float64 sweep; Float64 nextmax; - long double fpNShape; + uint32_t fpd; bool flip; }; }; diff --git a/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.cpp b/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.cpp index 8365b5d29..a5937959d 100755 --- a/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.cpp +++ b/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.cpp @@ -180,7 +180,7 @@ void IronOxideClassic::IronOxideClassicKernel::Reset() gcount = 0; fastIIRA = fastIIRB = slowIIRA = slowIIRB = 0.0; iirSampleA = iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -208,7 +208,7 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc Float64 fastTaper = ips/15.0; Float64 slowTaper = 2.0/(ips*ips); Float64 lowspeedscale = (5.0/ips); - long double inputSample; + double inputSample; SInt32 count; Float64 temp; Float64 overallscale = 1.0; @@ -225,30 +225,7 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fpFlip) { @@ -381,11 +358,11 @@ void IronOxideClassic::IronOxideClassicKernel::Process( const Float32 *inSourc if (outputgain != 1.0) inputSample *= outputgain; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.h b/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.h index 4dfe41be6..6d9bb949a 100755 --- a/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.h +++ b/plugins/MacSignedAU/IronOxideClassic/IronOxideClassic.h @@ -142,7 +142,7 @@ public: Float64 slowIIRB; SInt32 gcount; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.cpp b/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.cpp index 301677b2e..9edf54f32 100755 --- a/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.cpp +++ b/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.cpp @@ -199,7 +199,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -250,8 +250,8 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (flip) { @@ -268,14 +268,14 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou //do IIR highpass for leaning out if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } if (inputgain != 1.0) inputSample *= inputgain; - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSample > 0.0) inputSample = bridgerectifier; @@ -288,7 +288,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou int count = gcount; //increment the counter - long double temp; + double temp; d[count+131] = d[count] = inputSample; if (flip) @@ -424,7 +424,7 @@ void IronOxideClassic2::IronOxideClassic2Kernel::Process( const Float32 *inSou //second stage of overdrive to prevent overs and allow bloody loud extremeness if (biquadB[0] < 0.49999) { - long double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; + double tempSample = biquadB[2]*inputSample+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSample; inputSample = tempSample; biquadB[10] = biquadB[9]; biquadB[9] = inputSample; //DF1 } diff --git a/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.h b/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.h index 319114d2c..d4fa13f74 100755 --- a/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.h +++ b/plugins/MacSignedAU/IronOxideClassic2/IronOxideClassic2.h @@ -133,8 +133,8 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; Float64 iirSampleA; Float64 iirSampleB; Float64 d[264]; diff --git a/plugins/MacSignedAU/Isolator/Isolator.cpp b/plugins/MacSignedAU/Isolator/Isolator.cpp index ece5888ac..3e835c34c 100755 --- a/plugins/MacSignedAU/Isolator/Isolator.cpp +++ b/plugins/MacSignedAU/Isolator/Isolator.cpp @@ -190,7 +190,7 @@ void Isolator::IsolatorKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -237,14 +237,14 @@ void Isolator::IsolatorKernel::Process( const Float32 *inSourceP, // but I would suggest subtracting the lowpass from dry while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; inputSample = sin(inputSample); //encode Console5: good cleanness - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Isolator/Isolator.h b/plugins/MacSignedAU/Isolator/Isolator.h index 7f8d575ad..821e02161 100755 --- a/plugins/MacSignedAU/Isolator/Isolator.h +++ b/plugins/MacSignedAU/Isolator/Isolator.h @@ -131,9 +131,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Isolator2/English.lproj/InfoPlist.strings b/plugins/MacSignedAU/Isolator2/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..f5ce7052eee6e91dc07737965375b17b751c46e8 GIT binary patch literal 380 zcmZ{gK?{OF6olv8uUI;I$P~I19ZD#Iia_WdSr%D|T2ep0`rJT>ie=yI&dwWV-}B+h zkk}!s|G93NJCvvN9Z=1 z<9`H=`s^k?IW7ro0cP^ydO!L??d*G@hZO(}Il3&07`2vP{Kc4^q literal 0 HcmV?d00001 diff --git a/plugins/MacSignedAU/Isolator2/Info.plist b/plugins/MacSignedAU/Isolator2/Info.plist new file mode 100644 index 000000000..01dc6831c --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.airwindows.audiounit.${PRODUCT_NAME:identifier} + CFBundleName + ${PROJECTNAMEASIDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + DthX + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.cpp b/plugins/MacSignedAU/Isolator2/Isolator2.cpp new file mode 100644 index 000000000..79fc6eb82 --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.cpp @@ -0,0 +1,441 @@ +/* + * File: Isolator2.cpp + * + * Version: 1.0 + * + * Created: 2/21/22 + * + * Copyright: Copyright © 2022 Airwindows, All Rights Reserved + * + * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in + * consideration of your agreement to the following terms, and your use, installation, modification + * or redistribution of this Apple software constitutes acceptance of these terms. If you do + * not agree with these terms, please do not use, install, modify or redistribute this Apple + * software. + * + * In consideration of your agreement to abide by the following terms, and subject to these terms, + * Apple grants you a personal, non-exclusive license, under Apple's copyrights in this + * original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the + * Apple Software, with or without modifications, in source and/or binary forms; provided that if you + * redistribute the Apple Software in its entirety and without modifications, you must retain this + * notice and the following text and disclaimers in all such redistributions of the Apple Software. + * Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to + * endorse or promote products derived from the Apple Software without specific prior written + * permission from Apple. Except as expressly stated in this notice, no other rights or + * licenses, express or implied, are granted by Apple herein, including but not limited to any + * patent rights that may be infringed by your derivative works or by other works in which the + * Apple Software may be incorporated. + * + * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR + * IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE + * OR IN COMBINATION WITH YOUR PRODUCTS. + * + * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, + * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER + * UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN + * IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*============================================================================= + Isolator2.cpp + + =============================================================================*/ +#include "Isolator2.h" + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +COMPONENT_ENTRY(Isolator2) + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::Isolator2 +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Isolator2::Isolator2(AudioUnit component) +: AUEffectBase(component) +{ + CreateElements(); + Globals()->UseIndexedParameters(kNumberOfParameters); + SetParameter(kParam_One, kDefaultValue_ParamOne ); + SetParameter(kParam_Two, kDefaultValue_ParamTwo ); + SetParameter(kParam_Three, kDefaultValue_ParamThree ); + SetParameter(kParam_Four, kDefaultValue_ParamFour ); + +#if AU_DEBUG_DISPATCHER + mDebugDispatcher = new AUDebugDispatcher (this); +#endif + +} + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::GetParameterValueStrings +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Isolator2::GetParameterValueStrings(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + CFArrayRef * outStrings) +{ + + return kAudioUnitErr_InvalidProperty; +} + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::GetParameterInfo +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Isolator2::GetParameterInfo(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + AudioUnitParameterInfo &outParameterInfo ) +{ + ComponentResult result = noErr; + + outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable + | kAudioUnitParameterFlag_IsReadable; + + if (inScope == kAudioUnitScope_Global) { + switch(inParameterID) + { + case kParam_One: + AUBase::FillInParameterName (outParameterInfo, kParameterOneName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamOne; + break; + case kParam_Two: + AUBase::FillInParameterName (outParameterInfo, kParameterTwoName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamTwo; + break; + case kParam_Three: + AUBase::FillInParameterName (outParameterInfo, kParameterThreeName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamThree; + break; + case kParam_Four: + AUBase::FillInParameterName (outParameterInfo, kParameterFourName, false); + outParameterInfo.unit = kAudioUnitParameterUnit_Generic; + outParameterInfo.minValue = 0.0; + outParameterInfo.maxValue = 1.0; + outParameterInfo.defaultValue = kDefaultValue_ParamFour; + break; + default: + result = kAudioUnitErr_InvalidParameter; + break; + } + } else { + result = kAudioUnitErr_InvalidParameter; + } + + + + return result; +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::GetPropertyInfo +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Isolator2::GetPropertyInfo (AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + UInt32 & outDataSize, + Boolean & outWritable) +{ + return AUEffectBase::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable); +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::GetProperty +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Isolator2::GetProperty( AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + void * outData ) +{ + return AUEffectBase::GetProperty (inID, inScope, inElement, outData); +} + +// Isolator2::Initialize +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ComponentResult Isolator2::Initialize() +{ + ComponentResult result = AUEffectBase::Initialize(); + if (result == noErr) + Reset(kAudioUnitScope_Global, 0); + return result; +} + +#pragma mark ____Isolator2EffectKernel + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::Isolator2Kernel::Reset() +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +void Isolator2::Isolator2Kernel::Reset() +{ + for (int x = 0; x < biq_total; x++) { + biquadA[x] = 0.0; + biquadB[x] = 0.0; + biquadC[x] = 0.0; + biquadD[x] = 0.0; + biquadE[x] = 0.0; + biquadF[x] = 0.0; + biquadG[x] = 0.0; + } + highA = 0.0; highB = 0.0; + lowA = 1.0; lowB = 1.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Isolator2::Isolator2Kernel::Process +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +void Isolator2::Isolator2Kernel::Process( const Float32 *inSourceP, + Float32 *inDestP, + UInt32 inFramesToProcess, + UInt32 inNumChannels, + bool &ioSilence ) +{ + UInt32 nSampleFrames = inFramesToProcess; + const Float32 *sourceP = inSourceP; + Float32 *destP = inDestP; + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= GetSampleRate(); + + biquadA[biq_freq] = pow(GetParameter( kParam_One ),(2.0*sqrt(overallscale)))*0.4999; + if (biquadA[biq_freq] < 0.0005) biquadA[biq_freq] = 0.0005; + biquadG[biq_freq] = biquadF[biq_freq] = biquadE[biq_freq] = biquadD[biq_freq] = biquadC[biq_freq] = biquadB[biq_freq] = biquadA[biq_freq]; + + double reso = pow(GetParameter( kParam_Two ),2); + double resoBoost = reso+1.0; + reso = 1.0-reso; + + biquadA[biq_reso] = 4.46570214 * resoBoost; + biquadB[biq_reso] = 1.51387132 * resoBoost; + biquadC[biq_reso] = 0.93979296 * resoBoost; + biquadD[biq_reso] = 0.70710678 * resoBoost; + biquadE[biq_reso] = 0.59051105 * resoBoost; + biquadF[biq_reso] = 0.52972649 * resoBoost; + biquadG[biq_reso] = 0.50316379 * resoBoost; + + biquadA[biq_aA0] = biquadA[biq_aB0]; + biquadA[biq_aA1] = biquadA[biq_aB1]; + biquadA[biq_aA2] = biquadA[biq_aB2]; + biquadA[biq_bA1] = biquadA[biq_bB1]; + biquadA[biq_bA2] = biquadA[biq_bB2]; + + biquadB[biq_aA0] = biquadB[biq_aB0]; + biquadB[biq_aA1] = biquadB[biq_aB1]; + biquadB[biq_aA2] = biquadB[biq_aB2]; + biquadB[biq_bA1] = biquadB[biq_bB1]; + biquadB[biq_bA2] = biquadB[biq_bB2]; + + biquadC[biq_aA0] = biquadC[biq_aB0]; + biquadC[biq_aA1] = biquadC[biq_aB1]; + biquadC[biq_aA2] = biquadC[biq_aB2]; + biquadC[biq_bA1] = biquadC[biq_bB1]; + biquadC[biq_bA2] = biquadC[biq_bB2]; + + biquadD[biq_aA0] = biquadD[biq_aB0]; + biquadD[biq_aA1] = biquadD[biq_aB1]; + biquadD[biq_aA2] = biquadD[biq_aB2]; + biquadD[biq_bA1] = biquadD[biq_bB1]; + biquadD[biq_bA2] = biquadD[biq_bB2]; + + biquadE[biq_aA0] = biquadE[biq_aB0]; + biquadE[biq_aA1] = biquadE[biq_aB1]; + biquadE[biq_aA2] = biquadE[biq_aB2]; + biquadE[biq_bA1] = biquadE[biq_bB1]; + biquadE[biq_bA2] = biquadE[biq_bB2]; + + biquadF[biq_aA0] = biquadF[biq_aB0]; + biquadF[biq_aA1] = biquadF[biq_aB1]; + biquadF[biq_aA2] = biquadF[biq_aB2]; + biquadF[biq_bA1] = biquadF[biq_bB1]; + biquadF[biq_bA2] = biquadF[biq_bB2]; + + biquadG[biq_aA0] = biquadG[biq_aB0]; + biquadG[biq_aA1] = biquadG[biq_aB1]; + biquadG[biq_aA2] = biquadG[biq_aB2]; + biquadG[biq_bA1] = biquadG[biq_bB1]; + biquadG[biq_bA2] = biquadG[biq_bB2]; + + //previous run through the buffer is still in the filter, so we move it + //to the A section and now it's the new starting point. + double K = tan(M_PI * biquadA[biq_freq]); + double norm = 1.0 / (1.0 + K / biquadA[biq_reso] + K * K); + biquadA[biq_aB0] = K * K * norm; + biquadA[biq_aB1] = 2.0 * biquadA[biq_aB0]; + biquadA[biq_aB2] = biquadA[biq_aB0]; + biquadA[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadA[biq_bB2] = (1.0 - K / biquadA[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadB[biq_freq]); + norm = 1.0 / (1.0 + K / biquadB[biq_reso] + K * K); + biquadB[biq_aB0] = K * K * norm; + biquadB[biq_aB1] = 2.0 * biquadB[biq_aB0]; + biquadB[biq_aB2] = biquadB[biq_aB0]; + biquadB[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadB[biq_bB2] = (1.0 - K / biquadB[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadC[biq_freq]); + norm = 1.0 / (1.0 + K / biquadC[biq_reso] + K * K); + biquadC[biq_aB0] = K * K * norm; + biquadC[biq_aB1] = 2.0 * biquadC[biq_aB0]; + biquadC[biq_aB2] = biquadC[biq_aB0]; + biquadC[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadC[biq_bB2] = (1.0 - K / biquadC[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadD[biq_freq]); + norm = 1.0 / (1.0 + K / biquadD[biq_reso] + K * K); + biquadD[biq_aB0] = K * K * norm; + biquadD[biq_aB1] = 2.0 * biquadD[biq_aB0]; + biquadD[biq_aB2] = biquadD[biq_aB0]; + biquadD[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadD[biq_bB2] = (1.0 - K / biquadD[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadE[biq_freq]); + norm = 1.0 / (1.0 + K / biquadE[biq_reso] + K * K); + biquadE[biq_aB0] = K * K * norm; + biquadE[biq_aB1] = 2.0 * biquadE[biq_aB0]; + biquadE[biq_aB2] = biquadE[biq_aB0]; + biquadE[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadE[biq_bB2] = (1.0 - K / biquadE[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadF[biq_freq]); + norm = 1.0 / (1.0 + K / biquadF[biq_reso] + K * K); + biquadF[biq_aB0] = K * K * norm; + biquadF[biq_aB1] = 2.0 * biquadF[biq_aB0]; + biquadF[biq_aB2] = biquadF[biq_aB0]; + biquadF[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadF[biq_bB2] = (1.0 - K / biquadF[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadG[biq_freq]); + norm = 1.0 / (1.0 + K / biquadG[biq_reso] + K * K); + biquadG[biq_aB0] = K * K * norm; + biquadG[biq_aB1] = 2.0 * biquadG[biq_aB0]; + biquadG[biq_aB2] = biquadG[biq_aB0]; + biquadG[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadG[biq_bB2] = (1.0 - K / biquadG[biq_reso] + K * K) * norm; + + bool bypass = (GetParameter( kParam_One ) == 1.0); + highA = highB; + highB = GetParameter( kParam_Three )*reso; + if (highB > 0.0) bypass = false; + lowA = lowB; + lowB = GetParameter( kParam_Four )*reso; + if (lowB < 1.0) bypass = false; + + while (nSampleFrames-- > 0) { + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + + double temp = (double)nSampleFrames/inFramesToProcess; + + biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); + biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); + biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); + biquadA[biq_b1] = (biquadA[biq_bA1]*temp)+(biquadA[biq_bB1]*(1.0-temp)); + biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); + + biquadB[biq_a0] = (biquadB[biq_aA0]*temp)+(biquadB[biq_aB0]*(1.0-temp)); + biquadB[biq_a1] = (biquadB[biq_aA1]*temp)+(biquadB[biq_aB1]*(1.0-temp)); + biquadB[biq_a2] = (biquadB[biq_aA2]*temp)+(biquadB[biq_aB2]*(1.0-temp)); + biquadB[biq_b1] = (biquadB[biq_bA1]*temp)+(biquadB[biq_bB1]*(1.0-temp)); + biquadB[biq_b2] = (biquadB[biq_bA2]*temp)+(biquadB[biq_bB2]*(1.0-temp)); + + biquadC[biq_a0] = (biquadC[biq_aA0]*temp)+(biquadC[biq_aB0]*(1.0-temp)); + biquadC[biq_a1] = (biquadC[biq_aA1]*temp)+(biquadC[biq_aB1]*(1.0-temp)); + biquadC[biq_a2] = (biquadC[biq_aA2]*temp)+(biquadC[biq_aB2]*(1.0-temp)); + biquadC[biq_b1] = (biquadC[biq_bA1]*temp)+(biquadC[biq_bB1]*(1.0-temp)); + biquadC[biq_b2] = (biquadC[biq_bA2]*temp)+(biquadC[biq_bB2]*(1.0-temp)); + + biquadD[biq_a0] = (biquadD[biq_aA0]*temp)+(biquadD[biq_aB0]*(1.0-temp)); + biquadD[biq_a1] = (biquadD[biq_aA1]*temp)+(biquadD[biq_aB1]*(1.0-temp)); + biquadD[biq_a2] = (biquadD[biq_aA2]*temp)+(biquadD[biq_aB2]*(1.0-temp)); + biquadD[biq_b1] = (biquadD[biq_bA1]*temp)+(biquadD[biq_bB1]*(1.0-temp)); + biquadD[biq_b2] = (biquadD[biq_bA2]*temp)+(biquadD[biq_bB2]*(1.0-temp)); + + biquadE[biq_a0] = (biquadE[biq_aA0]*temp)+(biquadE[biq_aB0]*(1.0-temp)); + biquadE[biq_a1] = (biquadE[biq_aA1]*temp)+(biquadE[biq_aB1]*(1.0-temp)); + biquadE[biq_a2] = (biquadE[biq_aA2]*temp)+(biquadE[biq_aB2]*(1.0-temp)); + biquadE[biq_b1] = (biquadE[biq_bA1]*temp)+(biquadE[biq_bB1]*(1.0-temp)); + biquadE[biq_b2] = (biquadE[biq_bA2]*temp)+(biquadE[biq_bB2]*(1.0-temp)); + + biquadF[biq_a0] = (biquadF[biq_aA0]*temp)+(biquadF[biq_aB0]*(1.0-temp)); + biquadF[biq_a1] = (biquadF[biq_aA1]*temp)+(biquadF[biq_aB1]*(1.0-temp)); + biquadF[biq_a2] = (biquadF[biq_aA2]*temp)+(biquadF[biq_aB2]*(1.0-temp)); + biquadF[biq_b1] = (biquadF[biq_bA1]*temp)+(biquadF[biq_bB1]*(1.0-temp)); + biquadF[biq_b2] = (biquadF[biq_bA2]*temp)+(biquadF[biq_bB2]*(1.0-temp)); + + biquadG[biq_a0] = (biquadG[biq_aA0]*temp)+(biquadG[biq_aB0]*(1.0-temp)); + biquadG[biq_a1] = (biquadG[biq_aA1]*temp)+(biquadG[biq_aB1]*(1.0-temp)); + biquadG[biq_a2] = (biquadG[biq_aA2]*temp)+(biquadG[biq_aB2]*(1.0-temp)); + biquadG[biq_b1] = (biquadG[biq_bA1]*temp)+(biquadG[biq_bB1]*(1.0-temp)); + biquadG[biq_b2] = (biquadG[biq_bA2]*temp)+(biquadG[biq_bB2]*(1.0-temp)); + + //this is the interpolation code for the biquad + double high = (highA*temp)+(highB*(1.0-temp)); + double low = (lowA*temp)+(lowB*(1.0-temp)); + + double outSample = (inputSample * biquadA[biq_a0]) + biquadA[biq_sL1]; + biquadA[biq_sL1] = (inputSample * biquadA[biq_a1]) - (outSample * biquadA[biq_b1]) + biquadA[biq_sL2]; + biquadA[biq_sL2] = (inputSample * biquadA[biq_a2]) - (outSample * biquadA[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadB[biq_a0]) + biquadB[biq_sL1]; + biquadB[biq_sL1] = (inputSample * biquadB[biq_a1]) - (outSample * biquadB[biq_b1]) + biquadB[biq_sL2]; + biquadB[biq_sL2] = (inputSample * biquadB[biq_a2]) - (outSample * biquadB[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadC[biq_a0]) + biquadC[biq_sL1]; + biquadC[biq_sL1] = (inputSample * biquadC[biq_a1]) - (outSample * biquadC[biq_b1]) + biquadC[biq_sL2]; + biquadC[biq_sL2] = (inputSample * biquadC[biq_a2]) - (outSample * biquadC[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadD[biq_a0]) + biquadD[biq_sL1]; + biquadD[biq_sL1] = (inputSample * biquadD[biq_a1]) - (outSample * biquadD[biq_b1]) + biquadD[biq_sL2]; + biquadD[biq_sL2] = (inputSample * biquadD[biq_a2]) - (outSample * biquadD[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadE[biq_a0]) + biquadE[biq_sL1]; + biquadE[biq_sL1] = (inputSample * biquadE[biq_a1]) - (outSample * biquadE[biq_b1]) + biquadE[biq_sL2]; + biquadE[biq_sL2] = (inputSample * biquadE[biq_a2]) - (outSample * biquadE[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadF[biq_a0]) + biquadF[biq_sL1]; + biquadF[biq_sL1] = (inputSample * biquadF[biq_a1]) - (outSample * biquadF[biq_b1]) + biquadF[biq_sL2]; + biquadF[biq_sL2] = (inputSample * biquadF[biq_a2]) - (outSample * biquadF[biq_b2]); + inputSample = outSample; + + outSample = (inputSample * biquadG[biq_a0]) + biquadG[biq_sL1]; + biquadG[biq_sL1] = (inputSample * biquadG[biq_a1]) - (outSample * biquadG[biq_b1]) + biquadG[biq_sL2]; + biquadG[biq_sL2] = (inputSample * biquadG[biq_a2]) - (outSample * biquadG[biq_b2]); + inputSample = outSample; + + if (bypass) inputSample = drySample; + else inputSample = (inputSample * low) + ((drySample - inputSample)*high); + + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + + *destP = inputSample; + + sourceP += inNumChannels; destP += inNumChannels; + } +} + diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.exp b/plugins/MacSignedAU/Isolator2/Isolator2.exp new file mode 100644 index 000000000..b7b4017f9 --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.exp @@ -0,0 +1 @@ +_Isolator2Entry diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.h b/plugins/MacSignedAU/Isolator2/Isolator2.h new file mode 100644 index 000000000..10b18d581 --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.h @@ -0,0 +1,179 @@ +/* +* File: Isolator2.h +* +* Version: 1.0 +* +* Created: 2/21/22 +* +* Copyright: Copyright © 2022 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#include "AUEffectBase.h" +#include "Isolator2Version.h" + +#if AU_DEBUG_DISPATCHER + #include "AUDebugDispatcher.h" +#endif + + +#ifndef __Isolator2_h__ +#define __Isolator2_h__ + + +#pragma mark ____Isolator2 Parameters + +// parameters +static const float kDefaultValue_ParamOne = 1.0; +static const float kDefaultValue_ParamTwo = 0.0; +static const float kDefaultValue_ParamThree = 0.0; +static const float kDefaultValue_ParamFour = 1.0; + +static CFStringRef kParameterOneName = CFSTR("Freq"); +static CFStringRef kParameterTwoName = CFSTR("Reso"); +static CFStringRef kParameterThreeName = CFSTR("High"); +static CFStringRef kParameterFourName = CFSTR("Low"); +//Alter the name if desired, but using the plugin name is a start + +enum { + kParam_One =0, + kParam_Two =1, + kParam_Three =2, + kParam_Four =3, + //Add your parameters here... + kNumberOfParameters=4 +}; + +#pragma mark ____Isolator2 +class Isolator2 : public AUEffectBase +{ +public: + Isolator2(AudioUnit component); +#if AU_DEBUG_DISPATCHER + virtual ~Isolator2 () { delete mDebugDispatcher; } +#endif + + virtual AUKernelBase * NewKernel() { return new Isolator2Kernel(this); } + + virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + CFArrayRef * outStrings); + + virtual ComponentResult GetParameterInfo(AudioUnitScope inScope, + AudioUnitParameterID inParameterID, + AudioUnitParameterInfo &outParameterInfo); + + virtual ComponentResult GetPropertyInfo(AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + UInt32 & outDataSize, + Boolean & outWritable ); + + virtual ComponentResult GetProperty(AudioUnitPropertyID inID, + AudioUnitScope inScope, + AudioUnitElement inElement, + void * outData); + + virtual ComponentResult Initialize(); + virtual bool SupportsTail () { return true; } + virtual Float64 GetTailTime() {return (1.0/GetSampleRate())*0.0;} //in SECONDS! gsr * a number = in samples + virtual Float64 GetLatency() {return (1.0/GetSampleRate())*0.0;} // in SECONDS! gsr * a number = in samples + + /*! @method Version */ + virtual ComponentResult Version() { return kIsolator2Version; } + + + +protected: + class Isolator2Kernel : public AUKernelBase // most of the real work happens here + { +public: + Isolator2Kernel(AUEffectBase *inAudioUnit ) + : AUKernelBase(inAudioUnit) + { + } + + // *Required* overides for the process method for this effect + // processes one channel of interleaved samples + virtual void Process( const Float32 *inSourceP, + Float32 *inDestP, + UInt32 inFramesToProcess, + UInt32 inNumChannels, + bool &ioSilence); + + virtual void Reset(); + + private: + enum { + biq_freq, + biq_reso, + biq_a0, + biq_a1, + biq_a2, + biq_b1, + biq_b2, + biq_aA0, + biq_aA1, + biq_aA2, + biq_bA1, + biq_bA2, + biq_aB0, + biq_aB1, + biq_aB2, + biq_bB1, + biq_bB2, + biq_sL1, + biq_sL2, + biq_sR1, + biq_sR2, + biq_total + }; //coefficient interpolating biquad filter, stereo + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double biquadE[biq_total]; + double biquadF[biq_total]; + double biquadG[biq_total]; + double highA; + double highB; + double lowA; + double lowB; + uint32_t fpd; + }; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +#endif \ No newline at end of file diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.r b/plugins/MacSignedAU/Isolator2/Isolator2.r new file mode 100644 index 000000000..f1c01dc6e --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.r @@ -0,0 +1,61 @@ +/* +* File: Isolator2.r +* +* Version: 1.0 +* +* Created: 2/21/22 +* +* Copyright: Copyright © 2022 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#include + +#include "Isolator2Version.h" + +// Note that resource IDs must be spaced 2 apart for the 'STR ' name and description +#define kAudioUnitResID_Isolator2 1000 + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Isolator2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#define RES_ID kAudioUnitResID_Isolator2 +#define COMP_TYPE kAudioUnitType_Effect +#define COMP_SUBTYPE Isolator2_COMP_SUBTYPE +#define COMP_MANUF Isolator2_COMP_MANF + +#define VERSION kIsolator2Version +#define NAME "Airwindows: Isolator2" +#define DESCRIPTION "Isolator2 AU" +#define ENTRY_POINT "Isolator2Entry" + +#include "AUResources.r" \ No newline at end of file diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.mode1v3 b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.mode1v3 new file mode 100644 index 000000000..f301be9a2 --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.mode1v3 @@ -0,0 +1,1358 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 8BD3CCBC148831C90062E48C + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + build + debugger-enable-breakpoints + get-info + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 8BA05AEB0720742700365D66 + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 20 + 19 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 203 321 788 504 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 269}} + RubberWindowFrame + 203 321 788 504 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 269pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 274}, {580, 189}} + RubberWindowFrame + 203 321 788 504 0 0 1440 878 + + Module + XCDetailModule + Proportion + 189pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 8B563EC9161B5E170067FE32 + 1CE0B1FE06471DED0097A5F4 + 8B563ECA161B5E170067FE32 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 8BD3CCBD148831C90062E48C + /Developer/Library/Xcode/Project Templates/System Plug-in/Audio Unit Effect/Audio Unit Effect/StarterAU.xcodeproj + + WindowString + 203 321 788 504 0 0 1440 878 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 668 222 500 500 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 668 222 500 500 0 0 1440 878 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 8BD3CCBD148831C90062E48C + 8B563ECB161B5E170067FE32 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 668 222 500 500 0 0 1440 878 + WindowToolGUID + 8BD3CCBD148831C90062E48C + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser new file mode 100644 index 000000000..28c8440ae --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser @@ -0,0 +1,131 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Isolator2 */; + codeSenseManager = 8BD3CCB9148830B20062E48C /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 352, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 252, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 667177157; + PBXWorkspaceStateSaveDate = 667177157; + }; + perUserProjectItems = { + 8B4AFBE727C459AE00664C18 /* PlistBookmark */ = 8B4AFBE727C459AE00664C18 /* PlistBookmark */; + 8B4AFBE827C459AE00664C18 /* PBXBookmark */ = 8B4AFBE827C459AE00664C18 /* PBXBookmark */; + 8B4AFBE927C459AE00664C18 /* PBXTextBookmark */ = 8B4AFBE927C459AE00664C18 /* PBXTextBookmark */; + }; + sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */; + userBuildSettings = { + }; + }; + 8B4AFBE727C459AE00664C18 /* PlistBookmark */ = { + isa = PlistBookmark; + fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */; + fallbackIsa = PBXBookmark; + isK = 0; + kPath = ( + CFBundleName, + ); + name = /Users/christopherjohnson/Desktop/airwindows/plugins/MacAU/Isolator2/Info.plist; + rLen = 0; + rLoc = 9223372036854775807; + }; + 8B4AFBE827C459AE00664C18 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = 8BA05A660720730100365D66 /* Isolator2.cpp */; + }; + 8B4AFBE927C459AE00664C18 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8BA05A660720730100365D66 /* Isolator2.cpp */; + name = "Isolator2.cpp: 130"; + rLen = 0; + rLoc = 6218; + rType = 0; + vrLen = 188; + vrLoc = 6122; + }; + 8BA05A660720730100365D66 /* Isolator2.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {822, 8082}}"; + sepNavSelRange = "{6218, 0}"; + sepNavVisRange = "{6122, 188}"; + sepNavWindowFrame = "{{259, 165}, {1163, 694}}"; + }; + }; + 8BA05A690720730100365D66 /* Isolator2Version.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1056, 1062}}"; + sepNavSelRange = "{2894, 0}"; + sepNavVisRange = "{1643, 1314}"; + sepNavWindowFrame = "{{301, 107}, {1023, 694}}"; + }; + }; + 8BC6025B073B072D006C4272 /* Isolator2.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1146, 3222}}"; + sepNavSelRange = "{6009, 0}"; + sepNavVisRange = "{5419, 541}"; + sepNavWindowFrame = "{{653, 180}, {773, 690}}"; + }; + }; + 8BD3CCB8148830B20062E48C /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 8BD3CCB9148830B20062E48C /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D01CCC60486CAD60068D4B7 /* Isolator2 */ = { + activeExec = 0; + }; +} diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 new file mode 100644 index 000000000..f3a08a953 --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 @@ -0,0 +1,1506 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + AIODescriptionKey + DockingSystemVisible + + Extension + perspectivev3 + FavBarConfig + + PBXProjectModuleGUID + 8BD7274F1D46E5A5000176F0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.defaultV3 + MajorVersion + 34 + MinorVersion + 0 + Name + All-In-One + Notifications + + + XCObserverAutoDisconnectKey + + XCObserverDefintionKey + + PBXStatusErrorsKey + 0 + + XCObserverFactoryKey + XCPerspectivesSpecificationIdentifier + XCObserverGUIDKey + XCObserverProjectIdentifier + XCObserverNotificationKey + PBXStatusBuildStateMessageNotification + XCObserverTargetKey + XCMainBuildResultsModuleGUID + XCObserverTriggerKey + awakenModuleWithObserver: + XCObserverValidationKey + + PBXStatusErrorsKey + 2 + + + + OpenEditors + + PerspectiveWidths + + 901 + 901 + + Perspectives + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CA23ED40692098700951B8B + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 288 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 8BA05A56072072A900365D66 + 089C167CFE841241C02AAC07 + 1C37FBAC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 4 + 2 + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {288, 468}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {305, 486}} + GroupTreeTableConfiguration + + MainColumn + 288 + + RubberWindowFrame + 498 304 901 527 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 305pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 8BD7274A1D46E5A5000176F0 + PBXProjectModuleLabel + Isolator2.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 8BD7274B1D46E5A5000176F0 + PBXProjectModuleLabel + Isolator2.cpp + _historyCapacity + 0 + bookmark + 8B4AFBE927C459AE00664C18 + history + + 8B4AFBE727C459AE00664C18 + 8B4AFBE827C459AE00664C18 + + + SplitCount + 1 + + StatusBarVisibility + + XCSharingToken + com.apple.Xcode.CommonNavigatorGroupSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {591, 102}} + RubberWindowFrame + 498 304 901 527 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 102pt + + + Proportion + 379pt + Tabs + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EDF0692099D00951B8B + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{10, 27}, {591, 352}} + RubberWindowFrame + 498 304 901 527 0 0 1440 878 + + Module + XCDetailModule + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EE00692099D00951B8B + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXProjectFindModule + + + ContentConfiguration + + PBXCVSModuleFilterTypeKey + 1032 + PBXProjectModuleGUID + 1CA23EE10692099D00951B8B + PBXProjectModuleLabel + SCM Results + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXCVSModule + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1023 + XCBuildResultsTrigger_Open + 1012 + + GeometryConfiguration + + Frame + {{10, 27}, {591, 336}} + + Module + PBXBuildResultsModule + + + + + Proportion + 591pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDockableTabModule + XCDetailModule + PBXProjectFindModule + PBXCVSModule + PBXBuildResultsModule + + TableOfContents + + 8B4AFBEA27C459AE00664C18 + 1CA23ED40692098700951B8B + 8B4AFBEB27C459AE00664C18 + 8BD7274A1D46E5A5000176F0 + 8B4AFBEC27C459AE00664C18 + 1CA23EDF0692099D00951B8B + 1CA23EE00692099D00951B8B + 1CA23EE10692099D00951B8B + XCMainBuildResultsModuleGUID + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + debugger-restart-executable + debugger-pause + debugger-step-over + debugger-step-into + debugger-step-out + NSToolbarFlexibleSpaceItem + servicesModulebreakpoints + debugger-show-console-window + + ControllerClassBaseName + PBXDebugSessionModule + IconName + DebugTabIcon + Identifier + perspective.debug + IsVertical + + Layout + + + ContentConfiguration + + PBXProjectModuleGUID + 1CCC7628064C1048000F2A68 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {810, 0}} + + Module + PBXDebugCLIModule + Proportion + 0pt + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {395, 214}} + {{395, 0}, {415, 214}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {810, 214}} + {{0, 214}, {810, 227}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1CCC7629064C1048000F2A68 + PBXProjectModuleLabel + Debug + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 5}, {810, 441}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 120 + Value + 85 + Summary + 185 + + Frame + {{395, 0}, {415, 214}} + + + Module + PBXDebugSessionModule + Proportion + 441pt + + + Name + Debug + ServiceClasses + + XCModuleDock + PBXDebugCLIModule + PBXDebugSessionModule + PBXDebugProcessAndThreadModule + PBXDebugProcessViewModule + PBXDebugThreadViewModule + PBXDebugStackFrameViewModule + PBXNavigatorGroup + + TableOfContents + + 8BD727EC1D46ECF1000176F0 + 1CCC7628064C1048000F2A68 + 1CCC7629064C1048000F2A68 + 8BD727ED1D46ECF1000176F0 + 8BD727EE1D46ECF1000176F0 + 8BD727EF1D46ECF1000176F0 + 8BD727F01D46ECF1000176F0 + 8BD727E71D46ECD9000176F0 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.debugV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' + StatusbarIsVisible + + TimeStamp + 667179438.30029094 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + + WindowJustification + 5 + WindowOrderList + + /Users/christopherjohnson/Desktop/airwindows/plugins/MacAU/Isolator2/Isolator2.xcodeproj + + WindowString + 498 304 901 527 0 0 1440 878 + WindowToolsV3 + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.build + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {500, 215}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + + GeometryConfiguration + + Frame + {{0, 222}, {500, 236}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 458pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 192 257 500 500 0 0 1280 1002 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {700, 358}} + RubberWindowFrame + 149 87 700 400 0 0 1440 878 + + Module + PBXDebugCLIModule + Proportion + 358pt + + + Proportion + 358pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D5B069F1CE1000CFCEE + 1C530D5C069F1CE1000CFCEE + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 149 87 440 400 0 0 1440 878 + WindowToolGUID + 1C530D5B069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.09500122070312 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scmV3 + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 166pt + + + Proportion + 166pt + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {369, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {616, 353}} + MembersFrame + {{0, 105}, {369, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 94 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 597 125 616 374 0 0 1280 1002 + + Module + PBXClassBrowserModule + Proportion + 354pt + + + Proportion + 354pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C78EABA065D492600B07095 + 1C78EABB065D492600B07095 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 597 125 616 374 0 0 1280 1002 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/project.pbxproj b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/project.pbxproj new file mode 100644 index 000000000..f33e7a88e --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 3EEA126E089847F5002C6BFC /* CAVectorUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */; }; + 3EEA126F089847F5002C6BFC /* CAVectorUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */; }; + 3EEA1270089847F5002C6BFC /* CAVectorUnitTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */; }; + 8B4119B70749654200361ABE /* Isolator2.r in Rez */ = {isa = PBXBuildFile; fileRef = 8BA05A680720730100365D66 /* Isolator2.r */; }; + 8BA05A6B0720730100365D66 /* Isolator2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A660720730100365D66 /* Isolator2.cpp */; }; + 8BA05A6E0720730100365D66 /* Isolator2Version.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A690720730100365D66 /* Isolator2Version.h */; }; + 8BA05AAE072073D300365D66 /* AUBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A7F072073D200365D66 /* AUBase.cpp */; }; + 8BA05AAF072073D300365D66 /* AUBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A80072073D200365D66 /* AUBase.h */; }; + 8BA05AB0072073D300365D66 /* AUDispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A81072073D200365D66 /* AUDispatch.cpp */; }; + 8BA05AB1072073D300365D66 /* AUDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A82072073D200365D66 /* AUDispatch.h */; }; + 8BA05AB2072073D300365D66 /* AUInputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A83072073D200365D66 /* AUInputElement.cpp */; }; + 8BA05AB3072073D300365D66 /* AUInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A84072073D200365D66 /* AUInputElement.h */; }; + 8BA05AB4072073D300365D66 /* AUOutputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A85072073D200365D66 /* AUOutputElement.cpp */; }; + 8BA05AB5072073D300365D66 /* AUOutputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A86072073D200365D66 /* AUOutputElement.h */; }; + 8BA05AB7072073D300365D66 /* AUScopeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A88072073D200365D66 /* AUScopeElement.cpp */; }; + 8BA05AB8072073D300365D66 /* AUScopeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A89072073D200365D66 /* AUScopeElement.h */; }; + 8BA05AB9072073D300365D66 /* ComponentBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A8A072073D200365D66 /* ComponentBase.cpp */; }; + 8BA05ABA072073D300365D66 /* ComponentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A8B072073D200365D66 /* ComponentBase.h */; }; + 8BA05AC6072073D300365D66 /* AUEffectBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */; }; + 8BA05AC7072073D300365D66 /* AUEffectBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05A9B072073D200365D66 /* AUEffectBase.h */; }; + 8BA05AD2072073D300365D66 /* AUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AA7072073D200365D66 /* AUBuffer.cpp */; }; + 8BA05AD3072073D300365D66 /* AUBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AA8072073D200365D66 /* AUBuffer.h */; }; + 8BA05AD4072073D300365D66 /* AUDebugDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */; }; + 8BA05AD5072073D300365D66 /* AUDebugDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */; }; + 8BA05AD6072073D300365D66 /* AUInputFormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */; }; + 8BA05AD7072073D300365D66 /* AUSilentTimeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */; }; + 8BA05AD8072073D300365D66 /* AUTimestampGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */; }; + 8BA05AE50720742100365D66 /* CAAudioChannelLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */; }; + 8BA05AE60720742100365D66 /* CAAudioChannelLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */; }; + 8BA05AE70720742100365D66 /* CAMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AE10720742100365D66 /* CAMutex.cpp */; }; + 8BA05AE80720742100365D66 /* CAMutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE20720742100365D66 /* CAMutex.h */; }; + 8BA05AE90720742100365D66 /* CAStreamBasicDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */; }; + 8BA05AEA0720742100365D66 /* CAStreamBasicDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */; }; + 8BA05AFC072074E100365D66 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05AF9072074E100365D66 /* AudioToolbox.framework */; }; + 8BA05AFD072074E100365D66 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05AFA072074E100365D66 /* AudioUnit.framework */; }; + 8BA05B02072074F900365D66 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BA05B01072074F900365D66 /* CoreServices.framework */; }; + 8BA05B070720754400365D66 /* CAAUParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8BA05B050720754400365D66 /* CAAUParameter.cpp */; }; + 8BA05B080720754400365D66 /* CAAUParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BA05B060720754400365D66 /* CAAUParameter.h */; }; + 8BC6025C073B072D006C4272 /* Isolator2.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BC6025B073B072D006C4272 /* Isolator2.h */; }; + 8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; + F7C347F00ECE5AF8008ADFB6 /* AUBaseHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */; }; + F7C347F10ECE5AF8008ADFB6 /* AUBaseHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAVectorUnit.cpp; sourceTree = ""; }; + 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAVectorUnit.h; sourceTree = ""; }; + 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAVectorUnitTypes.h; sourceTree = ""; }; + 8B5C7FBF076FB2C200A15F61 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; + 8BA05A660720730100365D66 /* Isolator2.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Isolator2.cpp; sourceTree = ""; }; + 8BA05A670720730100365D66 /* Isolator2.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = Isolator2.exp; sourceTree = ""; }; + 8BA05A680720730100365D66 /* Isolator2.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = Isolator2.r; sourceTree = ""; }; + 8BA05A690720730100365D66 /* Isolator2Version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Isolator2Version.h; sourceTree = ""; }; + 8BA05A7F072073D200365D66 /* AUBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUBase.cpp; sourceTree = ""; }; + 8BA05A80072073D200365D66 /* AUBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUBase.h; sourceTree = ""; }; + 8BA05A81072073D200365D66 /* AUDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUDispatch.cpp; sourceTree = ""; }; + 8BA05A82072073D200365D66 /* AUDispatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUDispatch.h; sourceTree = ""; }; + 8BA05A83072073D200365D66 /* AUInputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUInputElement.cpp; sourceTree = ""; }; + 8BA05A84072073D200365D66 /* AUInputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUInputElement.h; sourceTree = ""; }; + 8BA05A85072073D200365D66 /* AUOutputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUOutputElement.cpp; sourceTree = ""; }; + 8BA05A86072073D200365D66 /* AUOutputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUOutputElement.h; sourceTree = ""; }; + 8BA05A87072073D200365D66 /* AUResources.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = AUResources.r; sourceTree = ""; }; + 8BA05A88072073D200365D66 /* AUScopeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUScopeElement.cpp; sourceTree = ""; }; + 8BA05A89072073D200365D66 /* AUScopeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUScopeElement.h; sourceTree = ""; }; + 8BA05A8A072073D200365D66 /* ComponentBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ComponentBase.cpp; sourceTree = ""; }; + 8BA05A8B072073D200365D66 /* ComponentBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ComponentBase.h; sourceTree = ""; }; + 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUEffectBase.cpp; sourceTree = ""; }; + 8BA05A9B072073D200365D66 /* AUEffectBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUEffectBase.h; sourceTree = ""; }; + 8BA05AA7072073D200365D66 /* AUBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUBuffer.cpp; sourceTree = ""; }; + 8BA05AA8072073D200365D66 /* AUBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUBuffer.h; sourceTree = ""; }; + 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AUDebugDispatcher.cpp; sourceTree = ""; }; + 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUDebugDispatcher.h; sourceTree = ""; }; + 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUInputFormatConverter.h; sourceTree = ""; }; + 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUSilentTimeout.h; sourceTree = ""; }; + 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AUTimestampGenerator.h; sourceTree = ""; }; + 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAAudioChannelLayout.cpp; sourceTree = ""; }; + 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAAudioChannelLayout.h; sourceTree = ""; }; + 8BA05AE10720742100365D66 /* CAMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAMutex.cpp; sourceTree = ""; }; + 8BA05AE20720742100365D66 /* CAMutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAMutex.h; sourceTree = ""; }; + 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAStreamBasicDescription.cpp; sourceTree = ""; }; + 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAStreamBasicDescription.h; sourceTree = ""; }; + 8BA05AF9072074E100365D66 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; + 8BA05AFA072074E100365D66 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; + 8BA05B01072074F900365D66 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; + 8BA05B050720754400365D66 /* CAAUParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAAUParameter.cpp; sourceTree = ""; }; + 8BA05B060720754400365D66 /* CAAUParameter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAAUParameter.h; sourceTree = ""; }; + 8BC6025B073B072D006C4272 /* Isolator2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Isolator2.h; sourceTree = ""; }; + 8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* Isolator2.component */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Isolator2.component; sourceTree = BUILT_PRODUCTS_DIR; }; + F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBaseHelper.cpp; path = Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; }; + F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBaseHelper.h; path = Extras/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h; sourceTree = SYSTEM_DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05AFC072074E100365D66 /* AudioToolbox.framework in Frameworks */, + 8BA05AFD072074E100365D66 /* AudioUnit.framework in Frameworks */, + 8BA05B02072074F900365D66 /* CoreServices.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* Isolator2 */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = Isolator2; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 8B5C7FBF076FB2C200A15F61 /* CoreAudio.framework */, + 8BA05B01072074F900365D66 /* CoreServices.framework */, + 8BA05AF9072074E100365D66 /* AudioToolbox.framework */, + 8BA05AFA072074E100365D66 /* AudioUnit.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D01CCD10486CAD60068D4B7 /* Info.plist */, + 089C167DFE841241C02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 8BA05A56072072A900365D66 /* AU Source */, + 8BA05AEB0720742700365D66 /* PublicUtility */, + 8BA05A7D072073D200365D66 /* AUPublic */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* Isolator2.component */, + ); + name = Products; + sourceTree = ""; + }; + 8BA05A56072072A900365D66 /* AU Source */ = { + isa = PBXGroup; + children = ( + 8BC6025B073B072D006C4272 /* Isolator2.h */, + 8BA05A660720730100365D66 /* Isolator2.cpp */, + 8BA05A670720730100365D66 /* Isolator2.exp */, + 8BA05A680720730100365D66 /* Isolator2.r */, + 8BA05A690720730100365D66 /* Isolator2Version.h */, + ); + name = "AU Source"; + sourceTree = ""; + }; + 8BA05A7D072073D200365D66 /* AUPublic */ = { + isa = PBXGroup; + children = ( + 8BA05A7E072073D200365D66 /* AUBase */, + 8BA05A99072073D200365D66 /* OtherBases */, + 8BA05AA6072073D200365D66 /* Utility */, + ); + name = AUPublic; + path = Extras/CoreAudio/AudioUnits/AUPublic; + sourceTree = SYSTEM_DEVELOPER_DIR; + }; + 8BA05A7E072073D200365D66 /* AUBase */ = { + isa = PBXGroup; + children = ( + 8BA05A7F072073D200365D66 /* AUBase.cpp */, + 8BA05A80072073D200365D66 /* AUBase.h */, + 8BA05A81072073D200365D66 /* AUDispatch.cpp */, + 8BA05A82072073D200365D66 /* AUDispatch.h */, + 8BA05A83072073D200365D66 /* AUInputElement.cpp */, + 8BA05A84072073D200365D66 /* AUInputElement.h */, + 8BA05A85072073D200365D66 /* AUOutputElement.cpp */, + 8BA05A86072073D200365D66 /* AUOutputElement.h */, + 8BA05A87072073D200365D66 /* AUResources.r */, + 8BA05A88072073D200365D66 /* AUScopeElement.cpp */, + 8BA05A89072073D200365D66 /* AUScopeElement.h */, + 8BA05A8A072073D200365D66 /* ComponentBase.cpp */, + 8BA05A8B072073D200365D66 /* ComponentBase.h */, + ); + path = AUBase; + sourceTree = ""; + }; + 8BA05A99072073D200365D66 /* OtherBases */ = { + isa = PBXGroup; + children = ( + 8BA05A9A072073D200365D66 /* AUEffectBase.cpp */, + 8BA05A9B072073D200365D66 /* AUEffectBase.h */, + ); + path = OtherBases; + sourceTree = ""; + }; + 8BA05AA6072073D200365D66 /* Utility */ = { + isa = PBXGroup; + children = ( + F7C347EE0ECE5AF8008ADFB6 /* AUBaseHelper.cpp */, + F7C347EF0ECE5AF8008ADFB6 /* AUBaseHelper.h */, + 8BA05AA7072073D200365D66 /* AUBuffer.cpp */, + 8BA05AA8072073D200365D66 /* AUBuffer.h */, + 8BA05AA9072073D200365D66 /* AUDebugDispatcher.cpp */, + 8BA05AAA072073D200365D66 /* AUDebugDispatcher.h */, + 8BA05AAB072073D200365D66 /* AUInputFormatConverter.h */, + 8BA05AAC072073D200365D66 /* AUSilentTimeout.h */, + 8BA05AAD072073D200365D66 /* AUTimestampGenerator.h */, + ); + path = Utility; + sourceTree = ""; + }; + 8BA05AEB0720742700365D66 /* PublicUtility */ = { + isa = PBXGroup; + children = ( + 8BA05B050720754400365D66 /* CAAUParameter.cpp */, + 8BA05B060720754400365D66 /* CAAUParameter.h */, + 8BA05ADF0720742100365D66 /* CAAudioChannelLayout.cpp */, + 8BA05AE00720742100365D66 /* CAAudioChannelLayout.h */, + 8BA05AE10720742100365D66 /* CAMutex.cpp */, + 8BA05AE20720742100365D66 /* CAMutex.h */, + 8BA05AE30720742100365D66 /* CAStreamBasicDescription.cpp */, + 8BA05AE40720742100365D66 /* CAStreamBasicDescription.h */, + 3EEA126D089847F5002C6BFC /* CAVectorUnitTypes.h */, + 3EEA126B089847F5002C6BFC /* CAVectorUnit.cpp */, + 3EEA126C089847F5002C6BFC /* CAVectorUnit.h */, + ); + name = PublicUtility; + path = Extras/CoreAudio/PublicUtility; + sourceTree = SYSTEM_DEVELOPER_DIR; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05A6E0720730100365D66 /* Isolator2Version.h in Headers */, + 8BA05AAF072073D300365D66 /* AUBase.h in Headers */, + 8BA05AB1072073D300365D66 /* AUDispatch.h in Headers */, + 8BA05AB3072073D300365D66 /* AUInputElement.h in Headers */, + 8BA05AB5072073D300365D66 /* AUOutputElement.h in Headers */, + 8BA05AB8072073D300365D66 /* AUScopeElement.h in Headers */, + 8BA05ABA072073D300365D66 /* ComponentBase.h in Headers */, + 8BA05AC7072073D300365D66 /* AUEffectBase.h in Headers */, + 8BA05AD3072073D300365D66 /* AUBuffer.h in Headers */, + 8BA05AD5072073D300365D66 /* AUDebugDispatcher.h in Headers */, + 8BA05AD6072073D300365D66 /* AUInputFormatConverter.h in Headers */, + 8BA05AD7072073D300365D66 /* AUSilentTimeout.h in Headers */, + 8BA05AD8072073D300365D66 /* AUTimestampGenerator.h in Headers */, + 8BA05AE60720742100365D66 /* CAAudioChannelLayout.h in Headers */, + 8BA05AE80720742100365D66 /* CAMutex.h in Headers */, + 8BA05AEA0720742100365D66 /* CAStreamBasicDescription.h in Headers */, + 8BA05B080720754400365D66 /* CAAUParameter.h in Headers */, + 8BC6025C073B072D006C4272 /* Isolator2.h in Headers */, + 3EEA126F089847F5002C6BFC /* CAVectorUnit.h in Headers */, + 3EEA1270089847F5002C6BFC /* CAVectorUnitTypes.h in Headers */, + F7C347F10ECE5AF8008ADFB6 /* AUBaseHelper.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* Isolator2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3E4BA243089833B7007656EC /* Build configuration list for PBXNativeTarget "Isolator2" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Isolator2; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = Isolator2; + productReference = 8D01CCD20486CAD60068D4B7 /* Isolator2.component */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 3E4BA247089833B7007656EC /* Build configuration list for PBXProject "Isolator2" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 089C166AFE841209C02AAC07 /* Isolator2 */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* Isolator2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + 8B4119B70749654200361ABE /* Isolator2.r in Rez */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BA05A6B0720730100365D66 /* Isolator2.cpp in Sources */, + 8BA05AAE072073D300365D66 /* AUBase.cpp in Sources */, + 8BA05AB0072073D300365D66 /* AUDispatch.cpp in Sources */, + 8BA05AB2072073D300365D66 /* AUInputElement.cpp in Sources */, + 8BA05AB4072073D300365D66 /* AUOutputElement.cpp in Sources */, + 8BA05AB7072073D300365D66 /* AUScopeElement.cpp in Sources */, + 8BA05AB9072073D300365D66 /* ComponentBase.cpp in Sources */, + 8BA05AC6072073D300365D66 /* AUEffectBase.cpp in Sources */, + 8BA05AD2072073D300365D66 /* AUBuffer.cpp in Sources */, + 8BA05AD4072073D300365D66 /* AUDebugDispatcher.cpp in Sources */, + 8BA05AE50720742100365D66 /* CAAudioChannelLayout.cpp in Sources */, + 8BA05AE70720742100365D66 /* CAMutex.cpp in Sources */, + 8BA05AE90720742100365D66 /* CAStreamBasicDescription.cpp in Sources */, + 8BA05B070720754400365D66 /* CAAUParameter.cpp in Sources */, + 3EEA126E089847F5002C6BFC /* CAVectorUnit.cpp in Sources */, + F7C347F00ECE5AF8008ADFB6 /* AUBaseHelper.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C167EFE841241C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3E4BA244089833B7007656EC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXPORTED_SYMBOLS_FILE = Isolator2.exp; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GENERATE_PKGINFO_FILE = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Audio/Plug-Ins/Components/"; + LIBRARY_STYLE = Bundle; + OTHER_LDFLAGS = "-bundle"; + OTHER_REZFLAGS = "-d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64 -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers -I \"$(DEVELOPER_DIR)/Examples/CoreAudio/AudioUnits/AUPublic/AUBase\""; + PRODUCT_NAME = Isolator2; + WRAPPER_EXTENSION = component; + }; + name = Debug; + }; + 3E4BA245089833B7007656EC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + x86_64, + ); + EXPORTED_SYMBOLS_FILE = Isolator2.exp; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GENERATE_PKGINFO_FILE = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Audio/Plug-Ins/Components/"; + LIBRARY_STYLE = Bundle; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_LDFLAGS = "-bundle"; + OTHER_REZFLAGS = "-d ppc_$ppc -d i386_$i386 -d x86_64_$x86_64 -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers -I \"$(DEVELOPER_DIR)/Examples/CoreAudio/AudioUnits/AUPublic/AUBase\""; + PRODUCT_NAME = Isolator2; + SDKROOT = macosx10.5; + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WRAPPER_EXTENSION = component; + }; + name = Release; + }; + 3E4BA248089833B7007656EC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + SDKROOT = macosx10.6; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Debug; + }; + 3E4BA249089833B7007656EC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + SDKROOT = macosx10.6; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3E4BA243089833B7007656EC /* Build configuration list for PBXNativeTarget "Isolator2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E4BA244089833B7007656EC /* Debug */, + 3E4BA245089833B7007656EC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 3E4BA247089833B7007656EC /* Build configuration list for PBXProject "Isolator2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E4BA248089833B7007656EC /* Debug */, + 3E4BA249089833B7007656EC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/plugins/MacSignedAU/Isolator2/Isolator2Version.h b/plugins/MacSignedAU/Isolator2/Isolator2Version.h new file mode 100644 index 000000000..d97a05a3a --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/Isolator2Version.h @@ -0,0 +1,58 @@ +/* +* File: Isolator2Version.h +* +* Version: 1.0 +* +* Created: 2/21/22 +* +* Copyright: Copyright © 2022 Airwindows, All Rights Reserved +* +* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in +* consideration of your agreement to the following terms, and your use, installation, modification +* or redistribution of this Apple software constitutes acceptance of these terms. If you do +* not agree with these terms, please do not use, install, modify or redistribute this Apple +* software. +* +* In consideration of your agreement to abide by the following terms, and subject to these terms, +* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this +* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the +* Apple Software, with or without modifications, in source and/or binary forms; provided that if you +* redistribute the Apple Software in its entirety and without modifications, you must retain this +* notice and the following text and disclaimers in all such redistributions of the Apple Software. +* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to +* endorse or promote products derived from the Apple Software without specific prior written +* permission from Apple. Except as expressly stated in this notice, no other rights or +* licenses, express or implied, are granted by Apple herein, including but not limited to any +* patent rights that may be infringed by your derivative works or by other works in which the +* Apple Software may be incorporated. +* +* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR +* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE +* OR IN COMBINATION WITH YOUR PRODUCTS. +* +* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, +* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN +* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +#ifndef __Isolator2Version_h__ +#define __Isolator2Version_h__ + + +#ifdef DEBUG + #define kIsolator2Version 0xFFFFFFFF +#else + #define kIsolator2Version 0x00010000 +#endif + +//~~~~~~~~~~~~~~ Change!!! ~~~~~~~~~~~~~~~~~~~~~// +#define Isolator2_COMP_MANF 'Dthr' +#define Isolator2_COMP_SUBTYPE 'isom' +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + +#endif + diff --git a/plugins/MacSignedAU/Isolator2/version.plist b/plugins/MacSignedAU/Isolator2/version.plist new file mode 100644 index 000000000..11edf8a1b --- /dev/null +++ b/plugins/MacSignedAU/Isolator2/version.plist @@ -0,0 +1,16 @@ + + + + + BuildVersion + 3 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + ProjectName + ${EXECUTABLE_NAME} + SourceVersion + 590000 + + diff --git a/plugins/MacSignedAU/Logical4/Logical4.cpp b/plugins/MacSignedAU/Logical4/Logical4.cpp index 202805eb8..3786329f8 100755 --- a/plugins/MacSignedAU/Logical4/Logical4.cpp +++ b/plugins/MacSignedAU/Logical4/Logical4.cpp @@ -268,8 +268,8 @@ ComponentResult Logical4::Reset(AudioUnitScope inScope, AudioUnitElement inElem //end Power Sags - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; return noErr; } @@ -296,11 +296,11 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 drySampleL; Float32 drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; //begin ButterComp Float64 inputpos; @@ -395,44 +395,8 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables like the dry - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1148,7 +1112,7 @@ OSStatus Logical4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Logical4/Logical4.h b/plugins/MacSignedAU/Logical4/Logical4.h index 31b3c1ae2..baa5e4c1d 100755 --- a/plugins/MacSignedAU/Logical4/Logical4.h +++ b/plugins/MacSignedAU/Logical4/Logical4.h @@ -210,8 +210,8 @@ private: int gcount; - long double fpNShapeR; - long double fpNShapeL; + double fpNShapeR; + double fpNShapeL; bool fpFlip; }; diff --git a/plugins/MacSignedAU/Loud/Loud.cpp b/plugins/MacSignedAU/Loud/Loud.cpp index 47b866550..b77514d2b 100755 --- a/plugins/MacSignedAU/Loud/Loud.cpp +++ b/plugins/MacSignedAU/Loud/Loud.cpp @@ -199,13 +199,13 @@ void Loud::LoudKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; Float64 clamp; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= boost; diff --git a/plugins/MacSignedAU/Lowpass/Lowpass.cpp b/plugins/MacSignedAU/Lowpass/Lowpass.cpp index 3ba78574b..1a08ac346 100755 --- a/plugins/MacSignedAU/Lowpass/Lowpass.cpp +++ b/plugins/MacSignedAU/Lowpass/Lowpass.cpp @@ -176,7 +176,7 @@ void Lowpass::LowpassKernel::Reset() { iirSampleA = 0.0; iirSampleB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -216,30 +216,7 @@ void Lowpass::LowpassKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); @@ -260,11 +237,11 @@ void Lowpass::LowpassKernel::Process( const Float32 *inSourceP, if (wet < 1.0) outputSample = (outputSample * wet) + (inputSample * dry); fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = outputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/Lowpass/Lowpass.h b/plugins/MacSignedAU/Lowpass/Lowpass.h index cf12e7542..b07871041 100755 --- a/plugins/MacSignedAU/Lowpass/Lowpass.h +++ b/plugins/MacSignedAU/Lowpass/Lowpass.h @@ -133,7 +133,7 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/Lowpass2/Lowpass2.cpp b/plugins/MacSignedAU/Lowpass2/Lowpass2.cpp index d11f4da13..2bda027e1 100755 --- a/plugins/MacSignedAU/Lowpass2/Lowpass2.cpp +++ b/plugins/MacSignedAU/Lowpass2/Lowpass2.cpp @@ -228,28 +228,10 @@ void Lowpass2::Lowpass2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (tight > 0) offset = (1 - tight) + (fabs(inputSample)*tight); else offset = (1 + tight) + ((1-fabs(inputSample))*tight); diff --git a/plugins/MacSignedAU/Luxor/Luxor.cpp b/plugins/MacSignedAU/Luxor/Luxor.cpp index 8b296f684..cd39f22f5 100755 --- a/plugins/MacSignedAU/Luxor/Luxor.cpp +++ b/plugins/MacSignedAU/Luxor/Luxor.cpp @@ -221,8 +221,8 @@ void Luxor::LuxorKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacSignedAU/MV/MV.cpp b/plugins/MacSignedAU/MV/MV.cpp index 29b5f5f92..3f0df3455 100755 --- a/plugins/MacSignedAU/MV/MV.cpp +++ b/plugins/MacSignedAU/MV/MV.cpp @@ -278,27 +278,9 @@ void MV::MVKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; inputSample += feedback; diff --git a/plugins/MacSignedAU/MackEQ/MackEQ.cpp b/plugins/MacSignedAU/MackEQ/MackEQ.cpp index 86f194fff..6eb96eece 100644 --- a/plugins/MacSignedAU/MackEQ/MackEQ.cpp +++ b/plugins/MacSignedAU/MackEQ/MackEQ.cpp @@ -212,7 +212,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -270,8 +270,8 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, biquadD[6] = (1.0 - K / biquadD[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (fabs(iirSampleA)<1.18e-37) iirSampleA = 0.0; @@ -281,7 +281,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (inTrim != 1.0) inputSample *= inTrim; //begin Mackity input stage - long double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = outSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; @@ -300,8 +300,8 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (fabs(iirSampleC)<1.18e-37) iirSampleC = 0.0; iirSampleC = (iirSampleC * (1.0 - iirBassMid)) + (inputSample * iirBassMid); - long double bassSample = iirSampleC; - long double midSample = inputSample - bassSample; + double bassSample = iirSampleC; + double midSample = inputSample - bassSample; if (gainBass != 1.0) bassSample *= gainBass; if (bassSample > 1.0) bassSample = 1.0; @@ -317,7 +317,7 @@ void MackEQ::MackEQKernel::Process( const Float32 *inSourceP, if (fabs(iirSampleE)<1.18e-37) iirSampleE = 0.0; iirSampleE = (iirSampleE * (1.0 - iirMidHigh)) + (midSample * iirMidHigh); - long double highSample = midSample - iirSampleE; + double highSample = midSample - iirSampleE; midSample = iirSampleE; //here is where we make the high sample out of the mid, and take highs //away from the mid. diff --git a/plugins/MacSignedAU/MackEQ/MackEQ.h b/plugins/MacSignedAU/MackEQ/MackEQ.h index 60480a136..23475e60e 100644 --- a/plugins/MacSignedAU/MackEQ/MackEQ.h +++ b/plugins/MacSignedAU/MackEQ/MackEQ.h @@ -137,16 +137,16 @@ public: private: - long double iirSampleA; - long double iirSampleB; - long double iirSampleC; - long double iirSampleD; - long double iirSampleE; - long double iirSampleF; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Mackity/Mackity.cpp b/plugins/MacSignedAU/Mackity/Mackity.cpp index c3a0f4c5a..a8616f220 100644 --- a/plugins/MacSignedAU/Mackity/Mackity.cpp +++ b/plugins/MacSignedAU/Mackity/Mackity.cpp @@ -184,7 +184,7 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -216,8 +216,8 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (fabs(iirSampleA)<1.18e-37) iirSampleA = 0.0; iirSampleA = (iirSampleA * (1.0 - iirAmountA)) + (inputSample * iirAmountA); @@ -225,7 +225,7 @@ void Mackity::MackityKernel::Process( const Float32 *inSourceP, if (inTrim != 1.0) inputSample *= inTrim; - long double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = outSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 if (inputSample > 1.0) inputSample = 1.0; diff --git a/plugins/MacSignedAU/Mackity/Mackity.h b/plugins/MacSignedAU/Mackity/Mackity.h index 43d72da51..f54f5f027 100644 --- a/plugins/MacSignedAU/Mackity/Mackity.h +++ b/plugins/MacSignedAU/Mackity/Mackity.h @@ -128,10 +128,10 @@ public: virtual void Reset(); private: - long double iirSampleA; - long double iirSampleB; - long double biquadA[11]; - long double biquadB[11]; + double iirSampleA; + double iirSampleB; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/MatrixVerb/MatrixVerb.cpp b/plugins/MacSignedAU/MatrixVerb/MatrixVerb.cpp index 201cd87a1..021b8de92 100755 --- a/plugins/MacSignedAU/MatrixVerb/MatrixVerb.cpp +++ b/plugins/MacSignedAU/MatrixVerb/MatrixVerb.cpp @@ -283,7 +283,7 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -345,8 +345,8 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, //predelay for natural spaces, gets cut back for heavily artificial spaces while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; aM[countM] = inputSample; @@ -354,7 +354,7 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, inputSample = aM[countM]; //predelay - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -363,10 +363,10 @@ void MatrixVerb::MatrixVerbKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; diff --git a/plugins/MacSignedAU/MatrixVerb/MatrixVerb.h b/plugins/MacSignedAU/MatrixVerb/MatrixVerb.h index ec76d2829..d2c7ff0f1 100755 --- a/plugins/MacSignedAU/MatrixVerb/MatrixVerb.h +++ b/plugins/MacSignedAU/MatrixVerb/MatrixVerb.h @@ -142,9 +142,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacSignedAU/Melt/Melt.cpp b/plugins/MacSignedAU/Melt/Melt.cpp index e21c50660..f5d191b17 100755 --- a/plugins/MacSignedAU/Melt/Melt.cpp +++ b/plugins/MacSignedAU/Melt/Melt.cpp @@ -189,7 +189,7 @@ void Melt::MeltKernel::Reset() stepCount = 0; slowCount = 0; gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -242,35 +242,12 @@ void Melt::MeltKernel::Process( const Float32 *inSourceP, minTap[28] = floor(109 * depthA); maxTap[28] = floor(109 * depthB); minTap[29] = floor(113 * depthA); maxTap[29] = floor(113 * depthB); minTap[30] = floor(117 * depthA); maxTap[30] = floor(117 * depthB); - long double drySample; - long double inputSample; + double drySample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 16000) {gcount = 16000;} @@ -363,11 +340,11 @@ void Melt::MeltKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Melt/Melt.h b/plugins/MacSignedAU/Melt/Melt.h index 4473fb5e8..d7366ad89 100755 --- a/plugins/MacSignedAU/Melt/Melt.h +++ b/plugins/MacSignedAU/Melt/Melt.h @@ -145,7 +145,7 @@ public: Float32 scalefactor; int gcount; //we're using 32 bit because we want to build some truncation into the tails to noise them. - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/MidSide/MidSide.cpp b/plugins/MacSignedAU/MidSide/MidSide.cpp index 1eb94336c..0e95b192a 100755 --- a/plugins/MacSignedAU/MidSide/MidSide.cpp +++ b/plugins/MacSignedAU/MidSide/MidSide.cpp @@ -171,8 +171,8 @@ ComponentResult MidSide::Initialize() // this is called the reset the DSP state (clear buffers, reset counters, etc.) ComponentResult MidSide::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -192,10 +192,10 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 sidegain = GetParameter( kParam_One ) * 2.0; Float64 midgain = 2.0 - sidegain; @@ -204,44 +204,8 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -251,7 +215,7 @@ OSStatus MidSide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/MidSide/MidSide.h b/plugins/MacSignedAU/MidSide/MidSide.h index 643457a34..c5dec2ac3 100755 --- a/plugins/MacSignedAU/MidSide/MidSide.h +++ b/plugins/MacSignedAU/MidSide/MidSide.h @@ -111,8 +111,8 @@ public: virtual ComponentResult Version() { return kMidSideVersion; } private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacSignedAU/MoNoam/MoNoam.cpp b/plugins/MacSignedAU/MoNoam/MoNoam.cpp index 16355aacf..bcee69a3f 100755 --- a/plugins/MacSignedAU/MoNoam/MoNoam.cpp +++ b/plugins/MacSignedAU/MoNoam/MoNoam.cpp @@ -211,21 +211,21 @@ OSStatus MoNoam::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int processing = (int) GetParameter( kParam_One ); while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/MacSignedAU/Mojo/Mojo.cpp b/plugins/MacSignedAU/Mojo/Mojo.cpp index 6c8d90222..7fbf1c0b8 100755 --- a/plugins/MacSignedAU/Mojo/Mojo.cpp +++ b/plugins/MacSignedAU/Mojo/Mojo.cpp @@ -176,15 +176,15 @@ void Mojo::MojoKernel::Process( const Float32 *inSourceP, Float64 gain = pow(10.0,GetParameter( kParam_One )/20.0); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - //long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + //double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double mojo = pow(fabs(inputSample),0.25); + double mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacSignedAU/Monitoring/Monitoring.cpp b/plugins/MacSignedAU/Monitoring/Monitoring.cpp index 93593fed2..c9d8afeff 100755 --- a/plugins/MacSignedAU/Monitoring/Monitoring.cpp +++ b/plugins/MacSignedAU/Monitoring/Monitoring.cpp @@ -267,7 +267,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int processing = (int) GetParameter( kParam_One ); @@ -289,8 +289,8 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //for Bandpasses while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -357,7 +357,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl case 3: Float64 trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -530,8 +530,8 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -547,17 +547,17 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (-tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (-tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -579,9 +579,9 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -638,7 +638,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -657,17 +657,17 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -681,7 +681,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -690,7 +690,7 @@ OSStatus Monitoring::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/MacSignedAU/Monitoring/Monitoring.h b/plugins/MacSignedAU/Monitoring/Monitoring.h index 86059430d..8eceec7d1 100755 --- a/plugins/MacSignedAU/Monitoring/Monitoring.h +++ b/plugins/MacSignedAU/Monitoring/Monitoring.h @@ -142,8 +142,8 @@ public: virtual ComponentResult Version() { return kMonitoringVersion; } private: - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD Float64 aL[1503], bL[1503], cL[1503], dL[1503]; Float64 aR[1503], bR[1503], cR[1503], dR[1503]; @@ -163,7 +163,7 @@ public: Float64 iirSampleTR, iirSampleUR, iirSampleVR; Float64 iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquad[11]; + double biquad[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/MacSignedAU/Monitoring2/Monitoring2.cpp b/plugins/MacSignedAU/Monitoring2/Monitoring2.cpp index 2de6ab089..a97ab7660 100644 --- a/plugins/MacSignedAU/Monitoring2/Monitoring2.cpp +++ b/plugins/MacSignedAU/Monitoring2/Monitoring2.cpp @@ -248,7 +248,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -275,8 +275,8 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //for Bandpasses while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -346,7 +346,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF case kSLEW: Float64 trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -519,8 +519,8 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -536,17 +536,17 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -568,9 +568,9 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -627,7 +627,7 @@ OSStatus Monitoring2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionF //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/MacSignedAU/Monitoring2/Monitoring2.h b/plugins/MacSignedAU/Monitoring2/Monitoring2.h index d0f7f47f7..32b707a39 100644 --- a/plugins/MacSignedAU/Monitoring2/Monitoring2.h +++ b/plugins/MacSignedAU/Monitoring2/Monitoring2.h @@ -157,7 +157,7 @@ public: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/MacSignedAU/NCSeventeen/NCSeventeen.cpp b/plugins/MacSignedAU/NCSeventeen/NCSeventeen.cpp index 108fccdce..9eecae087 100755 --- a/plugins/MacSignedAU/NCSeventeen/NCSeventeen.cpp +++ b/plugins/MacSignedAU/NCSeventeen/NCSeventeen.cpp @@ -212,7 +212,7 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, Float64 maxfeedTreb = 0.972; Float64 maxfeed = 0.975; Float64 bridgerectifier; - long double inputSample; + double inputSample; Float64 lowSample; Float64 highSample; Float64 distSample; @@ -224,30 +224,7 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= gain; @@ -382,11 +359,11 @@ void NCSeventeen::NCSeventeenKernel::Process( const Float32 *inSourceP, if (inputSample < -0.95) inputSample = -0.95; //iron bar - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacSignedAU/NCSeventeen/NCSeventeen.h b/plugins/MacSignedAU/NCSeventeen/NCSeventeen.h index 571f64fcc..b3421b7f3 100755 --- a/plugins/MacSignedAU/NCSeventeen/NCSeventeen.h +++ b/plugins/MacSignedAU/NCSeventeen/NCSeventeen.h @@ -133,7 +133,7 @@ public: Float64 basslev; Float64 treblev; Float64 cheblev; - long double fpNShape; + uint32_t fpd; //default stuff }; diff --git a/plugins/MacSignedAU/NaturalizeDither/NaturalizeDither.cpp b/plugins/MacSignedAU/NaturalizeDither/NaturalizeDither.cpp index 2ede047f5..34f3d16ca 100755 --- a/plugins/MacSignedAU/NaturalizeDither/NaturalizeDither.cpp +++ b/plugins/MacSignedAU/NaturalizeDither/NaturalizeDither.cpp @@ -176,7 +176,7 @@ void NaturalizeDither::NaturalizeDitherKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 benfordize; int hotbinA; int hotbinB; @@ -185,30 +185,7 @@ void NaturalizeDither::NaturalizeDitherKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 8388608.0; diff --git a/plugins/MacSignedAU/Neverland/Neverland.cpp b/plugins/MacSignedAU/Neverland/Neverland.cpp index 19cc4d1d1..e36bc55ce 100755 --- a/plugins/MacSignedAU/Neverland/Neverland.cpp +++ b/plugins/MacSignedAU/Neverland/Neverland.cpp @@ -222,8 +222,8 @@ void Neverland::NeverlandKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacSignedAU/Nikola/Nikola.cpp b/plugins/MacSignedAU/Nikola/Nikola.cpp index aa61aec83..a695bde03 100755 --- a/plugins/MacSignedAU/Nikola/Nikola.cpp +++ b/plugins/MacSignedAU/Nikola/Nikola.cpp @@ -190,9 +190,9 @@ void Nikola::NikolaKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 bridgerectifier = fabs(inputSample); if (bridgerectifier > outlevel) outlevel = bridgerectifier; diff --git a/plugins/MacSignedAU/NodeDither/NodeDither.cpp b/plugins/MacSignedAU/NodeDither/NodeDither.cpp index e74f4ef3a..841b14f9e 100755 --- a/plugins/MacSignedAU/NodeDither/NodeDither.cpp +++ b/plugins/MacSignedAU/NodeDither/NodeDither.cpp @@ -210,35 +210,12 @@ void NodeDither::NodeDitherKernel::Process( const Float32 *inSourceP, int phase = GetParameter( kParam_Two ); //0 default is out of phase, 1 is in phase - long double inputSample; + double inputSample; Float64 currentDither; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; diff --git a/plugins/MacSignedAU/Noise/Noise.cpp b/plugins/MacSignedAU/Noise/Noise.cpp index 3081ad966..16d922cb8 100755 --- a/plugins/MacSignedAU/Noise/Noise.cpp +++ b/plugins/MacSignedAU/Noise/Noise.cpp @@ -209,7 +209,7 @@ void Noise::NoiseKernel::Reset() flip = false; filterflip = false; for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -228,7 +228,7 @@ void Noise::NoiseKernel::Process( const Float32 *inSourceP, Float64 cutofftarget = (GetParameter( kParam_One )*3.5); Float64 rumblecutoff = cutofftarget * 0.005; Float64 invcutoff; - long double inputSample; + double inputSample; Float64 drySample; Float64 highpass = GetParameter( kParam_Three )*38.0; int lowcut = floor(highpass); @@ -311,30 +311,7 @@ void Noise::NoiseKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (surge> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Noise/Noise.h b/plugins/MacSignedAU/Noise/Noise.h index 452a6031d..31568fe4a 100755 --- a/plugins/MacSignedAU/Noise/Noise.h +++ b/plugins/MacSignedAU/Noise/Noise.h @@ -152,7 +152,7 @@ public: bool filterflip; Float64 b[11]; Float64 f[11]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/NonlinearSpace/NonlinearSpace.cpp b/plugins/MacSignedAU/NonlinearSpace/NonlinearSpace.cpp index 40754c122..c2fc6f64a 100755 --- a/plugins/MacSignedAU/NonlinearSpace/NonlinearSpace.cpp +++ b/plugins/MacSignedAU/NonlinearSpace/NonlinearSpace.cpp @@ -408,8 +408,8 @@ ComponentResult NonlinearSpace::Reset(AudioUnitScope inScope, AudioUnitElement countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -428,12 +428,12 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + double mid; + double side; Float64 overallscale = 1.0; int samplerate = (int) GetParameter( kParam_One ); switch (samplerate) @@ -511,44 +511,8 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1157,7 +1121,7 @@ OSStatus NonlinearSpace::ProcessBufferLists(AudioUnitRenderActionFlags & ioActi //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.cpp b/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.cpp index 9d2006561..e2946e77a 100755 --- a/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.cpp +++ b/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.cpp @@ -177,7 +177,7 @@ void NotJustAnotherCD::NotJustAnotherCDKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 benfordize; int hotbinA; int hotbinB; @@ -188,30 +188,7 @@ void NotJustAnotherCD::NotJustAnotherCDKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; diff --git a/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.h b/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.h index b3700c9b8..7ca7ce40e 100755 --- a/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.h +++ b/plugins/MacSignedAU/NotJustAnotherCD/NotJustAnotherCD.h @@ -122,7 +122,7 @@ public: private: Float64 byn[13]; - long double noiseShaping; + double noiseShaping; }; }; diff --git a/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.cpp b/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.cpp index ff65060af..02a9e0012 100755 --- a/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.cpp +++ b/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.cpp @@ -222,23 +222,23 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; //0-1 is now one bit, now we dither bool cutbins; cutbins = false; - long double drySample = inputSample; + double drySample = inputSample; inputSample -= noiseShaping; - long double benfordize; benfordize = floor(inputSample); + double benfordize; benfordize = floor(inputSample); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { byn[hotbinA] += 1; if (byn[hotbinA] > 982) cutbins = true; @@ -254,7 +254,7 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { byn[hotbinB] += 1; if (byn[hotbinB] > 982) cutbins = true; @@ -265,7 +265,7 @@ void NotJustAnotherDither::NotJustAnotherDitherKernel::Process( const Float32 } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {byn[hotbinA] += 1; outputSample = floor(inputSample);} else {byn[hotbinB] += 1; outputSample = floor(inputSample+1);} //assign the relevant one to the delay line diff --git a/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.h b/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.h index d519bfbf2..69eb38ed6 100755 --- a/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.h +++ b/plugins/MacSignedAU/NotJustAnotherDither/NotJustAnotherDither.h @@ -132,7 +132,7 @@ public: private: Float64 byn[13]; - long double noiseShaping; + double noiseShaping; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/OneCornerClip/OneCornerClip.cpp b/plugins/MacSignedAU/OneCornerClip/OneCornerClip.cpp index fdaafeb01..08e4a1a71 100755 --- a/plugins/MacSignedAU/OneCornerClip/OneCornerClip.cpp +++ b/plugins/MacSignedAU/OneCornerClip/OneCornerClip.cpp @@ -193,7 +193,7 @@ void OneCornerClip::OneCornerClipKernel::Reset() lastSample = 0.0; limitPos = 0.0; limitNeg = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,7 +208,7 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -230,35 +230,12 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, bool clipEngage = false; Float64 wet = GetParameter( kParam_Five ); Float64 dry = 1.0-wet; - long double inputSample; + double inputSample; Float64 drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (inputGain != 1.0) @@ -304,11 +281,11 @@ void OneCornerClip::OneCornerClipKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither if (clipEngage == false) { diff --git a/plugins/MacSignedAU/OneCornerClip/OneCornerClip.h b/plugins/MacSignedAU/OneCornerClip/OneCornerClip.h index 013fc94fb..109620622 100755 --- a/plugins/MacSignedAU/OneCornerClip/OneCornerClip.h +++ b/plugins/MacSignedAU/OneCornerClip/OneCornerClip.h @@ -140,7 +140,7 @@ public: Float64 lastSample; Float64 limitPos; Float64 limitNeg; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PDBuss/PDBuss.cpp b/plugins/MacSignedAU/PDBuss/PDBuss.cpp index 7d31ccd24..0b930a1f7 100755 --- a/plugins/MacSignedAU/PDBuss/PDBuss.cpp +++ b/plugins/MacSignedAU/PDBuss/PDBuss.cpp @@ -170,7 +170,7 @@ void PDBuss::PDBussKernel::Reset() settingchase = -90.0; chasespeed = 350.0; previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -190,7 +190,7 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, Float64 apply; double drySample; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -201,30 +201,7 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -259,11 +236,11 @@ void PDBuss::PDBussKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PDBuss/PDBuss.h b/plugins/MacSignedAU/PDBuss/PDBuss.h index 476b436ec..d857b806e 100755 --- a/plugins/MacSignedAU/PDBuss/PDBuss.h +++ b/plugins/MacSignedAU/PDBuss/PDBuss.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; Float64 previousSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PDChannel/PDChannel.cpp b/plugins/MacSignedAU/PDChannel/PDChannel.cpp index 78da51ab3..2a9d59ccb 100755 --- a/plugins/MacSignedAU/PDChannel/PDChannel.cpp +++ b/plugins/MacSignedAU/PDChannel/PDChannel.cpp @@ -170,7 +170,7 @@ void PDChannel::PDChannelKernel::Reset() settingchase = -90.0; chasespeed = 350.0; previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,7 +185,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 inputgain = GetParameter( kParam_One ); @@ -193,7 +193,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, Float64 apply; double drySample; - long double inputSample; + double inputSample; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -204,30 +204,7 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -265,11 +242,11 @@ void PDChannel::PDChannelKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PDChannel/PDChannel.h b/plugins/MacSignedAU/PDChannel/PDChannel.h index 523f7893b..920d251cd 100755 --- a/plugins/MacSignedAU/PDChannel/PDChannel.h +++ b/plugins/MacSignedAU/PDChannel/PDChannel.h @@ -132,7 +132,7 @@ public: Float64 settingchase; Float64 chasespeed; Float64 previousSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Pafnuty/Pafnuty.cpp b/plugins/MacSignedAU/Pafnuty/Pafnuty.cpp index 47a3648f6..4f8500bd0 100755 --- a/plugins/MacSignedAU/Pafnuty/Pafnuty.cpp +++ b/plugins/MacSignedAU/Pafnuty/Pafnuty.cpp @@ -254,7 +254,7 @@ ComponentResult Pafnuty::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Pafnuty::PafnutyKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,70 +269,52 @@ void Pafnuty::PafnutyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double chebyshev; - long double effect; - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (GetParameter( kParam_One )*1.0); + double chebyshev; + double effect; + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (GetParameter( kParam_One )*1.0); second = second * fabs(second); - long double third = -(GetParameter( kParam_Two )*0.60); + double third = -(GetParameter( kParam_Two )*0.60); third = third * fabs(third); - long double fourth = -(GetParameter( kParam_Three )*0.60); + double fourth = -(GetParameter( kParam_Three )*0.60); fourth = fourth * fabs(fourth); - long double fifth = (GetParameter( kParam_Four )*0.45); + double fifth = (GetParameter( kParam_Four )*0.45); fifth = fifth * fabs(fifth); - long double sixth = (GetParameter( kParam_Five )*0.45); + double sixth = (GetParameter( kParam_Five )*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(GetParameter( kParam_Six )*0.38); + double seventh = -(GetParameter( kParam_Six )*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(GetParameter( kParam_Seven )*0.38); + double eighth = -(GetParameter( kParam_Seven )*0.38); eighth = eighth * fabs(eighth); - long double ninth = (GetParameter( kParam_Eight )*0.35); + double ninth = (GetParameter( kParam_Eight )*0.35); ninth = ninth * fabs(ninth); - long double tenth = (GetParameter( kParam_Nine )*0.35); + double tenth = (GetParameter( kParam_Nine )*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(GetParameter( kParam_Ten )*0.32); + double eleventh = -(GetParameter( kParam_Ten )*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(GetParameter( kParam_Eleven )*0.32); + double twelvth = -(GetParameter( kParam_Eleven )*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (GetParameter( kParam_Twelve )*0.30); + double thirteenth = (GetParameter( kParam_Twelve )*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = GetParameter( kParam_Thirteen ); + double amount = GetParameter( kParam_Thirteen ); amount = amount * fabs(amount); //setting up while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; effect = 0.0; inP2 = inputSample * inputSample; @@ -412,11 +394,11 @@ void Pafnuty::PafnutyKernel::Process( const Float32 *inSourceP, inputSample += (effect * amount); //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Pafnuty/Pafnuty.h b/plugins/MacSignedAU/Pafnuty/Pafnuty.h index ae2b76687..111add59a 100755 --- a/plugins/MacSignedAU/Pafnuty/Pafnuty.h +++ b/plugins/MacSignedAU/Pafnuty/Pafnuty.h @@ -162,7 +162,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PaulDither/PaulDither.cpp b/plugins/MacSignedAU/PaulDither/PaulDither.cpp index bd52644e9..e5df5960b 100755 --- a/plugins/MacSignedAU/PaulDither/PaulDither.cpp +++ b/plugins/MacSignedAU/PaulDither/PaulDither.cpp @@ -198,7 +198,7 @@ void PaulDither::PaulDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 currentDither; bool highres = false; @@ -214,7 +214,7 @@ void PaulDither::PaulDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacSignedAU/PaulWide/PaulWide.cpp b/plugins/MacSignedAU/PaulWide/PaulWide.cpp index 8d9b03a9e..63d927861 100644 --- a/plugins/MacSignedAU/PaulWide/PaulWide.cpp +++ b/plugins/MacSignedAU/PaulWide/PaulWide.cpp @@ -229,8 +229,8 @@ OSStatus PaulWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag if (outScale < 8.0) outScale = 8.0; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -247,14 +247,14 @@ OSStatus PaulWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/MacSignedAU/PeaksOnly/PeaksOnly.cpp b/plugins/MacSignedAU/PeaksOnly/PeaksOnly.cpp index ae477744e..c26d1933c 100755 --- a/plugins/MacSignedAU/PeaksOnly/PeaksOnly.cpp +++ b/plugins/MacSignedAU/PeaksOnly/PeaksOnly.cpp @@ -167,7 +167,7 @@ void PeaksOnly::PeaksOnlyKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -178,8 +178,8 @@ void PeaksOnly::PeaksOnlyKernel::Process( const Float32 *inSourceP, int allpasstemp = 0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacSignedAU/PhaseNudge/PhaseNudge.cpp b/plugins/MacSignedAU/PhaseNudge/PhaseNudge.cpp index 4421631ff..eaf29883c 100755 --- a/plugins/MacSignedAU/PhaseNudge/PhaseNudge.cpp +++ b/plugins/MacSignedAU/PhaseNudge/PhaseNudge.cpp @@ -168,7 +168,7 @@ void PhaseNudge::PhaseNudgeKernel::Reset() { for(int count = 0; count < 1502; count++) {d[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; //coded to snap directly to the value on instantiation if the disparity is great enough } @@ -193,36 +193,13 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; Float64 bridgerectifier; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample /= 4.0; @@ -253,11 +230,11 @@ void PhaseNudge::PhaseNudgeKernel::Process( const Float32 *inSourceP, inputSample *= 4.0; if (wet < 1.0) inputSample = (drySample * dry)+(inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PhaseNudge/PhaseNudge.h b/plugins/MacSignedAU/PhaseNudge/PhaseNudge.h index fa655e80e..f6ad98dcd 100755 --- a/plugins/MacSignedAU/PhaseNudge/PhaseNudge.h +++ b/plugins/MacSignedAU/PhaseNudge/PhaseNudge.h @@ -130,7 +130,7 @@ public: private: Float64 d[1503]; int one, maxdelay; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PitchDelay/PitchDelay.cpp b/plugins/MacSignedAU/PitchDelay/PitchDelay.cpp index 53a6d3a5e..fadc91b3b 100644 --- a/plugins/MacSignedAU/PitchDelay/PitchDelay.cpp +++ b/plugins/MacSignedAU/PitchDelay/PitchDelay.cpp @@ -221,7 +221,7 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -269,8 +269,8 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, //unless you go super heavy, you are only adjusting the added echo loudness. while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; @@ -279,7 +279,7 @@ void PitchDelay::PitchDelayKernel::Process( const Float32 *inSourceP, int pos = floor(delay); Float64 newSample = inputSample + (regenSample*feedback); - long double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; + double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; regenFilter[7] = -(tempSample * regenFilter[5]) + regenFilter[8]; regenFilter[8] = (newSample * regenFilter[4]) - (tempSample * regenFilter[6]); newSample = tempSample; diff --git a/plugins/MacSignedAU/PitchDelay/PitchDelay.h b/plugins/MacSignedAU/PitchDelay/PitchDelay.h index 15f396905..6f76114c2 100644 --- a/plugins/MacSignedAU/PitchDelay/PitchDelay.h +++ b/plugins/MacSignedAU/PitchDelay/PitchDelay.h @@ -145,8 +145,8 @@ public: Float64 regenSample; Float64 delay; Float64 sweep; - long double regenFilter[9]; - long double outFilter[9]; + double regenFilter[9]; + double outFilter[9]; double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacSignedAU/PocketVerbs/PocketVerbs.cpp b/plugins/MacSignedAU/PocketVerbs/PocketVerbs.cpp index d0fb00dcd..92cff00c1 100755 --- a/plugins/MacSignedAU/PocketVerbs/PocketVerbs.cpp +++ b/plugins/MacSignedAU/PocketVerbs/PocketVerbs.cpp @@ -544,9 +544,9 @@ void PocketVerbs::PocketVerbsKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; peak -= release; if (peak < fabs(inputSample*2.0)) peak = fabs(inputSample*2.0); diff --git a/plugins/MacSignedAU/Podcast/Podcast.cpp b/plugins/MacSignedAU/Podcast/Podcast.cpp index 20ffc1bad..aedebedff 100755 --- a/plugins/MacSignedAU/Podcast/Podcast.cpp +++ b/plugins/MacSignedAU/Podcast/Podcast.cpp @@ -182,7 +182,7 @@ void Podcast::PodcastKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -197,9 +197,9 @@ void Podcast::PodcastKernel::Process( const Float32 *inSourceP, Float64 trigger; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; inputSample *= c1; trigger = fabs(inputSample)*4.7; diff --git a/plugins/MacSignedAU/PodcastDeluxe/PodcastDeluxe.cpp b/plugins/MacSignedAU/PodcastDeluxe/PodcastDeluxe.cpp index 6f4556631..a4e66a48e 100755 --- a/plugins/MacSignedAU/PodcastDeluxe/PodcastDeluxe.cpp +++ b/plugins/MacSignedAU/PodcastDeluxe/PodcastDeluxe.cpp @@ -177,7 +177,7 @@ void PodcastDeluxe::PodcastDeluxeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -207,8 +207,8 @@ void PodcastDeluxe::PodcastDeluxeKernel::Process( const Float32 *inSourceP, Float64 trigger; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; allpasstemp = tap1 - 1; if (allpasstemp < 0 || allpasstemp > maxdelay1) {allpasstemp = maxdelay1;} diff --git a/plugins/MacSignedAU/Point/Poynt.cpp b/plugins/MacSignedAU/Point/Poynt.cpp index 60bd52af8..9e977fff2 100755 --- a/plugins/MacSignedAU/Point/Poynt.cpp +++ b/plugins/MacSignedAU/Point/Poynt.cpp @@ -178,7 +178,7 @@ void Poynt::PoyntKernel::Reset() nobA = 0.0; nibB = 0.0; nobB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = true; } @@ -213,35 +213,12 @@ void Poynt::PoyntKernel::Process( const Float32 *inSourceP, if (GetParameter( kParam_Two ) > 0) nobDiv = nibDiv / (1.001-GetParameter( kParam_Two )); else nobDiv = nibDiv * (1.001-pow(GetParameter( kParam_Two )*0.75,2)); Float64 nibnobFactor = 0.0; //start with the fallthrough value, why not - long double inputSample; + double inputSample; Float64 absolute; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; @@ -274,11 +251,11 @@ void Poynt::PoyntKernel::Process( const Float32 *inSourceP, inputSample *= nibnobFactor; fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/Pop/Pop.cpp b/plugins/MacSignedAU/Pop/Pop.cpp index 028a19a66..9b8756883 100755 --- a/plugins/MacSignedAU/Pop/Pop.cpp +++ b/plugins/MacSignedAU/Pop/Pop.cpp @@ -223,9 +223,9 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; d[delay] = inputSample; delay--; @@ -233,7 +233,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, //yes this is a second bounds check. it's cheap, check EVERY time inputSample = (inputSample * thicken) + (d[delay] * (1.0-thicken)); - long double lowestSample = inputSample; + double lowestSample = inputSample; if (fabs(inputSample) > fabs(previous)) lowestSample = previous; if (fabs(lowestSample) > fabs(previous2)) lowestSample = (lowestSample + previous2) / 1.99; if (fabs(lowestSample) > fabs(previous3)) lowestSample = (lowestSample + previous3) / 1.98; @@ -304,7 +304,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, muSpeedB = muNewSpeed / muSpeedB; } //got coefficients, adjusted speeds - long double coefficient = highGainOffset; + double coefficient = highGainOffset; if (flip) coefficient += pow(muCoefficientA,2); else coefficient += pow(muCoefficientB,2); inputSample *= coefficient; @@ -313,7 +313,7 @@ void Pop::PopKernel::Process( const Float32 *inSourceP, //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/MacSignedAU/Pop/Pop.h b/plugins/MacSignedAU/Pop/Pop.h index 859a55cf5..fee7c7bce 100755 --- a/plugins/MacSignedAU/Pop/Pop.h +++ b/plugins/MacSignedAU/Pop/Pop.h @@ -130,19 +130,19 @@ public: virtual void Reset(); private: - long double muVary; - long double muAttack; - long double muNewSpeed; - long double muSpeedA; - long double muSpeedB; - long double muCoefficientA; - long double muCoefficientB; - long double thicken; - long double previous; - long double previous2; - long double previous3; - long double previous4; - long double previous5; + double muVary; + double muAttack; + double muNewSpeed; + double muSpeedA; + double muSpeedB; + double muCoefficientA; + double muCoefficientB; + double thicken; + double previous; + double previous2; + double previous3; + double previous4; + double previous5; Float64 d[10001]; int delay; bool flip; diff --git a/plugins/MacSignedAU/PowerSag/PowerSag.cpp b/plugins/MacSignedAU/PowerSag/PowerSag.cpp index f59277f48..a55791f77 100755 --- a/plugins/MacSignedAU/PowerSag/PowerSag.cpp +++ b/plugins/MacSignedAU/PowerSag/PowerSag.cpp @@ -169,7 +169,7 @@ void PowerSag::PowerSagKernel::Reset() for(int count = 0; count < 8999; count++) {d[count] = 0;} control = 0; gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -191,34 +191,11 @@ void PowerSag::PowerSagKernel::Process( const Float32 *inSourceP, Float64 thickness; Float64 out; Float64 bridgerectifier; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -249,11 +226,11 @@ void PowerSag::PowerSagKernel::Process( const Float32 *inSourceP, inputSample *= clamp; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PowerSag/PowerSag.h b/plugins/MacSignedAU/PowerSag/PowerSag.h index ef594dcdb..8a7796b84 100755 --- a/plugins/MacSignedAU/PowerSag/PowerSag.h +++ b/plugins/MacSignedAU/PowerSag/PowerSag.h @@ -131,7 +131,7 @@ public: Float64 d[9000]; Float64 control; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PowerSag2/PowerSag2.cpp b/plugins/MacSignedAU/PowerSag2/PowerSag2.cpp index d410f820a..9e23f6186 100755 --- a/plugins/MacSignedAU/PowerSag2/PowerSag2.cpp +++ b/plugins/MacSignedAU/PowerSag2/PowerSag2.cpp @@ -191,8 +191,8 @@ void PowerSag2::PowerSag2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; if (gcount < 0 || gcount > 16384) {gcount = 16384;} diff --git a/plugins/MacSignedAU/Precious/Precious.cpp b/plugins/MacSignedAU/Precious/Precious.cpp index 7b7d15416..884feb34c 100755 --- a/plugins/MacSignedAU/Precious/Precious.cpp +++ b/plugins/MacSignedAU/Precious/Precious.cpp @@ -221,8 +221,8 @@ void Precious::PreciousKernel::Process( const Float32 *inSourceP, //if threshold is literally 1 then hardness is infinite, so we make it very big while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= indrive; //calibrated to match gain through convolution and -0.3 correction diff --git a/plugins/MacSignedAU/Preponderant/Preponderant.cpp b/plugins/MacSignedAU/Preponderant/Preponderant.cpp index ef532c257..e18a8e934 100755 --- a/plugins/MacSignedAU/Preponderant/Preponderant.cpp +++ b/plugins/MacSignedAU/Preponderant/Preponderant.cpp @@ -209,7 +209,7 @@ void Preponderant::PreponderantKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -256,24 +256,24 @@ void Preponderant::PreponderantKernel::Process( const Float32 *inSourceP, biquadC[6] = (1.0 - K / biquadC[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = *sourceP; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = *sourceP; - long double tempSample = (inputSample * biquadA[2]) + biquadA[7]; + double tempSample = (inputSample * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSample * biquadA[4]) - (tempSample * biquadA[6]); - long double bassSample = tempSample; //BANDPASS form + double bassSample = tempSample; //BANDPASS form tempSample = (inputSample * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (inputSample * biquadB[4]) - (tempSample * biquadB[6]); - long double midSample = tempSample; //BANDPASS form + double midSample = tempSample; //BANDPASS form tempSample = (inputSample * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSample * biquadC[5]) + biquadC[8]; biquadC[8] = (inputSample * biquadC[4]) - (tempSample * biquadC[6]); - long double highSample = tempSample; //BANDPASS form + double highSample = tempSample; //BANDPASS form if (bassBalance < 0.00125) bassBalance = 0.00125; if (bassBalance > 1.0) bassBalance = 1.0; diff --git a/plugins/MacSignedAU/Preponderant/Preponderant.h b/plugins/MacSignedAU/Preponderant/Preponderant.h index 87c8d8fcb..1dff6ad8b 100755 --- a/plugins/MacSignedAU/Preponderant/Preponderant.h +++ b/plugins/MacSignedAU/Preponderant/Preponderant.h @@ -137,16 +137,16 @@ public: virtual void Reset(); private: - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double bassBalance; - long double midBalance; - long double highBalance; - long double bassTrack; - long double midTrack; - long double highTrack; - long double quickness; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double bassBalance; + double midBalance; + double highBalance; + double bassTrack; + double midTrack; + double highTrack; + double quickness; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Pressure4/Pressure4.cpp b/plugins/MacSignedAU/Pressure4/Pressure4.cpp index 1f8f76e52..bd82df780 100755 --- a/plugins/MacSignedAU/Pressure4/Pressure4.cpp +++ b/plugins/MacSignedAU/Pressure4/Pressure4.cpp @@ -198,8 +198,8 @@ ComponentResult Pressure4::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Pressure4::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -236,7 +236,7 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla release /= overallscale; Float64 fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; Float64 coefficient; Float64 inputSense; Float64 mewiness = GetParameter( kParam_Three ); @@ -255,50 +255,14 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla unmewiness = 1.0-mewiness; } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -406,7 +370,7 @@ OSStatus Pressure4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Pressure4/Pressure4.h b/plugins/MacSignedAU/Pressure4/Pressure4.h index 6534c4647..181c5b3c2 100755 --- a/plugins/MacSignedAU/Pressure4/Pressure4.h +++ b/plugins/MacSignedAU/Pressure4/Pressure4.h @@ -125,8 +125,8 @@ public: Float64 muSpeedB; Float64 muCoefficientA; Float64 muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + double fpNShapeL; + double fpNShapeR; bool flip; }; diff --git a/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.cpp b/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.cpp index fe0ab48db..c5189c129 100755 --- a/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.cpp +++ b/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.cpp @@ -182,7 +182,7 @@ ComponentResult Pressure4Mono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Pressure4Mono::Pressure4MonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -213,7 +213,7 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, release /= overallscale; Float64 fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; Float64 coefficient; Float64 mewiness = GetParameter( kParam_Three ); Float64 outputGain = GetParameter( kParam_Four ); @@ -231,34 +231,11 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, unmewiness = 1.0-mewiness; } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; // advance to next frame (e.g. if stereo, we're advancing 2 samples); @@ -349,11 +326,11 @@ void Pressure4Mono::Pressure4MonoKernel::Process( const Float32 *inSourceP, //second stage of overdrive to prevent overs and allow bloody loud extremeness flip = !flip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.h b/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.h index 6c4b3df71..10641a300 100755 --- a/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.h +++ b/plugins/MacSignedAU/Pressure4Mono/Pressure4Mono.h @@ -141,7 +141,7 @@ public: Float64 muSpeedB; Float64 muCoefficientA; Float64 muCoefficientB; - long double fpNShape; + uint32_t fpd; bool flip; }; diff --git a/plugins/MacSignedAU/Pressure5/Pressure5.cpp b/plugins/MacSignedAU/Pressure5/Pressure5.cpp index 87e6cc066..724dd58ce 100644 --- a/plugins/MacSignedAU/Pressure5/Pressure5.cpp +++ b/plugins/MacSignedAU/Pressure5/Pressure5.cpp @@ -246,7 +246,7 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int spacing = floor(overallscale); //should give us working basic scaling, usually 2 or 4 @@ -280,18 +280,18 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //make the second filter same as the first, don't use sample slots while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -391,7 +391,7 @@ OSStatus Pressure5::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; diff --git a/plugins/MacSignedAU/Pressure5/Pressure5.h b/plugins/MacSignedAU/Pressure5/Pressure5.h index 12b825de4..a9a5bfede 100644 --- a/plugins/MacSignedAU/Pressure5/Pressure5.h +++ b/plugins/MacSignedAU/Pressure5/Pressure5.h @@ -149,15 +149,15 @@ public: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacSignedAU/PurestAir/PurestAir.cpp b/plugins/MacSignedAU/PurestAir/PurestAir.cpp index 575ebc938..315a23e8b 100755 --- a/plugins/MacSignedAU/PurestAir/PurestAir.cpp +++ b/plugins/MacSignedAU/PurestAir/PurestAir.cpp @@ -203,8 +203,8 @@ void PurestAir::PurestAirKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; halfDrySample = halfwaySample = (inputSample + last1Sample) / 2.0; diff --git a/plugins/MacSignedAU/PurestAir/PurestAir.h b/plugins/MacSignedAU/PurestAir/PurestAir.h index 38c73a27f..b8c5aa030 100755 --- a/plugins/MacSignedAU/PurestAir/PurestAir.h +++ b/plugins/MacSignedAU/PurestAir/PurestAir.h @@ -131,12 +131,12 @@ public: virtual void Reset(); private: - long double last1Sample; - long double halfwaySample; - long double halfDrySample; - long double halfDiffSample; - long double diffSample; - long double lastSample; + double last1Sample; + double halfwaySample; + double halfDrySample; + double halfDiffSample; + double diffSample; + double lastSample; Float64 s1; Float64 s2; Float64 s3; diff --git a/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.cpp b/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.cpp index 491800d60..2eba6d630 100755 --- a/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.cpp +++ b/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.cpp @@ -179,11 +179,11 @@ void PurestConsole2Buss::PurestConsole2BussKernel::Process( const Float32 *inS biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } diff --git a/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.h b/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.h index a9aff91e9..2ab3c5f75 100755 --- a/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.h +++ b/plugins/MacSignedAU/PurestConsole2Buss/PurestConsole2Buss.h @@ -117,7 +117,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.cpp b/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.cpp index c784cb2e9..bcf430c62 100755 --- a/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.cpp +++ b/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.cpp @@ -179,11 +179,11 @@ void PurestConsole2Channel::PurestConsole2ChannelKernel::Process( const Float32 biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 } diff --git a/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.h b/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.h index 43d201102..aacdbbe06 100755 --- a/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.h +++ b/plugins/MacSignedAU/PurestConsole2Channel/PurestConsole2Channel.h @@ -117,7 +117,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.cpp b/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.cpp index 9cec9d293..3ba9c602b 100755 --- a/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.cpp +++ b/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.cpp @@ -150,7 +150,7 @@ ComponentResult PurestConsoleBuss::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestConsoleBuss::PurestConsoleBussKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -166,34 +166,11 @@ void PurestConsoleBuss::PurestConsoleBussKernel::Process( const Float32 *inSou const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; @@ -202,11 +179,11 @@ void PurestConsoleBuss::PurestConsoleBussKernel::Process( const Float32 *inSou inputSample = asin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.h b/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.h index 590e7978f..1d85733b8 100755 --- a/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.h +++ b/plugins/MacSignedAU/PurestConsoleBuss/PurestConsoleBuss.h @@ -118,7 +118,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.cpp b/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.cpp index b12e00c5a..f7ab9e828 100755 --- a/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.cpp +++ b/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.cpp @@ -150,7 +150,7 @@ ComponentResult PurestConsoleChannel::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestConsoleChannel::PurestConsoleChannelKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -166,43 +166,20 @@ void PurestConsoleChannel::PurestConsoleChannelKernel::Process( const Float32 const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample = sin(inputSample); //amplitude aspect - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.h b/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.h index 0beecd138..b97f934e6 100755 --- a/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.h +++ b/plugins/MacSignedAU/PurestConsoleChannel/PurestConsoleChannel.h @@ -119,7 +119,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PurestDrive/PurestDrive.cpp b/plugins/MacSignedAU/PurestDrive/PurestDrive.cpp index ef25d3f51..f4ec6035f 100755 --- a/plugins/MacSignedAU/PurestDrive/PurestDrive.cpp +++ b/plugins/MacSignedAU/PurestDrive/PurestDrive.cpp @@ -159,7 +159,7 @@ ComponentResult PurestDrive::Initialize() void PurestDrive::PurestDriveKernel::Reset() { previousSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } @@ -177,36 +177,13 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; Float64 intensity = GetParameter( kParam_One ); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 apply; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample = sin(inputSample); @@ -222,11 +199,11 @@ void PurestDrive::PurestDriveKernel::Process( const Float32 *inSourceP, previousSample = sin(drySample); //apply the sine while storing previous sample - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PurestDrive/PurestDrive.h b/plugins/MacSignedAU/PurestDrive/PurestDrive.h index 54809d8da..09a9920fc 100755 --- a/plugins/MacSignedAU/PurestDrive/PurestDrive.h +++ b/plugins/MacSignedAU/PurestDrive/PurestDrive.h @@ -126,7 +126,7 @@ public: private: double previousSample; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacSignedAU/PurestEcho/PurestEcho.cpp b/plugins/MacSignedAU/PurestEcho/PurestEcho.cpp index 167e6f049..8e4926cf8 100755 --- a/plugins/MacSignedAU/PurestEcho/PurestEcho.cpp +++ b/plugins/MacSignedAU/PurestEcho/PurestEcho.cpp @@ -197,7 +197,7 @@ void PurestEcho::PurestEchoKernel::Reset() for(int count = 0; count < totalsamples-1; count++) {d[count] = 0;} gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -274,34 +274,11 @@ void PurestEcho::PurestEchoKernel::Process( const Float32 *inSourceP, Float64 delaysBuffer; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; d[gcount+loopLimit] = d[gcount] = inputSample * tapsTrim; //this is how the double buffer works: @@ -338,11 +315,11 @@ void PurestEcho::PurestEchoKernel::Process( const Float32 *inSourceP, gcount--; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PurestEcho/PurestEcho.h b/plugins/MacSignedAU/PurestEcho/PurestEcho.h index 7ed818b06..1e94fa7dd 100755 --- a/plugins/MacSignedAU/PurestEcho/PurestEcho.h +++ b/plugins/MacSignedAU/PurestEcho/PurestEcho.h @@ -140,7 +140,7 @@ public: const static int totalsamples = 65535; Float32 d[totalsamples]; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/PurestFade/PurestFade.cpp b/plugins/MacSignedAU/PurestFade/PurestFade.cpp index 0fca7c850..bf46e5c22 100755 --- a/plugins/MacSignedAU/PurestFade/PurestFade.cpp +++ b/plugins/MacSignedAU/PurestFade/PurestFade.cpp @@ -204,26 +204,26 @@ void PurestFade::PurestFadeKernel::Process( const Float32 *inSourceP, //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = GetParameter( kParam_Two ); + double targetBgain = GetParameter( kParam_Two ); if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((GetSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; targetgain = pow(10.0,settingchase/20.0); //now we have the target in our temp variable diff --git a/plugins/MacSignedAU/PurestGain/PurestGain.cpp b/plugins/MacSignedAU/PurestGain/PurestGain.cpp index 6be4ed36e..bf4c76fe5 100755 --- a/plugins/MacSignedAU/PurestGain/PurestGain.cpp +++ b/plugins/MacSignedAU/PurestGain/PurestGain.cpp @@ -170,7 +170,7 @@ void PurestGain::PurestGainKernel::Reset() settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,7 +213,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, Float64 outputgain; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { @@ -235,30 +235,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, //directly multiply the dB gain by the straight multiply gain inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (1.0 == outputgain) *destP = *sourceP; @@ -267,7 +244,7 @@ void PurestGain::PurestGainKernel::Process( const Float32 *inSourceP, inputSample *= outputgain; //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PurestSquish/PurestSquish.cpp b/plugins/MacSignedAU/PurestSquish/PurestSquish.cpp index 293537191..74a277a60 100755 --- a/plugins/MacSignedAU/PurestSquish/PurestSquish.cpp +++ b/plugins/MacSignedAU/PurestSquish/PurestSquish.cpp @@ -220,40 +220,22 @@ void PurestSquish::PurestSquishKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double highpassSample; - long double highpassSampleB; + double highpassSample; + double highpassSampleB; Float64 threshold = 1.01 - (1.0-pow(1.0-(GetParameter( kParam_One )*0.5),4)); Float64 iirAmount = pow(GetParameter( kParam_Two ),4)/overallscale; Float64 output = GetParameter( kParam_Three ); Float64 wet = GetParameter( kParam_Four ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; Float64 muMakeupGain = 1.0 / threshold; Float64 outMakeupGain = sqrt(muMakeupGain); diff --git a/plugins/MacSignedAU/PurestWarm/PurestWarm.cpp b/plugins/MacSignedAU/PurestWarm/PurestWarm.cpp index 407ef34d8..60bc34126 100755 --- a/plugins/MacSignedAU/PurestWarm/PurestWarm.cpp +++ b/plugins/MacSignedAU/PurestWarm/PurestWarm.cpp @@ -173,7 +173,7 @@ ComponentResult PurestWarm::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PurestWarm::PurestWarmKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -189,35 +189,12 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; int polarity = (int) GetParameter( kParam_One ); - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (polarity == 1) { @@ -226,7 +203,7 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, inputSample = -(sin(-inputSample*1.57079634)/1.57079634); //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } @@ -236,7 +213,7 @@ void PurestWarm::PurestWarmKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample*1.57079634)/1.57079634; //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } diff --git a/plugins/MacSignedAU/Pyewacket/Pyewacket.cpp b/plugins/MacSignedAU/Pyewacket/Pyewacket.cpp index a15a78a1b..61df24b61 100755 --- a/plugins/MacSignedAU/Pyewacket/Pyewacket.cpp +++ b/plugins/MacSignedAU/Pyewacket/Pyewacket.cpp @@ -189,8 +189,8 @@ ComponentResult Pyewacket::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Pyewacket::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; @@ -215,12 +215,12 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla overallscale *= GetSampleRate(); if (overallscale < 0.1) overallscale = 1.0; //insanity check - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 bridgerectifier; Float64 temprectifier; Float64 inputSense; @@ -239,44 +239,8 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { @@ -334,7 +298,7 @@ OSStatus Pyewacket::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Pyewacket/Pyewacket.h b/plugins/MacSignedAU/Pyewacket/Pyewacket.h index f4560469a..756f699f1 100755 --- a/plugins/MacSignedAU/Pyewacket/Pyewacket.h +++ b/plugins/MacSignedAU/Pyewacket/Pyewacket.h @@ -116,8 +116,8 @@ public: private: - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; Float64 chase; Float64 lastrectifierL; Float64 lastrectifierR; diff --git a/plugins/MacSignedAU/PyewacketMono/PyewacketMono.cpp b/plugins/MacSignedAU/PyewacketMono/PyewacketMono.cpp index 9c812d694..fabc78ca2 100755 --- a/plugins/MacSignedAU/PyewacketMono/PyewacketMono.cpp +++ b/plugins/MacSignedAU/PyewacketMono/PyewacketMono.cpp @@ -174,7 +174,7 @@ ComponentResult PyewacketMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void PyewacketMono::PyewacketMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chase = 1.0; lastrectifier = 0.0; } @@ -196,10 +196,10 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, overallscale *= GetSampleRate(); if (overallscale < 0.1) overallscale = 1.0; //insanity check - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSample; - long double drySample; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSample; + double drySample; Float64 bridgerectifier; Float64 temprectifier; Float64 inputSense; @@ -217,30 +217,7 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; @@ -280,11 +257,11 @@ void PyewacketMono::PyewacketMonoKernel::Process( const Float32 *inSourceP, inputSample *= outputGain; } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/PyewacketMono/PyewacketMono.h b/plugins/MacSignedAU/PyewacketMono/PyewacketMono.h index 469c9f0c5..6e07f3582 100755 --- a/plugins/MacSignedAU/PyewacketMono/PyewacketMono.h +++ b/plugins/MacSignedAU/PyewacketMono/PyewacketMono.h @@ -130,7 +130,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; Float64 chase; Float64 lastrectifier; }; diff --git a/plugins/MacSignedAU/RawGlitters/RawGlitters.cpp b/plugins/MacSignedAU/RawGlitters/RawGlitters.cpp index e67f304a3..a2b109a36 100755 --- a/plugins/MacSignedAU/RawGlitters/RawGlitters.cpp +++ b/plugins/MacSignedAU/RawGlitters/RawGlitters.cpp @@ -214,7 +214,7 @@ void RawGlitters::RawGlittersKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { Float64 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; Float64 outputSample; diff --git a/plugins/MacSignedAU/RawTimbers/RawTimbers.cpp b/plugins/MacSignedAU/RawTimbers/RawTimbers.cpp index c7a1048d1..2da7ec7c7 100755 --- a/plugins/MacSignedAU/RawTimbers/RawTimbers.cpp +++ b/plugins/MacSignedAU/RawTimbers/RawTimbers.cpp @@ -216,7 +216,7 @@ void RawTimbers::RawTimbersKernel::Process( const Float32 *inSourceP, Float64 inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; Float64 outputSample; diff --git a/plugins/MacSignedAU/Recurve/Recurve.cpp b/plugins/MacSignedAU/Recurve/Recurve.cpp index 7b8217e37..793f4d30a 100755 --- a/plugins/MacSignedAU/Recurve/Recurve.cpp +++ b/plugins/MacSignedAU/Recurve/Recurve.cpp @@ -185,8 +185,8 @@ OSStatus Recurve::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags UInt32 nSampleFrames = inFramesToProcess; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; diff --git a/plugins/MacSignedAU/Recurve/Recurve.h b/plugins/MacSignedAU/Recurve/Recurve.h index a0da97bce..883a863c9 100755 --- a/plugins/MacSignedAU/Recurve/Recurve.h +++ b/plugins/MacSignedAU/Recurve/Recurve.h @@ -105,7 +105,7 @@ public: virtual ComponentResult Version() { return kRecurveVersion; } private: - long double gain; + double gain; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/Remap/Remap.cpp b/plugins/MacSignedAU/Remap/Remap.cpp index f78a60b98..780babca3 100755 --- a/plugins/MacSignedAU/Remap/Remap.cpp +++ b/plugins/MacSignedAU/Remap/Remap.cpp @@ -195,12 +195,12 @@ void Remap::RemapKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; - long double gaintrim = fabs(inputSample); - long double bridgerectifier = gaintrim*gain; + double gaintrim = fabs(inputSample); + double bridgerectifier = gaintrim*gain; if (gaintrim > 1.0) gaintrim = 1.0; else gaintrim *= gaintrim; diff --git a/plugins/MacSignedAU/ResEQ/ResEQ.cpp b/plugins/MacSignedAU/ResEQ/ResEQ.cpp index 34e310968..985af57d5 100755 --- a/plugins/MacSignedAU/ResEQ/ResEQ.cpp +++ b/plugins/MacSignedAU/ResEQ/ResEQ.cpp @@ -334,9 +334,9 @@ void ResEQ::ResEQKernel::Process( const Float32 *inSourceP, //done updating the kernel for this go-round while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; b[59] = b[58]; b[58] = b[57]; b[57] = b[56]; b[56] = b[55]; b[55] = b[54]; b[54] = b[53]; b[53] = b[52]; b[52] = b[51]; b[51] = b[50]; b[50] = b[49]; b[49] = b[48]; b[48] = b[47]; b[47] = b[46]; b[46] = b[45]; b[45] = b[44]; b[44] = b[43]; b[43] = b[42]; b[42] = b[41]; b[41] = b[40]; b[40] = b[39]; b[39] = b[38]; diff --git a/plugins/MacSignedAU/Reverb/Reverb.cpp b/plugins/MacSignedAU/Reverb/Reverb.cpp index 9d10c4c31..f4d1080f2 100755 --- a/plugins/MacSignedAU/Reverb/Reverb.cpp +++ b/plugins/MacSignedAU/Reverb/Reverb.cpp @@ -297,8 +297,8 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, biquadC[6] = (1.0 - K / biquadC[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; aM[countM] = inputSample; @@ -306,7 +306,7 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, inputSample = aM[countM]; //predelay - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 @@ -315,10 +315,10 @@ void Reverb::ReverbKernel::Process( const Float32 *inSourceP, inputSample = sin(inputSample); - long double allpassI = inputSample; - long double allpassJ = inputSample; - long double allpassK = inputSample; - long double allpassL = inputSample; + double allpassI = inputSample; + double allpassJ = inputSample; + double allpassK = inputSample; + double allpassL = inputSample; int allpasstemp = countI + 1; diff --git a/plugins/MacSignedAU/Reverb/Reverb.h b/plugins/MacSignedAU/Reverb/Reverb.h index cee672ef5..6a827503a 100755 --- a/plugins/MacSignedAU/Reverb/Reverb.h +++ b/plugins/MacSignedAU/Reverb/Reverb.h @@ -126,9 +126,9 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; Float64 aA[8111]; Float64 aB[7511]; diff --git a/plugins/MacSignedAU/Righteous4/Righteous4.cpp b/plugins/MacSignedAU/Righteous4/Righteous4.cpp index 7c26ace29..037b1696d 100755 --- a/plugins/MacSignedAU/Righteous4/Righteous4.cpp +++ b/plugins/MacSignedAU/Righteous4/Righteous4.cpp @@ -228,7 +228,7 @@ void Righteous4::Righteous4Kernel::Reset() gwA = 0.0; gwB = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -243,8 +243,8 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -274,31 +274,8 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, Float64 refclip = pow(10.0,-0.0058888); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; //begin the whole distortion dealiebop @@ -309,7 +286,7 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, Float64 secondharmonic = sin((2 * inputSample * inputSample) * IIRsample); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSample; + double bridgerectifier = inputSample; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -414,7 +391,7 @@ void Righteous4::Righteous4Kernel::Process( const Float32 *inSourceP, if (bitDepth == 3) { //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither } else { diff --git a/plugins/MacSignedAU/Righteous4/Righteous4.h b/plugins/MacSignedAU/Righteous4/Righteous4.h index 1cf11d4ea..446fc6246 100755 --- a/plugins/MacSignedAU/Righteous4/Righteous4.h +++ b/plugins/MacSignedAU/Righteous4/Righteous4.h @@ -165,7 +165,7 @@ public: Float64 midSampleZ; Float64 byn[13]; - long double noiseShaping; + double noiseShaping; Float64 lastSample; Float64 IIRsample; @@ -174,7 +174,7 @@ public: Float64 gwA; Float64 gwB; - long double fpNShape; + double fpNShape; }; }; diff --git a/plugins/MacSignedAU/SideDull/SideDull.cpp b/plugins/MacSignedAU/SideDull/SideDull.cpp index 71169ba95..b10b1262d 100755 --- a/plugins/MacSignedAU/SideDull/SideDull.cpp +++ b/plugins/MacSignedAU/SideDull/SideDull.cpp @@ -197,9 +197,9 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; Float64 side; Float64 overallscale = 1.0; overallscale /= 44100.0; @@ -210,44 +210,8 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -270,7 +234,7 @@ OSStatus SideDull::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/SideDull/SideDull.h b/plugins/MacSignedAU/SideDull/SideDull.h index 85fd8d5db..515b969f6 100755 --- a/plugins/MacSignedAU/SideDull/SideDull.h +++ b/plugins/MacSignedAU/SideDull/SideDull.h @@ -112,8 +112,8 @@ private: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/Sidepass/Sidepass.cpp b/plugins/MacSignedAU/Sidepass/Sidepass.cpp index e7c866257..b6cffc3ed 100755 --- a/plugins/MacSignedAU/Sidepass/Sidepass.cpp +++ b/plugins/MacSignedAU/Sidepass/Sidepass.cpp @@ -176,8 +176,8 @@ ComponentResult Sidepass::Reset(AudioUnitScope inScope, AudioUnitElement inElem iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -198,9 +198,9 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; Float64 side; Float64 overallscale = 1.0; overallscale /= 44100.0; @@ -211,44 +211,8 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -271,7 +235,7 @@ OSStatus Sidepass::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Sidepass/Sidepass.h b/plugins/MacSignedAU/Sidepass/Sidepass.h index 4ac346b17..6a7f62b42 100755 --- a/plugins/MacSignedAU/Sidepass/Sidepass.h +++ b/plugins/MacSignedAU/Sidepass/Sidepass.h @@ -112,8 +112,8 @@ private: Float64 iirSampleA; Float64 iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.cpp b/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.cpp index bf9bd3bca..fcc4660d7 100755 --- a/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.cpp +++ b/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.cpp @@ -183,7 +183,7 @@ ComponentResult SingleEndedTriode::Initialize() void SingleEndedTriode::SingleEndedTriodeKernel::Reset() { postsine = sin(0.5); - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -208,27 +208,9 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; @@ -236,7 +218,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou { inputSample *= intensity; inputSample -= 0.5; - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSample > 0) inputSample = bridgerectifier; @@ -247,7 +229,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSample > 0.0) inputSample = bridgerectifier; @@ -257,7 +239,7 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSample); + double bridgerectifier = fabs(inputSample); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSample > 0.0) inputSample = bridgerectifier; @@ -268,11 +250,11 @@ void SingleEndedTriode::SingleEndedTriodeKernel::Process( const Float32 *inSou inputSample = (drySample * dry)+(inputSample*wet); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.h b/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.h index 243efa600..20dd706f7 100755 --- a/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.h +++ b/plugins/MacSignedAU/SingleEndedTriode/SingleEndedTriode.h @@ -135,7 +135,7 @@ public: private: Float64 postsine; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Slew/Slew.cpp b/plugins/MacSignedAU/Slew/Slew.cpp index 222f69bf4..9d6e080ae 100755 --- a/plugins/MacSignedAU/Slew/Slew.cpp +++ b/plugins/MacSignedAU/Slew/Slew.cpp @@ -159,7 +159,7 @@ ComponentResult Slew::Initialize() void Slew::SlewKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -190,30 +190,7 @@ void Slew::SlewKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; sourceP += inNumChannels; @@ -227,7 +204,7 @@ void Slew::SlewKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/Slew/Slew.h b/plugins/MacSignedAU/Slew/Slew.h index 95bf7c2cd..84a3b7590 100755 --- a/plugins/MacSignedAU/Slew/Slew.h +++ b/plugins/MacSignedAU/Slew/Slew.h @@ -124,7 +124,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Slew2/Slew2.cpp b/plugins/MacSignedAU/Slew2/Slew2.cpp index c31d437ef..32d96a5cd 100755 --- a/plugins/MacSignedAU/Slew2/Slew2.cpp +++ b/plugins/MacSignedAU/Slew2/Slew2.cpp @@ -165,7 +165,7 @@ void Slew2::Slew2Kernel::Reset() ataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity ataFlip = false; //end reset of antialias parameters lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -189,30 +189,7 @@ void Slew2::Slew2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; ataDrySample = inputSample; ataHalfDrySample = ataHalfwaySample = (inputSample + ataLast1Sample + ((-ataLast2Sample + ataLast3Sample) * ataUpsampleHighTweak)) / 2.0; @@ -255,11 +232,11 @@ void Slew2::Slew2Kernel::Process( const Float32 *inSourceP, ataPrevDiffSample = ataDiffSample / 2.0; //apply processing as difference to non-oversampled raw input - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; //built in output trim and dry/wet by default diff --git a/plugins/MacSignedAU/Slew2/Slew2.h b/plugins/MacSignedAU/Slew2/Slew2.h index 4e16def2c..4881182b5 100755 --- a/plugins/MacSignedAU/Slew2/Slew2.h +++ b/plugins/MacSignedAU/Slew2/Slew2.h @@ -141,7 +141,7 @@ public: Float64 ataPrevDiffSample; bool ataFlip; //end defining of antialiasing variables Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Slew3/Slew3.cpp b/plugins/MacSignedAU/Slew3/Slew3.cpp index 46bc9028b..837d002f9 100755 --- a/plugins/MacSignedAU/Slew3/Slew3.cpp +++ b/plugins/MacSignedAU/Slew3/Slew3.cpp @@ -181,8 +181,8 @@ void Slew3::Slew3Kernel::Process( const Float32 *inSourceP, Float64 threshold = pow((1-GetParameter( kParam_One )),4)/overallscale; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 clamp = (lastSampleB - lastSampleC) * 0.381966011250105; clamp -= (lastSampleA - lastSampleB) * 0.6180339887498948482045; diff --git a/plugins/MacSignedAU/SlewOnly/SlewOnly.cpp b/plugins/MacSignedAU/SlewOnly/SlewOnly.cpp index 8b128fd33..52bd6f39c 100755 --- a/plugins/MacSignedAU/SlewOnly/SlewOnly.cpp +++ b/plugins/MacSignedAU/SlewOnly/SlewOnly.cpp @@ -151,7 +151,7 @@ ComponentResult SlewOnly::Initialize() void SlewOnly::SlewOnlyKernel::Reset() { lastSample = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -172,30 +172,7 @@ void SlewOnly::SlewOnlyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; outputSample = (inputSample - lastSample)*trim; @@ -205,7 +182,7 @@ void SlewOnly::SlewOnlyKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)outputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); outputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/SlewOnly/SlewOnly.h b/plugins/MacSignedAU/SlewOnly/SlewOnly.h index 8b310928f..08b9e1500 100755 --- a/plugins/MacSignedAU/SlewOnly/SlewOnly.h +++ b/plugins/MacSignedAU/SlewOnly/SlewOnly.h @@ -122,7 +122,7 @@ public: private: Float64 lastSample; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Smooth/Smooth.cpp b/plugins/MacSignedAU/Smooth/Smooth.cpp index 60c5d9928..180632660 100755 --- a/plugins/MacSignedAU/Smooth/Smooth.cpp +++ b/plugins/MacSignedAU/Smooth/Smooth.cpp @@ -211,28 +211,10 @@ void Smooth::SmoothKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; clamp = fabs(inputSample - lastSampleA); clamp = sin(clamp*ratio); diff --git a/plugins/MacSignedAU/SoftGate/SoftGate.cpp b/plugins/MacSignedAU/SoftGate/SoftGate.cpp index de61be17e..12e719e2a 100755 --- a/plugins/MacSignedAU/SoftGate/SoftGate.cpp +++ b/plugins/MacSignedAU/SoftGate/SoftGate.cpp @@ -211,7 +211,7 @@ OSStatus SoftGate::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float32 * outputL = (Float32*)(outBuffer.mBuffers[0].mData); Float32 * outputR = (Float32*)(outBuffer.mBuffers[1].mData); UInt32 nSampleFrames = inFramesToProcess; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -222,8 +222,8 @@ OSStatus SoftGate::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float64 invrec = 1.0 - recovery; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; storedL[1] = storedL[0]; diff --git a/plugins/MacSignedAU/SoftGateMono/SoftGateMono.cpp b/plugins/MacSignedAU/SoftGateMono/SoftGateMono.cpp index 348b12a84..601249502 100755 --- a/plugins/MacSignedAU/SoftGateMono/SoftGateMono.cpp +++ b/plugins/MacSignedAU/SoftGateMono/SoftGateMono.cpp @@ -192,7 +192,7 @@ void SoftGateMono::SoftGateMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 threshold = pow(GetParameter( kParam_One ),6); @@ -202,8 +202,8 @@ void SoftGateMono::SoftGateMonoKernel::Process( const Float32 *inSourceP, Float64 invrec = 1.0 - recovery; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; storedL[1] = storedL[0]; storedL[0] = inputSample; diff --git a/plugins/MacSignedAU/SpatializeDither/SpatializeDither.cpp b/plugins/MacSignedAU/SpatializeDither/SpatializeDither.cpp index 10e9b4bd2..9370b91fb 100755 --- a/plugins/MacSignedAU/SpatializeDither/SpatializeDither.cpp +++ b/plugins/MacSignedAU/SpatializeDither/SpatializeDither.cpp @@ -199,7 +199,7 @@ void SpatializeDither::SpatializeDitherKernel::Process( const Float32 *inSourc const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 contingentRnd; Float64 absSample; Float64 contingent; @@ -221,7 +221,7 @@ void SpatializeDither::SpatializeDitherKernel::Process( const Float32 *inSourc while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacSignedAU/Spiral/Spiral.cpp b/plugins/MacSignedAU/Spiral/Spiral.cpp index 666e1b53b..c1dc054a5 100755 --- a/plugins/MacSignedAU/Spiral/Spiral.cpp +++ b/plugins/MacSignedAU/Spiral/Spiral.cpp @@ -167,9 +167,9 @@ void Spiral::SpiralKernel::Process( const Float32 *inSourceP, Float32 *destP = inDestP; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; //clip to 1.2533141373155 to reach maximum output diff --git a/plugins/MacSignedAU/Spiral2/Spiral2.cpp b/plugins/MacSignedAU/Spiral2/Spiral2.cpp index 5d3876922..4578a6514 100755 --- a/plugins/MacSignedAU/Spiral2/Spiral2.cpp +++ b/plugins/MacSignedAU/Spiral2/Spiral2.cpp @@ -219,9 +219,9 @@ void Spiral2::Spiral2Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; @@ -240,7 +240,7 @@ void Spiral2::Spiral2Kernel::Process( const Float32 *inSourceP, } //highpass section - long double presenceSample = sin(inputSample * fabs(prevSample)) / ((prevSample == 0.0) ?1:fabs(prevSample)); + double presenceSample = sin(inputSample * fabs(prevSample)) / ((prevSample == 0.0) ?1:fabs(prevSample)); //change from first Spiral: delay of one sample on the scaling factor. inputSample = sin(inputSample * fabs(inputSample)) / ((fabs(inputSample) == 0.0) ?1:fabs(inputSample)); diff --git a/plugins/MacSignedAU/Spiral2/Spiral2.h b/plugins/MacSignedAU/Spiral2/Spiral2.h index 90912bf69..1cf41aee7 100755 --- a/plugins/MacSignedAU/Spiral2/Spiral2.h +++ b/plugins/MacSignedAU/Spiral2/Spiral2.h @@ -138,9 +138,9 @@ public: virtual void Reset(); private: - long double iirSampleA; - long double iirSampleB; - long double prevSample; + double iirSampleA; + double iirSampleB; + double prevSample; uint32_t fpd; bool flip; }; diff --git a/plugins/MacSignedAU/Srsly/Srsly.cpp b/plugins/MacSignedAU/Srsly/Srsly.cpp index cebfad04c..9d84ae7c3 100755 --- a/plugins/MacSignedAU/Srsly/Srsly.cpp +++ b/plugins/MacSignedAU/Srsly/Srsly.cpp @@ -237,7 +237,7 @@ OSStatus Srsly::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 sampleRate = GetSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -348,81 +348,81 @@ OSStatus Srsly::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //[10] is RIGHT stored delayed sample (you have to include the coefficient making code if you do that) while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; diff --git a/plugins/MacSignedAU/Srsly/Srsly.h b/plugins/MacSignedAU/Srsly/Srsly.h index 496cc13bd..e55bc155c 100755 --- a/plugins/MacSignedAU/Srsly/Srsly.h +++ b/plugins/MacSignedAU/Srsly/Srsly.h @@ -121,17 +121,17 @@ public: virtual ComponentResult Version() { return kSrslyVersion; } private: - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedAU/Srsly2/Srsly2.cpp b/plugins/MacSignedAU/Srsly2/Srsly2.cpp index 08788e247..76ade3510 100755 --- a/plugins/MacSignedAU/Srsly2/Srsly2.cpp +++ b/plugins/MacSignedAU/Srsly2/Srsly2.cpp @@ -237,7 +237,7 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 sampleRate = GetSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -353,10 +353,10 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //[10] is RIGHT stored delayed sample (you have to include the coefficient making code if you do that) while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *inputL; + double inputSampleR = *inputR; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -365,70 +365,70 @@ OSStatus Srsly2::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; diff --git a/plugins/MacSignedAU/Srsly2/Srsly2.h b/plugins/MacSignedAU/Srsly2/Srsly2.h index a4a7be92f..2b3da2226 100755 --- a/plugins/MacSignedAU/Srsly2/Srsly2.h +++ b/plugins/MacSignedAU/Srsly2/Srsly2.h @@ -121,17 +121,17 @@ public: virtual ComponentResult Version() { return kSrsly2Version; } private: - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedAU/StarChild/StarChild.cpp b/plugins/MacSignedAU/StarChild/StarChild.cpp index eec609800..258ccc4ac 100755 --- a/plugins/MacSignedAU/StarChild/StarChild.cpp +++ b/plugins/MacSignedAU/StarChild/StarChild.cpp @@ -238,8 +238,8 @@ ComponentResult StarChild::Reset(AudioUnitScope inScope, AudioUnitElement inEle increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -320,44 +320,8 @@ OSStatus StarChild::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla inputSampleL = *inputL; inputSampleR = *inputR; //assign working variables like the dry - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -634,7 +598,7 @@ OSStatus StarChild::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)drySampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); drySampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)drySampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/StarChild/StarChild.h b/plugins/MacSignedAU/StarChild/StarChild.h index 239daeff0..2efa380a8 100755 --- a/plugins/MacSignedAU/StarChild/StarChild.h +++ b/plugins/MacSignedAU/StarChild/StarChild.h @@ -133,8 +133,8 @@ private: Float64 wearLPrev; Float64 wearRPrev; - long double fpNShapeR; - long double fpNShapeL; + double fpNShapeR; + double fpNShapeL; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/StereoFX/StereoFX.cpp b/plugins/MacSignedAU/StereoFX/StereoFX.cpp index 63245e12a..bc94b2d6f 100755 --- a/plugins/MacSignedAU/StereoFX/StereoFX.cpp +++ b/plugins/MacSignedAU/StereoFX/StereoFX.cpp @@ -190,8 +190,8 @@ ComponentResult StereoFX::Reset(AudioUnitScope inScope, AudioUnitElement inElem iirSampleA = 0.0; iirSampleB = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -213,10 +213,10 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section Float64 stereowide = GetParameter( kParam_One ); Float64 centersquish = GetParameter( kParam_Three ); @@ -235,44 +235,8 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -333,7 +297,7 @@ OSStatus StereoFX::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/StereoFX/StereoFX.h b/plugins/MacSignedAU/StereoFX/StereoFX.h index a52f713d7..f7f216256 100755 --- a/plugins/MacSignedAU/StereoFX/StereoFX.h +++ b/plugins/MacSignedAU/StereoFX/StereoFX.h @@ -119,8 +119,8 @@ public: private: Float64 iirSampleA; Float64 iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; }; diff --git a/plugins/MacSignedAU/StudioTan/StudioTan.cpp b/plugins/MacSignedAU/StudioTan/StudioTan.cpp index f7b609274..9a19ea6e0 100755 --- a/plugins/MacSignedAU/StudioTan/StudioTan.cpp +++ b/plugins/MacSignedAU/StudioTan/StudioTan.cpp @@ -221,9 +221,9 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, } while (nSampleFrames-- > 0) { - long double inputSample; - long double outputSample; - long double drySample; + double inputSample; + double outputSample; + double drySample; if (highres) inputSample = *sourceP * 8388608.0; else inputSample = *sourceP * 32768.0; @@ -234,7 +234,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, cutbins = false; drySample = inputSample; inputSample -= noiseShaping; - long double benfordize = floor(inputSample); + double benfordize = floor(inputSample); while (benfordize >= 1.0) {benfordize /= 10;} if (benfordize < 1.0) {benfordize *= 10;} if (benfordize < 1.0) {benfordize *= 10;} @@ -243,7 +243,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { byn[hotbinA] += 1; @@ -270,7 +270,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { byn[hotbinB] += 1; @@ -334,7 +334,7 @@ void StudioTan::StudioTanKernel::Process( const Float32 *inSourceP, } //shared output stage - long double noiseSuppress = fabs(inputSample); + double noiseSuppress = fabs(inputSample); if (noiseShaping > noiseSuppress) noiseShaping = noiseSuppress; if (noiseShaping < -noiseSuppress) noiseShaping = -noiseSuppress; diff --git a/plugins/MacSignedAU/StudioTan/StudioTan.h b/plugins/MacSignedAU/StudioTan/StudioTan.h index 37a4d4316..79ab64d39 100755 --- a/plugins/MacSignedAU/StudioTan/StudioTan.h +++ b/plugins/MacSignedAU/StudioTan/StudioTan.h @@ -137,10 +137,10 @@ public: virtual void Reset(); private: - long double byn[13]; - long double noiseShaping; - long double lastSample; - long double lastSample2; + double byn[13]; + double noiseShaping; + double lastSample; + double lastSample2; }; }; diff --git a/plugins/MacSignedAU/SubsOnly/SubsOnly.cpp b/plugins/MacSignedAU/SubsOnly/SubsOnly.cpp index a8aefdc90..0efe70a30 100755 --- a/plugins/MacSignedAU/SubsOnly/SubsOnly.cpp +++ b/plugins/MacSignedAU/SubsOnly/SubsOnly.cpp @@ -176,7 +176,7 @@ void SubsOnly::SubsOnlyKernel::Reset() iirSampleX = 0.0; iirSampleY = 0.0; iirSampleZ = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -203,30 +203,7 @@ void SubsOnly::SubsOnlyKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; gain = gaintarget; inputSample *= gain; gain = ((gain-1)*0.75)+1; @@ -335,11 +312,11 @@ void SubsOnly::SubsOnlyKernel::Process( const Float32 *inSourceP, if (inputSample < -1.0) inputSample = -1.0; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; destP += inNumChannels; diff --git a/plugins/MacSignedAU/SubsOnly/SubsOnly.h b/plugins/MacSignedAU/SubsOnly/SubsOnly.h index a2efe962e..940157d56 100755 --- a/plugins/MacSignedAU/SubsOnly/SubsOnly.h +++ b/plugins/MacSignedAU/SubsOnly/SubsOnly.h @@ -147,7 +147,7 @@ public: Float64 iirSampleX; Float64 iirSampleY; Float64 iirSampleZ; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Surge/Surge.cpp b/plugins/MacSignedAU/Surge/Surge.cpp index 9c027b05b..7c2d54c3e 100755 --- a/plugins/MacSignedAU/Surge/Surge.cpp +++ b/plugins/MacSignedAU/Surge/Surge.cpp @@ -181,8 +181,8 @@ ComponentResult Surge::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Surge::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -208,10 +208,10 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 chaseMax = 0.0; Float64 intensity = (1.0-(pow((1.0-GetParameter( kParam_One )),2)))*0.7; @@ -224,44 +224,8 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -307,7 +271,7 @@ OSStatus Surge::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Surge/Surge.h b/plugins/MacSignedAU/Surge/Surge.h index 0d24ad77a..7649dcb58 100755 --- a/plugins/MacSignedAU/Surge/Surge.h +++ b/plugins/MacSignedAU/Surge/Surge.h @@ -112,13 +112,13 @@ public: virtual ComponentResult Version() { return kSurgeVersion; } private: - long double fpNShapeL; - long double fpNShapeR; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + uint32_t fpdL; + uint32_t fpdR; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/plugins/MacSignedAU/SurgeMono/SurgeMono.cpp b/plugins/MacSignedAU/SurgeMono/SurgeMono.cpp index 7e45015ca..01c0e868a 100755 --- a/plugins/MacSignedAU/SurgeMono/SurgeMono.cpp +++ b/plugins/MacSignedAU/SurgeMono/SurgeMono.cpp @@ -166,7 +166,7 @@ ComponentResult SurgeMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void SurgeMono::SurgeMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -186,11 +186,11 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 chaseMax = 0.0; Float64 intensity = (1.0-(pow((1.0-GetParameter( kParam_One )),2)))*0.7; Float64 attack = ((intensity+0.1)*0.0005)/overallscale; @@ -201,30 +201,7 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= 8.0; @@ -258,11 +235,11 @@ void SurgeMono::SurgeMonoKernel::Process( const Float32 *inSourceP, inputSample = drySample - (inputSample * intensity); inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/SurgeMono/SurgeMono.h b/plugins/MacSignedAU/SurgeMono/SurgeMono.h index 692d325c4..4ca90b8db 100755 --- a/plugins/MacSignedAU/SurgeMono/SurgeMono.h +++ b/plugins/MacSignedAU/SurgeMono/SurgeMono.h @@ -128,12 +128,12 @@ public: virtual void Reset(); private: - long double fpNShape; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + uint32_t fpd; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; }; }; diff --git a/plugins/MacSignedAU/SurgeTide/SurgeTide.cpp b/plugins/MacSignedAU/SurgeTide/SurgeTide.cpp index 696459100..eb52e3789 100755 --- a/plugins/MacSignedAU/SurgeTide/SurgeTide.cpp +++ b/plugins/MacSignedAU/SurgeTide/SurgeTide.cpp @@ -188,8 +188,8 @@ ComponentResult SurgeTide::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult SurgeTide::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -213,10 +213,10 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; Float64 intensity = GetParameter( kParam_One ); Float64 attack = ((GetParameter( kParam_Two )+0.1)*0.0005)/overallscale; @@ -229,44 +229,8 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -304,7 +268,7 @@ OSStatus SurgeTide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFla //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/SurgeTide/SurgeTide.h b/plugins/MacSignedAU/SurgeTide/SurgeTide.h index a72f6c64a..21a482e11 100755 --- a/plugins/MacSignedAU/SurgeTide/SurgeTide.h +++ b/plugins/MacSignedAU/SurgeTide/SurgeTide.h @@ -115,11 +115,11 @@ public: virtual ComponentResult Version() { return kSurgeTideVersion; } private: - long double fpNShapeL; - long double fpNShapeR; - long double chaseA; - long double chaseB; - long double chaseC; + double fpNShapeL; + double fpNShapeR; + double chaseA; + double chaseB; + double chaseC; }; diff --git a/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.cpp b/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.cpp index 2b7f2a874..f8776783f 100755 --- a/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.cpp +++ b/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.cpp @@ -174,7 +174,7 @@ ComponentResult SurgeTideMono::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void SurgeTideMono::SurgeTideMonoKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; chaseA = 0.0; chaseB = 0.0; chaseC = 0.0; @@ -192,11 +192,11 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 intensity = GetParameter( kParam_One ); Float64 attack = ((GetParameter( kParam_Two )+0.1)*0.0005)/overallscale; Float64 decay = ((GetParameter( kParam_Two )+0.001)*0.00005)/overallscale; @@ -206,30 +206,7 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; inputSample *= 8.0; @@ -255,11 +232,11 @@ void SurgeTideMono::SurgeTideMonoKernel::Process( const Float32 *inSourceP, inputSample = drySample - (inputSample * intensity); inputSample = (drySample * dry) + (inputSample * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.h b/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.h index 067d2e586..e173f6ff8 100755 --- a/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.h +++ b/plugins/MacSignedAU/SurgeTideMono/SurgeTideMono.h @@ -131,10 +131,10 @@ public: virtual void Reset(); private: - long double fpNShape; - long double chaseA; - long double chaseB; - long double chaseC; + uint32_t fpd; + double chaseA; + double chaseB; + double chaseC; }; }; diff --git a/plugins/MacSignedAU/Swell/Swell.cpp b/plugins/MacSignedAU/Swell/Swell.cpp index 0015ddcab..0cc8d38e4 100755 --- a/plugins/MacSignedAU/Swell/Swell.cpp +++ b/plugins/MacSignedAU/Swell/Swell.cpp @@ -176,7 +176,7 @@ void Swell::SwellKernel::Reset() { swell = 0.0; louder = false; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -191,7 +191,7 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); Float64 thresholdOn = pow(GetParameter( kParam_One ),2) * GetParameter( kParam_Two ); @@ -201,35 +201,12 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Three ); Float64 dry = 1.0 - wet; - long double drySample; - long double inputSample; + double drySample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; @@ -245,11 +222,11 @@ void Swell::SwellKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/Swell/Swell.h b/plugins/MacSignedAU/Swell/Swell.h index fa354364e..75bff1357 100755 --- a/plugins/MacSignedAU/Swell/Swell.h +++ b/plugins/MacSignedAU/Swell/Swell.h @@ -132,9 +132,9 @@ public: private: - long double swell; + double swell; bool louder; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/TPDFDither/TPDFDither.cpp b/plugins/MacSignedAU/TPDFDither/TPDFDither.cpp index a560742ac..1e18945a5 100755 --- a/plugins/MacSignedAU/TPDFDither/TPDFDither.cpp +++ b/plugins/MacSignedAU/TPDFDither/TPDFDither.cpp @@ -197,7 +197,7 @@ void TPDFDither::TPDFDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; bool highres = false; if (GetParameter( kParam_One ) == 1) highres = true; @@ -213,7 +213,7 @@ void TPDFDither::TPDFDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; inputSample *= scaleFactor; diff --git a/plugins/MacSignedAU/TPDFWide/TPDFWide.cpp b/plugins/MacSignedAU/TPDFWide/TPDFWide.cpp index cf505c6e5..1bba410f4 100644 --- a/plugins/MacSignedAU/TPDFWide/TPDFWide.cpp +++ b/plugins/MacSignedAU/TPDFWide/TPDFWide.cpp @@ -227,8 +227,8 @@ OSStatus TPDFWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag if (outScale < 8.0) outScale = 8.0; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -238,12 +238,12 @@ OSStatus TPDFWide::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/MacSignedAU/Tape/Tape.cpp b/plugins/MacSignedAU/Tape/Tape.cpp index 7f6eb66eb..cf3ff2196 100755 --- a/plugins/MacSignedAU/Tape/Tape.cpp +++ b/plugins/MacSignedAU/Tape/Tape.cpp @@ -188,7 +188,7 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -219,18 +219,18 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, biquadC[6] = biquadD[6] = (1.0 - K / biquadD[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputgain < 1.0) { inputSample *= inputgain; } //gain cut before anything, even dry - long double drySample = inputSample; + double drySample = inputSample; - long double HighsSample = 0.0; - long double NonHighsSample = 0.0; - long double tempSample; + double HighsSample = 0.0; + double NonHighsSample = 0.0; + double tempSample; if (flip) { @@ -284,13 +284,13 @@ void Tape::TapeKernel::Process( const Float32 *inSourceP, } flip = !flip; - long double groundSample = drySample - inputSample; //set up UnBox + double groundSample = drySample - inputSample; //set up UnBox if (inputgain > 1.0) { inputSample *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSample)*1.57079633; + double applySoften = fabs(HighsSample)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSample > 0) inputSample -= applySoften; diff --git a/plugins/MacSignedAU/Tape/Tape.h b/plugins/MacSignedAU/Tape/Tape.h index 2aa9a8fe1..ed866e5c4 100755 --- a/plugins/MacSignedAU/Tape/Tape.h +++ b/plugins/MacSignedAU/Tape/Tape.h @@ -132,11 +132,11 @@ public: Float64 iirHeadBumpA; Float64 iirHeadBumpB; bool flip; - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double biquadD[9]; - long double lastSample; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double biquadD[9]; + double lastSample; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/TapeDelay/TapeDelay.cpp b/plugins/MacSignedAU/TapeDelay/TapeDelay.cpp index fdc72f221..7eb7bcce4 100755 --- a/plugins/MacSignedAU/TapeDelay/TapeDelay.cpp +++ b/plugins/MacSignedAU/TapeDelay/TapeDelay.cpp @@ -205,7 +205,7 @@ void TapeDelay::TapeDelayKernel::Reset() delay = 0; gcount = 0; chase = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -235,27 +235,9 @@ void TapeDelay::TapeDelayKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 128) {gcount = 128;} count = gcount; @@ -322,11 +304,11 @@ void TapeDelay::TapeDelayKernel::Process( const Float32 *inSourceP, //yes this is a second bounds check. it's cheap, check EVERY time inputSample = (inputSample * dry) + (d[delay] * wet); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/TapeDelay/TapeDelay.h b/plugins/MacSignedAU/TapeDelay/TapeDelay.h index 9d9440e23..7b99c60b0 100755 --- a/plugins/MacSignedAU/TapeDelay/TapeDelay.h +++ b/plugins/MacSignedAU/TapeDelay/TapeDelay.h @@ -148,7 +148,7 @@ public: int delay; int maxdelay; int chase; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/TapeDelay2/TapeDelay2.cpp b/plugins/MacSignedAU/TapeDelay2/TapeDelay2.cpp index 5f60fdb49..2a0ae9841 100644 --- a/plugins/MacSignedAU/TapeDelay2/TapeDelay2.cpp +++ b/plugins/MacSignedAU/TapeDelay2/TapeDelay2.cpp @@ -221,7 +221,7 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -270,8 +270,8 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; cycle++; @@ -281,7 +281,7 @@ void TapeDelay2::TapeDelay2Kernel::Process( const Float32 *inSourceP, int pos = floor(delay); Float64 newSample = inputSample + d[pos]*feedback; - long double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; + double tempSample = (newSample * regenFilter[2]) + regenFilter[7]; regenFilter[7] = -(tempSample * regenFilter[5]) + regenFilter[8]; regenFilter[8] = (newSample * regenFilter[4]) - (tempSample * regenFilter[6]); newSample = tempSample; diff --git a/plugins/MacSignedAU/TapeDelay2/TapeDelay2.h b/plugins/MacSignedAU/TapeDelay2/TapeDelay2.h index f13708fae..ab82a395f 100644 --- a/plugins/MacSignedAU/TapeDelay2/TapeDelay2.h +++ b/plugins/MacSignedAU/TapeDelay2/TapeDelay2.h @@ -145,8 +145,8 @@ public: Float64 prevSample; Float64 delay; Float64 sweep; - long double regenFilter[9]; - long double outFilter[9]; + double regenFilter[9]; + double outFilter[9]; double lastRef[10]; int cycle; uint32_t fpd; diff --git a/plugins/MacSignedAU/TapeDither/TapeDither.cpp b/plugins/MacSignedAU/TapeDither/TapeDither.cpp index 2430f2ec3..9c392a7ca 100755 --- a/plugins/MacSignedAU/TapeDither/TapeDither.cpp +++ b/plugins/MacSignedAU/TapeDither/TapeDither.cpp @@ -201,7 +201,7 @@ void TapeDither::TapeDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 currentDither; bool highres = false; @@ -217,7 +217,7 @@ void TapeDither::TapeDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacSignedAU/TapeDust/TapeDust.cpp b/plugins/MacSignedAU/TapeDust/TapeDust.cpp index 9764282e0..688866264 100755 --- a/plugins/MacSignedAU/TapeDust/TapeDust.cpp +++ b/plugins/MacSignedAU/TapeDust/TapeDust.cpp @@ -167,7 +167,7 @@ ComponentResult TapeDust::Initialize() void TapeDust::TapeDustKernel::Reset() { for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; fpFlip = false; } @@ -183,7 +183,7 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 drySample; Float64 rRange = pow(GetParameter( kParam_One ),2)*5.0; Float64 xfuzz = rRange * 0.002; @@ -195,30 +195,7 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; for(int count = 9; count < 0; count--) { @@ -248,11 +225,11 @@ void TapeDust::TapeDustKernel::Process( const Float32 *inSourceP, } fpFlip = !fpFlip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/TapeDust/TapeDust.h b/plugins/MacSignedAU/TapeDust/TapeDust.h index 6898d7e27..2a992c3d2 100755 --- a/plugins/MacSignedAU/TapeDust/TapeDust.h +++ b/plugins/MacSignedAU/TapeDust/TapeDust.h @@ -130,7 +130,7 @@ public: private: Float64 b[11]; Float64 f[11]; - long double fpNShape; + uint32_t fpd; bool fpFlip; }; }; diff --git a/plugins/MacSignedAU/TapeFat/TapeFat.cpp b/plugins/MacSignedAU/TapeFat/TapeFat.cpp index d001b3b65..f5b4a217c 100755 --- a/plugins/MacSignedAU/TapeFat/TapeFat.cpp +++ b/plugins/MacSignedAU/TapeFat/TapeFat.cpp @@ -169,7 +169,7 @@ void TapeFat::TapeFatKernel::Reset() { for (int count = 0; count < 257; count++) {p[count] = 0;} gcount = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,27 +193,9 @@ void TapeFat::TapeFatKernel::Process( const Float32 *inSourceP, int count; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (gcount < 0 || gcount > 128) {gcount = 128;} count = gcount; @@ -263,11 +245,11 @@ void TapeFat::TapeFatKernel::Process( const Float32 *inSourceP, gcount--; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/TapeFat/TapeFat.h b/plugins/MacSignedAU/TapeFat/TapeFat.h index 07e0ae1e0..10bd95d40 100755 --- a/plugins/MacSignedAU/TapeFat/TapeFat.h +++ b/plugins/MacSignedAU/TapeFat/TapeFat.h @@ -132,7 +132,7 @@ public: private: int p[257]; int gcount; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Thunder/Thunder.cpp b/plugins/MacSignedAU/Thunder/Thunder.cpp index 5e4bcde5b..8fa23113b 100755 --- a/plugins/MacSignedAU/Thunder/Thunder.cpp +++ b/plugins/MacSignedAU/Thunder/Thunder.cpp @@ -179,8 +179,8 @@ ComponentResult Thunder::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ComponentResult Thunder::Reset(AudioUnitScope inScope, AudioUnitElement inElement) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; @@ -238,50 +238,14 @@ OSStatus Thunder::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags Float64 resultML; Float64 resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -422,7 +386,7 @@ OSStatus Thunder::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Thunder/Thunder.h b/plugins/MacSignedAU/Thunder/Thunder.h index 233c3db28..ca1606fe5 100755 --- a/plugins/MacSignedAU/Thunder/Thunder.h +++ b/plugins/MacSignedAU/Thunder/Thunder.h @@ -129,8 +129,8 @@ private: Float64 iirSampleAM; Float64 iirSampleBM; Float64 iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; }; diff --git a/plugins/MacSignedAU/ToTape5/ToTape5.cpp b/plugins/MacSignedAU/ToTape5/ToTape5.cpp index 14d957506..82cdeae48 100755 --- a/plugins/MacSignedAU/ToTape5/ToTape5.cpp +++ b/plugins/MacSignedAU/ToTape5/ToTape5.cpp @@ -238,7 +238,7 @@ void ToTape5::ToTape5Kernel::Reset() sweep = 0.0; rateof = 0.5; nextmax = 0.5; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -256,7 +256,7 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! Float64 inputgain = pow(GetParameter( kParam_One )+1.0,3); Float64 outputgain = GetParameter( kParam_Five ); @@ -294,34 +294,11 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, SInt32 count; Float64 tempSample; Float64 drySample; - long double inputSample; + double inputSample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; flutterrandy = (rand()/(double)RAND_MAX); @@ -472,11 +449,11 @@ void ToTape5::ToTape5Kernel::Process( const Float32 *inSourceP, } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/ToTape5/ToTape5.h b/plugins/MacSignedAU/ToTape5/ToTape5.h index 250d9a56a..987ed190e 100755 --- a/plugins/MacSignedAU/ToTape5/ToTape5.h +++ b/plugins/MacSignedAU/ToTape5/ToTape5.h @@ -185,7 +185,7 @@ public: Float64 iirSampleY; Float64 iirSampleZ; int flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ToTape6/ToTape6.cpp b/plugins/MacSignedAU/ToTape6/ToTape6.cpp index e6d103543..73842ce1e 100755 --- a/plugins/MacSignedAU/ToTape6/ToTape6.cpp +++ b/plugins/MacSignedAU/ToTape6/ToTape6.cpp @@ -225,7 +225,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -264,9 +264,9 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Six ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (inputgain < 1.0) { inputSample *= inputgain; @@ -280,7 +280,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSample = (d[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -297,10 +297,10 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, } gcount--; - long double vibDrySample = inputSample; - long double HighsSample = 0.0; - long double NonHighsSample = 0.0; - long double tempSample; + double vibDrySample = inputSample; + double HighsSample = 0.0; + double NonHighsSample = 0.0; + double tempSample; if (flip) { @@ -354,13 +354,13 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, } flip = !flip; - long double groundSample = vibDrySample - inputSample; //set up UnBox on fluttered audio + double groundSample = vibDrySample - inputSample; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSample *= inputgain; } //gain boost inside UnBox/Mojo - long double applySoften = fabs(HighsSample)*1.57079633; + double applySoften = fabs(HighsSample)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSample > 0) inputSample -= applySoften; @@ -379,7 +379,7 @@ void ToTape6::ToTape6Kernel::Process( const Float32 *inSourceP, if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; - long double mojo; mojo = pow(fabs(inputSample),0.25); + double mojo; mojo = pow(fabs(inputSample),0.25); if (mojo > 0.0) inputSample = (sin(inputSample * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacSignedAU/ToTape6/ToTape6.h b/plugins/MacSignedAU/ToTape6/ToTape6.h index 6c13952a5..249f804cf 100755 --- a/plugins/MacSignedAU/ToTape6/ToTape6.h +++ b/plugins/MacSignedAU/ToTape6/ToTape6.h @@ -149,12 +149,12 @@ public: Float64 iirMidRollerB; Float64 iirHeadBumpA; Float64 iirHeadBumpB; - long double biquadA[9]; - long double biquadB[9]; - long double biquadC[9]; - long double biquadD[9]; + double biquadA[9]; + double biquadB[9]; + double biquadC[9]; + double biquadD[9]; bool flip; - long double lastSample; + double lastSample; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ToVinyl4/ToVinyl4.cpp b/plugins/MacSignedAU/ToVinyl4/ToVinyl4.cpp index 727b7d9c0..0cab0cbb5 100755 --- a/plugins/MacSignedAU/ToVinyl4/ToVinyl4.cpp +++ b/plugins/MacSignedAU/ToVinyl4/ToVinyl4.cpp @@ -270,8 +270,8 @@ ComponentResult ToVinyl4::Reset(AudioUnitScope inScope, AudioUnitElement inElem s1R = s2R = s3R = 0.0; o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; @@ -490,44 +490,8 @@ OSStatus ToVinyl4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -736,7 +700,7 @@ OSStatus ToVinyl4::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlag //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/ToneSlant/ToneSlant.cpp b/plugins/MacSignedAU/ToneSlant/ToneSlant.cpp index 89b364a32..2f809e043 100755 --- a/plugins/MacSignedAU/ToneSlant/ToneSlant.cpp +++ b/plugins/MacSignedAU/ToneSlant/ToneSlant.cpp @@ -168,7 +168,7 @@ ComponentResult ToneSlant::Initialize() void ToneSlant::ToneSlantKernel::Reset() { for(int count = 0; count < 102; count++) {b[count] = 0.0; f[count] = 0.0;} - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -206,30 +206,7 @@ void ToneSlant::ToneSlantKernel::Process( const Float32 *inSourceP, for (int count = overallscale; count >= 0; count--) b[count+1] = b[count]; inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; b[0] = accumulatorSample = drySample = inputSample; @@ -242,11 +219,11 @@ void ToneSlant::ToneSlantKernel::Process( const Float32 *inSourceP, inputSample += (correctionSample * applySlant); //our one math operation on the input data coming in - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/ToneSlant/ToneSlant.h b/plugins/MacSignedAU/ToneSlant/ToneSlant.h index 8f94128fe..9a33b8985 100755 --- a/plugins/MacSignedAU/ToneSlant/ToneSlant.h +++ b/plugins/MacSignedAU/ToneSlant/ToneSlant.h @@ -131,7 +131,7 @@ public: private: Float64 b[102]; Float64 f[102]; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/TransDesk/TransDesk.cpp b/plugins/MacSignedAU/TransDesk/TransDesk.cpp index 4991a59a9..f90d82441 100755 --- a/plugins/MacSignedAU/TransDesk/TransDesk.cpp +++ b/plugins/MacSignedAU/TransDesk/TransDesk.cpp @@ -157,7 +157,7 @@ void TransDesk::TransDeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -198,35 +198,12 @@ void TransDesk::TransDeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 9) {gcount = 9;} @@ -294,7 +271,7 @@ void TransDesk::TransDeskKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/TransDesk/TransDesk.h b/plugins/MacSignedAU/TransDesk/TransDesk.h index 74799368c..d619f2855 100755 --- a/plugins/MacSignedAU/TransDesk/TransDesk.h +++ b/plugins/MacSignedAU/TransDesk/TransDesk.h @@ -120,8 +120,8 @@ public: Float64 d[20]; Float64 control; int gcount; - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; Float64 fpNShape; }; diff --git a/plugins/MacSignedAU/TremoSquare/TremoSquare.cpp b/plugins/MacSignedAU/TremoSquare/TremoSquare.cpp index a94ff0e47..6e3d98346 100755 --- a/plugins/MacSignedAU/TremoSquare/TremoSquare.cpp +++ b/plugins/MacSignedAU/TremoSquare/TremoSquare.cpp @@ -184,7 +184,7 @@ void TremoSquare::TremoSquareKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -192,8 +192,8 @@ void TremoSquare::TremoSquareKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Two ); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; osc += increment; if (osc > 1.0) osc = 0.0; diff --git a/plugins/MacSignedAU/Tremolo/Tremolo.cpp b/plugins/MacSignedAU/Tremolo/Tremolo.cpp index 3085ca8e1..d027fb8b5 100755 --- a/plugins/MacSignedAU/Tremolo/Tremolo.cpp +++ b/plugins/MacSignedAU/Tremolo/Tremolo.cpp @@ -173,7 +173,7 @@ void Tremolo::TremoloKernel::Reset() depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -206,8 +206,8 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, Float64 density; Float64 tupi = 3.141592653589793238; - long double inputSample; - long double drySample; + double inputSample; + double drySample; Float64 control; Float64 tempcontrol; Float64 thickness; @@ -217,30 +217,7 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; speedAmount = (((speedAmount*speedSpeed)+speedChase)/(speedSpeed + 1.0)); @@ -284,11 +261,11 @@ void Tremolo::TremoloKernel::Process( const Float32 *inSourceP, //apply tremolo, apply gain boost to compensate for volume loss inputSample = (drySample * (1-depth)) + (inputSample*depth); - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; destP += inNumChannels; diff --git a/plugins/MacSignedAU/TripleSpread/TripleSpread.cpp b/plugins/MacSignedAU/TripleSpread/TripleSpread.cpp index fa7f8c5e3..33e4979c3 100755 --- a/plugins/MacSignedAU/TripleSpread/TripleSpread.cpp +++ b/plugins/MacSignedAU/TripleSpread/TripleSpread.cpp @@ -250,12 +250,12 @@ OSStatus TripleSpread::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -520,8 +520,8 @@ OSStatus TripleSpread::ProcessBufferLists(AudioUnitRenderActionFlags & ioAction thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/MacSignedAU/Tube/Tube.cpp b/plugins/MacSignedAU/Tube/Tube.cpp index 165e2f0c3..d1cde4513 100644 --- a/plugins/MacSignedAU/Tube/Tube.cpp +++ b/plugins/MacSignedAU/Tube/Tube.cpp @@ -175,7 +175,7 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -193,11 +193,11 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, double outputscaling = 1.0 + (1.0/(double)(powerfactor)); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleA; previousSampleA = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average @@ -227,7 +227,7 @@ void Tube::TubeKernel::Process( const Float32 *inSourceP, */ if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleB; previousSampleB = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average diff --git a/plugins/MacSignedAU/Tube/Tube.h b/plugins/MacSignedAU/Tube/Tube.h index 16413545f..6cde991fe 100644 --- a/plugins/MacSignedAU/Tube/Tube.h +++ b/plugins/MacSignedAU/Tube/Tube.h @@ -125,8 +125,8 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousSampleB; + double previousSampleA; + double previousSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Tube2/Tube2.cpp b/plugins/MacSignedAU/Tube2/Tube2.cpp index b49b472d2..c63039756 100644 --- a/plugins/MacSignedAU/Tube2/Tube2.cpp +++ b/plugins/MacSignedAU/Tube2/Tube2.cpp @@ -184,7 +184,7 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -196,13 +196,13 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, double outputscaling = 1.0 + (1.0/(double)(powerfactor)); while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; if (inputPad < 1.0) inputSample *= inputPad; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleA; previousSampleA = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average @@ -211,7 +211,7 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, //flatten bottom, point top of sine waveshaper inputSample /= asymPad; - long double sharpen = -inputSample; + double sharpen = -inputSample; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSample -= inputSample*fabs(inputSample)*sharpen*0.25; @@ -228,15 +228,15 @@ void Tube2::Tube2Kernel::Process( const Float32 *inSourceP, inputSample *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleB; previousSampleB = stored; inputSample *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz - long double slew = previousSampleC - inputSample; + double slew = previousSampleC - inputSample; if (overallscale > 1.9) { - long double stored = inputSample; + double stored = inputSample; inputSample += previousSampleC; previousSampleC = stored; inputSample *= 0.5; } else previousSampleC = inputSample; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); diff --git a/plugins/MacSignedAU/Tube2/Tube2.h b/plugins/MacSignedAU/Tube2/Tube2.h index 36e9ca34b..a2ff1681f 100644 --- a/plugins/MacSignedAU/Tube2/Tube2.h +++ b/plugins/MacSignedAU/Tube2/Tube2.h @@ -128,9 +128,9 @@ public: virtual void Reset(); private: - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; + double previousSampleA; + double previousSampleB; + double previousSampleC; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/TubeDesk/TubeDesk.cpp b/plugins/MacSignedAU/TubeDesk/TubeDesk.cpp index bde95ce4e..e04e599dc 100755 --- a/plugins/MacSignedAU/TubeDesk/TubeDesk.cpp +++ b/plugins/MacSignedAU/TubeDesk/TubeDesk.cpp @@ -157,7 +157,7 @@ void TubeDesk::TubeDeskKernel::Reset() lastSample = 0.0; lastOutSample = 0.0; lastSlew = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -196,35 +196,12 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, Float64 slew; Float64 bridgerectifier; Float64 combSample; - long double inputSample; - long double drySample; + double inputSample; + double drySample; while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; drySample = inputSample; if (gcount < 0 || gcount > 2450) {gcount = 2450;} @@ -292,7 +269,7 @@ void TubeDesk::TubeDeskKernel::Process( const Float32 *inSourceP, //32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSample += (dither-fpNShape); fpNShape = dither; //end 32 bit dither diff --git a/plugins/MacSignedAU/TubeDesk/TubeDesk.h b/plugins/MacSignedAU/TubeDesk/TubeDesk.h index 393c14bad..bf44ecfd4 100755 --- a/plugins/MacSignedAU/TubeDesk/TubeDesk.h +++ b/plugins/MacSignedAU/TubeDesk/TubeDesk.h @@ -121,8 +121,8 @@ public: Float64 d[5000]; Float64 control; int gcount; - long double lastSample; - long double lastOutSample; + double lastSample; + double lastOutSample; Float64 lastSlew; Float64 fpNShape; }; diff --git a/plugins/MacSignedAU/UltrasonX/UltrasonX.cpp b/plugins/MacSignedAU/UltrasonX/UltrasonX.cpp index 3e92d2e33..657600387 100644 --- a/plugins/MacSignedAU/UltrasonX/UltrasonX.cpp +++ b/plugins/MacSignedAU/UltrasonX/UltrasonX.cpp @@ -214,8 +214,8 @@ void UltrasonX::UltrasonXKernel::Process( const Float32 *inSourceP, break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -224,10 +224,10 @@ void UltrasonX::UltrasonXKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double temp = (inputSample * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSample * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSample * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSample * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSample = temp; //fixed biquad filtering ultrasonics diff --git a/plugins/MacSignedAU/UltrasonX/UltrasonX.h b/plugins/MacSignedAU/UltrasonX/UltrasonX.h index 1541107a4..6db40d451 100644 --- a/plugins/MacSignedAU/UltrasonX/UltrasonX.h +++ b/plugins/MacSignedAU/UltrasonX/UltrasonX.h @@ -148,7 +148,7 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Ultrasonic/Ultrasonic.cpp b/plugins/MacSignedAU/Ultrasonic/Ultrasonic.cpp index ba5c97e9b..188106583 100755 --- a/plugins/MacSignedAU/Ultrasonic/Ultrasonic.cpp +++ b/plugins/MacSignedAU/Ultrasonic/Ultrasonic.cpp @@ -215,10 +215,10 @@ void Ultrasonic::UltrasonicKernel::Process( const Float32 *inSourceP, biquadE[6] = (1.0 - K / biquadE[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/Ultrasonic/Ultrasonic.h b/plugins/MacSignedAU/Ultrasonic/Ultrasonic.h index cf23e6f62..86605a999 100755 --- a/plugins/MacSignedAU/Ultrasonic/Ultrasonic.h +++ b/plugins/MacSignedAU/Ultrasonic/Ultrasonic.h @@ -121,11 +121,11 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.cpp b/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.cpp index 04199522e..e4924ac31 100644 --- a/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.cpp +++ b/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.cpp @@ -180,10 +180,10 @@ void UltrasonicLite::UltrasonicLiteKernel::Process( const Float32 *inSourceP, biquadA[6] = (1.0 - K / biquadA[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.h b/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.h index c8f236689..09ffe44fe 100644 --- a/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.h +++ b/plugins/MacSignedAU/UltrasonicLite/UltrasonicLite.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double biquadA[11]; + double biquadA[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.cpp b/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.cpp index 1fd4a6672..9c03730c8 100644 --- a/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.cpp +++ b/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.cpp @@ -193,10 +193,10 @@ void UltrasonicMed::UltrasonicMedKernel::Process( const Float32 *inSourceP, biquadB[6] = (1.0 - K / biquadB[1] + K * K) * norm; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSample+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSample; inputSample = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSample; //DF1 diff --git a/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.h b/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.h index fb57a5012..2e4d59615 100644 --- a/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.h +++ b/plugins/MacSignedAU/UltrasonicMed/UltrasonicMed.h @@ -121,8 +121,8 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; + double biquadA[11]; + double biquadB[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/UnBox/UnBox.cpp b/plugins/MacSignedAU/UnBox/UnBox.cpp index 870d92176..1b85e1c99 100755 --- a/plugins/MacSignedAU/UnBox/UnBox.cpp +++ b/plugins/MacSignedAU/UnBox/UnBox.cpp @@ -193,7 +193,7 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,12 +247,12 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (input != 1.0) inputSample *= input; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; a[4] = a[3]; a[3] = a[2]; a[2] = a[1]; a[1] = a[0]; a[0] = inputSample; @@ -280,7 +280,7 @@ void UnBox::UnBoxKernel::Process( const Float32 *inSourceP, inputSample /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSample = (drySample - inputSample); + double accumulatorSample = (drySample - inputSample); c[9] = c[8]; c[8] = c[7]; c[7] = c[6]; c[6] = c[5]; c[5] = c[4]; c[4] = c[3]; c[3] = c[2]; c[2] = c[1]; c[1] = c[0]; c[0] = accumulatorSample; diff --git a/plugins/MacSignedAU/UnBox/UnBox.h b/plugins/MacSignedAU/UnBox/UnBox.h index 570a65efe..c7832d04d 100755 --- a/plugins/MacSignedAU/UnBox/UnBox.h +++ b/plugins/MacSignedAU/UnBox/UnBox.h @@ -130,13 +130,13 @@ public: virtual void Reset(); private: - long double a[5]; - long double b[5]; - long double c[11]; - long double e[5]; - long double f[11]; - long double iirSampleA; - long double iirSampleB; + double a[5]; + double b[5]; + double c[11]; + double e[5]; + double f[11]; + double iirSampleA; + double iirSampleB; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/VariMu/VariMu.cpp b/plugins/MacSignedAU/VariMu/VariMu.cpp index 647c36cd1..d94e9ab3f 100755 --- a/plugins/MacSignedAU/VariMu/VariMu.cpp +++ b/plugins/MacSignedAU/VariMu/VariMu.cpp @@ -189,7 +189,7 @@ void VariMu::VariMuKernel::Reset() muVary = 1; flip = false; previous = 0.0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -220,32 +220,14 @@ void VariMu::VariMuKernel::Process( const Float32 *inSourceP, Float64 coefficient; Float64 output = outGain * GetParameter( kParam_Three ); Float64 wet = GetParameter( kParam_Four ); - long double squaredSample; + double squaredSample; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (fabs(inputSample) > fabs(previous)) squaredSample = previous * previous; else squaredSample = inputSample * inputSample; @@ -331,11 +313,11 @@ void VariMu::VariMuKernel::Process( const Float32 *inSourceP, //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/VariMu/VariMu.h b/plugins/MacSignedAU/VariMu/VariMu.h index 9428e1ece..3ba594ad5 100755 --- a/plugins/MacSignedAU/VariMu/VariMu.h +++ b/plugins/MacSignedAU/VariMu/VariMu.h @@ -142,7 +142,7 @@ public: Float64 muCoefficientB; Float64 previous; bool flip; - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/Verbity/Verbity.cpp b/plugins/MacSignedAU/Verbity/Verbity.cpp index 12f0a83ea..27327b68c 100755 --- a/plugins/MacSignedAU/Verbity/Verbity.cpp +++ b/plugins/MacSignedAU/Verbity/Verbity.cpp @@ -246,7 +246,7 @@ void Verbity::VerbityKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); int cycleEnd = floor(overallscale); @@ -286,8 +286,8 @@ void Verbity::VerbityKernel::Process( const Float32 *inSourceP, delayH = 1597.0*size; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (fabs(iirA)<1.18e-37) iirA = 0.0; diff --git a/plugins/MacSignedAU/Vibrato/Vibrato.cpp b/plugins/MacSignedAU/Vibrato/Vibrato.cpp index d8c396ace..a8e1409e4 100755 --- a/plugins/MacSignedAU/Vibrato/Vibrato.cpp +++ b/plugins/MacSignedAU/Vibrato/Vibrato.cpp @@ -222,8 +222,8 @@ void Vibrato::VibratoKernel::Process( const Float32 *inSourceP, Float64 wet = GetParameter( kParam_Five ); //note: inv/dry/wet while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; airFactor = airPrev - inputSample; diff --git a/plugins/MacSignedAU/VinylDither/VinylDither.cpp b/plugins/MacSignedAU/VinylDither/VinylDither.cpp index 3f48f5faa..a6651dc32 100755 --- a/plugins/MacSignedAU/VinylDither/VinylDither.cpp +++ b/plugins/MacSignedAU/VinylDither/VinylDither.cpp @@ -215,7 +215,7 @@ void VinylDither::VinylDitherKernel::Process( const Float32 *inSourceP, const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double inputSample; + double inputSample; Float64 absSample; bool highres = false; @@ -232,7 +232,7 @@ void VinylDither::VinylDitherKernel::Process( const Float32 *inSourceP, while (nSampleFrames-- > 0) { inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; diff --git a/plugins/MacSignedAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp b/plugins/MacSignedAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp index b067c2c55..706da8d5f 100755 --- a/plugins/MacSignedAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp +++ b/plugins/MacSignedAU/VoiceOfTheStarship/VoiceOfTheStarship.cpp @@ -175,7 +175,7 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Reset() filterflip = false; for(int count = 0; count < 11; count++) {b[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -318,11 +318,11 @@ void VoiceOfTheStarship::VoiceOfTheStarshipKernel::Process( const Float32 *inS flip = !flip; filterflip = !filterflip; - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; sourceP += inNumChannels; diff --git a/plugins/MacSignedAU/VoiceTrick/VoiceTrick.cpp b/plugins/MacSignedAU/VoiceTrick/VoiceTrick.cpp index a1989930f..1f02c4273 100755 --- a/plugins/MacSignedAU/VoiceTrick/VoiceTrick.cpp +++ b/plugins/MacSignedAU/VoiceTrick/VoiceTrick.cpp @@ -209,8 +209,8 @@ OSStatus VoiceTrick::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl Float64 invLowpass; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,7 +218,7 @@ OSStatus VoiceTrick::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFl //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/MacSignedAU/Wider/Wider.cpp b/plugins/MacSignedAU/Wider/Wider.cpp index 83a0c92ad..d5cbf77ca 100755 --- a/plugins/MacSignedAU/Wider/Wider.cpp +++ b/plugins/MacSignedAU/Wider/Wider.cpp @@ -189,8 +189,8 @@ ComponentResult Wider::Reset(AudioUnitScope inScope, AudioUnitElement inElement { for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; return noErr; } @@ -212,12 +212,12 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, Float64 overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; Float64 drySampleL; Float64 drySampleR; - long double mid; - long double side; + double mid; + double side; Float64 out; Float64 densityside = GetParameter( kParam_One ); Float64 densitymid = GetParameter( kParam_Two ); @@ -240,44 +240,8 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, while (nSampleFrames-- > 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -334,7 +298,7 @@ OSStatus Wider::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, //stereo 32 bit dither, made small and tidy. int expon; frexpf((Float32)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((Float32)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); diff --git a/plugins/MacSignedAU/Wider/Wider.h b/plugins/MacSignedAU/Wider/Wider.h index 5d5608fdc..f4788781f 100755 --- a/plugins/MacSignedAU/Wider/Wider.h +++ b/plugins/MacSignedAU/Wider/Wider.h @@ -118,8 +118,8 @@ public: private: Float64 p[4099]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; int count; }; diff --git a/plugins/MacSignedAU/XBandpass/XBandpass.cpp b/plugins/MacSignedAU/XBandpass/XBandpass.cpp index 8a1c2613b..5644cb1fe 100644 --- a/plugins/MacSignedAU/XBandpass/XBandpass.cpp +++ b/plugins/MacSignedAU/XBandpass/XBandpass.cpp @@ -231,18 +231,18 @@ void XBandpass::XBandpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; inputSample *= clipFactor; outSample = biquad[2]*inputSample+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; diff --git a/plugins/MacSignedAU/XBandpass/XBandpass.h b/plugins/MacSignedAU/XBandpass/XBandpass.h index 2d4995cdd..d6e5dddcd 100644 --- a/plugins/MacSignedAU/XBandpass/XBandpass.h +++ b/plugins/MacSignedAU/XBandpass/XBandpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/XHighpass/XHighpass.cpp b/plugins/MacSignedAU/XHighpass/XHighpass.cpp index f28d246cb..411970c63 100644 --- a/plugins/MacSignedAU/XHighpass/XHighpass.cpp +++ b/plugins/MacSignedAU/XHighpass/XHighpass.cpp @@ -228,18 +228,18 @@ void XHighpass::XHighpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; biquad[10] = biquad[9]; diff --git a/plugins/MacSignedAU/XHighpass/XHighpass.h b/plugins/MacSignedAU/XHighpass/XHighpass.h index 5686a1257..b99a55e7d 100644 --- a/plugins/MacSignedAU/XHighpass/XHighpass.h +++ b/plugins/MacSignedAU/XHighpass/XHighpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/XLowpass/XLowpass.cpp b/plugins/MacSignedAU/XLowpass/XLowpass.cpp index ca6cedbc8..f47607ae8 100644 --- a/plugins/MacSignedAU/XLowpass/XLowpass.cpp +++ b/plugins/MacSignedAU/XLowpass/XLowpass.cpp @@ -232,18 +232,18 @@ void XLowpass::XLowpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; outSample = biquad[2]*inputSample+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSample; biquad[10] = biquad[9]; diff --git a/plugins/MacSignedAU/XLowpass/XLowpass.h b/plugins/MacSignedAU/XLowpass/XLowpass.h index a0380d751..7527d73b8 100644 --- a/plugins/MacSignedAU/XLowpass/XLowpass.h +++ b/plugins/MacSignedAU/XLowpass/XLowpass.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/XNotch/XNotch.cpp b/plugins/MacSignedAU/XNotch/XNotch.cpp index 5f8881f9d..e62df6d92 100644 --- a/plugins/MacSignedAU/XNotch/XNotch.cpp +++ b/plugins/MacSignedAU/XNotch/XNotch.cpp @@ -228,18 +228,18 @@ void XNotch::XNotchKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; if (inputSample > 1.57079633) inputSample = 1.57079633; if (inputSample < -1.57079633) inputSample = -1.57079633; diff --git a/plugins/MacSignedAU/XNotch/XNotch.h b/plugins/MacSignedAU/XNotch/XNotch.h index 07720df8e..19c7f7eb8 100644 --- a/plugins/MacSignedAU/XNotch/XNotch.h +++ b/plugins/MacSignedAU/XNotch/XNotch.h @@ -134,11 +134,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/XRegion/XRegion.cpp b/plugins/MacSignedAU/XRegion/XRegion.cpp index 511e067d8..186286098 100644 --- a/plugins/MacSignedAU/XRegion/XRegion.cpp +++ b/plugins/MacSignedAU/XRegion/XRegion.cpp @@ -289,18 +289,18 @@ void XRegion::XRegionKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; if (gain != 1.0) { inputSample *= gain; } - long double nukeLevel = inputSample; + double nukeLevel = inputSample; inputSample *= clipFactor; if (inputSample > 1.57079633) inputSample = 1.57079633; diff --git a/plugins/MacSignedAU/XRegion/XRegion.h b/plugins/MacSignedAU/XRegion/XRegion.h index 1c143b1db..3f7adf52d 100644 --- a/plugins/MacSignedAU/XRegion/XRegion.h +++ b/plugins/MacSignedAU/XRegion/XRegion.h @@ -137,11 +137,11 @@ public: virtual void Reset(); private: - long double biquad[11]; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; + double biquad[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/YBandpass/YBandpass.cpp b/plugins/MacSignedAU/YBandpass/YBandpass.cpp index e10f82506..aea039d16 100644 --- a/plugins/MacSignedAU/YBandpass/YBandpass.cpp +++ b/plugins/MacSignedAU/YBandpass/YBandpass.cpp @@ -218,7 +218,7 @@ void YBandpass::YBandpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YBandpass::YBandpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacSignedAU/YBandpass/YBandpass.h b/plugins/MacSignedAU/YBandpass/YBandpass.h index 214ad4ccc..e9616aa3d 100644 --- a/plugins/MacSignedAU/YBandpass/YBandpass.h +++ b/plugins/MacSignedAU/YBandpass/YBandpass.h @@ -165,15 +165,15 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - //long double biquadC[biq_total]; - //long double biquadD[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + //double biquadC[biq_total]; + //double biquadD[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -189,8 +189,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/YHighpass/YHighpass.cpp b/plugins/MacSignedAU/YHighpass/YHighpass.cpp index e20d7dfd5..7c6468b78 100644 --- a/plugins/MacSignedAU/YHighpass/YHighpass.cpp +++ b/plugins/MacSignedAU/YHighpass/YHighpass.cpp @@ -218,7 +218,7 @@ void YHighpass::YHighpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YHighpass::YHighpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacSignedAU/YHighpass/YHighpass.h b/plugins/MacSignedAU/YHighpass/YHighpass.h index 9648efcef..7006d6296 100644 --- a/plugins/MacSignedAU/YHighpass/YHighpass.h +++ b/plugins/MacSignedAU/YHighpass/YHighpass.h @@ -165,13 +165,13 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -187,8 +187,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/YLowpass/YLowpass.cpp b/plugins/MacSignedAU/YLowpass/YLowpass.cpp index 7a608ea81..564e163bf 100644 --- a/plugins/MacSignedAU/YLowpass/YLowpass.cpp +++ b/plugins/MacSignedAU/YLowpass/YLowpass.cpp @@ -218,7 +218,7 @@ void YLowpass::YLowpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YLowpass::YLowpassKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacSignedAU/YLowpass/YLowpass.h b/plugins/MacSignedAU/YLowpass/YLowpass.h index 1c4f0b9d9..e176e3075 100644 --- a/plugins/MacSignedAU/YLowpass/YLowpass.h +++ b/plugins/MacSignedAU/YLowpass/YLowpass.h @@ -165,15 +165,15 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - //long double biquadC[biq_total]; - //long double biquadD[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + //double biquadC[biq_total]; + //double biquadD[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -189,8 +189,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/YNotch/YNotch.cpp b/plugins/MacSignedAU/YNotch/YNotch.cpp index d5445502c..9b8c0bc4c 100644 --- a/plugins/MacSignedAU/YNotch/YNotch.cpp +++ b/plugins/MacSignedAU/YNotch/YNotch.cpp @@ -218,7 +218,7 @@ void YNotch::YNotchKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -268,20 +268,20 @@ void YNotch::YNotchKernel::Process( const Float32 *inSourceP, //for the fixed-position biquad filter while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; + double drySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSample *= inTrim; diff --git a/plugins/MacSignedAU/YNotch/YNotch.h b/plugins/MacSignedAU/YNotch/YNotch.h index e66e18103..bf96cdc24 100644 --- a/plugins/MacSignedAU/YNotch/YNotch.h +++ b/plugins/MacSignedAU/YNotch/YNotch.h @@ -165,13 +165,13 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -187,8 +187,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZBandpass/ZBandpass.cpp b/plugins/MacSignedAU/ZBandpass/ZBandpass.cpp index c87f36573..b5cd18e89 100644 --- a/plugins/MacSignedAU/ZBandpass/ZBandpass.cpp +++ b/plugins/MacSignedAU/ZBandpass/ZBandpass.cpp @@ -199,7 +199,7 @@ void ZBandpass::ZBandpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,13 +248,13 @@ void ZBandpass::ZBandpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacSignedAU/ZBandpass/ZBandpass.h b/plugins/MacSignedAU/ZBandpass/ZBandpass.h index 1172eeb08..ab91edfb0 100644 --- a/plugins/MacSignedAU/ZBandpass/ZBandpass.h +++ b/plugins/MacSignedAU/ZBandpass/ZBandpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZBandpass2/ZBandpass2.cpp b/plugins/MacSignedAU/ZBandpass2/ZBandpass2.cpp index 8d4f62c99..34180dab9 100644 --- a/plugins/MacSignedAU/ZBandpass2/ZBandpass2.cpp +++ b/plugins/MacSignedAU/ZBandpass2/ZBandpass2.cpp @@ -203,7 +203,7 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZBandpass2::ZBandpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacSignedAU/ZBandpass2/ZBandpass2.h b/plugins/MacSignedAU/ZBandpass2/ZBandpass2.h index 7d4d7126d..c255dbe0f 100644 --- a/plugins/MacSignedAU/ZBandpass2/ZBandpass2.h +++ b/plugins/MacSignedAU/ZBandpass2/ZBandpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZHighpass/ZHighpass.cpp b/plugins/MacSignedAU/ZHighpass/ZHighpass.cpp index 8418487bc..7c704fa2b 100644 --- a/plugins/MacSignedAU/ZHighpass/ZHighpass.cpp +++ b/plugins/MacSignedAU/ZHighpass/ZHighpass.cpp @@ -199,7 +199,7 @@ void ZHighpass::ZHighpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -246,13 +246,13 @@ void ZHighpass::ZHighpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; - long double drySample = inputSample; - long double overallDrySample = drySample; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; + double drySample = inputSample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacSignedAU/ZHighpass/ZHighpass.h b/plugins/MacSignedAU/ZHighpass/ZHighpass.h index b4383a484..e39d0ad87 100644 --- a/plugins/MacSignedAU/ZHighpass/ZHighpass.h +++ b/plugins/MacSignedAU/ZHighpass/ZHighpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZHighpass2/ZHighpass2.cpp b/plugins/MacSignedAU/ZHighpass2/ZHighpass2.cpp index 814bbb602..152500494 100644 --- a/plugins/MacSignedAU/ZHighpass2/ZHighpass2.cpp +++ b/plugins/MacSignedAU/ZHighpass2/ZHighpass2.cpp @@ -203,7 +203,7 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZHighpass2::ZHighpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacSignedAU/ZHighpass2/ZHighpass2.h b/plugins/MacSignedAU/ZHighpass2/ZHighpass2.h index 55d87b397..c0d8bd6e6 100644 --- a/plugins/MacSignedAU/ZHighpass2/ZHighpass2.h +++ b/plugins/MacSignedAU/ZHighpass2/ZHighpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZLowpass/ZLowpass.cpp b/plugins/MacSignedAU/ZLowpass/ZLowpass.cpp index d7ed4be81..2cc5d9a93 100644 --- a/plugins/MacSignedAU/ZLowpass/ZLowpass.cpp +++ b/plugins/MacSignedAU/ZLowpass/ZLowpass.cpp @@ -199,7 +199,7 @@ void ZLowpass::ZLowpassKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,13 +247,13 @@ void ZLowpass::ZLowpassKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacSignedAU/ZLowpass/ZLowpass.h b/plugins/MacSignedAU/ZLowpass/ZLowpass.h index 87390d1d4..a9c4b37f0 100644 --- a/plugins/MacSignedAU/ZLowpass/ZLowpass.h +++ b/plugins/MacSignedAU/ZLowpass/ZLowpass.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ZLowpass2/ZLowpass2.cpp b/plugins/MacSignedAU/ZLowpass2/ZLowpass2.cpp index 872aec422..0c614d395 100644 --- a/plugins/MacSignedAU/ZLowpass2/ZLowpass2.cpp +++ b/plugins/MacSignedAU/ZLowpass2/ZLowpass2.cpp @@ -203,7 +203,7 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZLowpass2::ZLowpass2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacSignedAU/ZLowpass2/ZLowpass2.h b/plugins/MacSignedAU/ZLowpass2/ZLowpass2.h index 8cbf5499c..413464837 100644 --- a/plugins/MacSignedAU/ZLowpass2/ZLowpass2.h +++ b/plugins/MacSignedAU/ZLowpass2/ZLowpass2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/ZNotch/ZNotch.cpp b/plugins/MacSignedAU/ZNotch/ZNotch.cpp index 5ffc12a8e..a2be62258 100644 --- a/plugins/MacSignedAU/ZNotch/ZNotch.cpp +++ b/plugins/MacSignedAU/ZNotch/ZNotch.cpp @@ -199,7 +199,7 @@ void ZNotch::ZNotchKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -248,13 +248,13 @@ void ZNotch::ZNotchKernel::Process( const Float32 *inSourceP, //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; - long double overallDrySample = drySample; + double overallDrySample = drySample; if (inTrim != 1.0) inputSample *= inTrim; if (inputSample > 1.0) inputSample = 1.0; if (inputSample < -1.0) inputSample = -1.0; diff --git a/plugins/MacSignedAU/ZNotch/ZNotch.h b/plugins/MacSignedAU/ZNotch/ZNotch.h index 78f5cd3fe..ea6e11cf8 100644 --- a/plugins/MacSignedAU/ZNotch/ZNotch.h +++ b/plugins/MacSignedAU/ZNotch/ZNotch.h @@ -134,13 +134,13 @@ public: virtual void Reset(); private: - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; - long double biquadD[11]; - long double biquadE[11]; - long double biquadF[11]; - long double iirSampleA; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; + double biquadD[11]; + double biquadE[11]; + double biquadF[11]; + double iirSampleA; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/ZNotch2/ZNotch2.cpp b/plugins/MacSignedAU/ZNotch2/ZNotch2.cpp index cf6415082..484e05dc4 100644 --- a/plugins/MacSignedAU/ZNotch2/ZNotch2.cpp +++ b/plugins/MacSignedAU/ZNotch2/ZNotch2.cpp @@ -203,7 +203,7 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -247,15 +247,15 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, //end opamp stuff double trim = 0.1+(3.712*biquadA[biq_freq]); - long double outSample = 0.0; + double outSample = 0.0; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; - long double drySample = *sourceP; - long double overallDrySample = *sourceP; + double drySample = *sourceP; + double overallDrySample = *sourceP; - long double temp = (long double)nSampleFrames/inFramesToProcess; + double temp = (double)nSampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); @@ -263,13 +263,13 @@ void ZNotch2::ZNotch2Kernel::Process( const Float32 *inSourceP, biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); - long double wet = (wetA*temp)+(wetB*(1.0-temp)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double wet = (wetA*temp)+(wetB*(1.0-temp)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} diff --git a/plugins/MacSignedAU/ZNotch2/ZNotch2.h b/plugins/MacSignedAU/ZNotch2/ZNotch2.h index 23bd41696..28609ff20 100644 --- a/plugins/MacSignedAU/ZNotch2/ZNotch2.h +++ b/plugins/MacSignedAU/ZNotch2/ZNotch2.h @@ -135,7 +135,7 @@ public: private: - long double iirSampleA; + double iirSampleA; enum { biq_freq, biq_reso, @@ -160,16 +160,16 @@ public: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -185,8 +185,8 @@ public: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/curve/curve.cpp b/plugins/MacSignedAU/curve/curve.cpp index 60b42cbb6..c677cedee 100755 --- a/plugins/MacSignedAU/curve/curve.cpp +++ b/plugins/MacSignedAU/curve/curve.cpp @@ -185,8 +185,8 @@ OSStatus curve::ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags, UInt32 nSampleFrames = inFramesToProcess; while (nSampleFrames-- > 0) { - long double inputSampleL = *inputL; - long double inputSampleR = *inputR; + double inputSampleL = *inputL; + double inputSampleR = *inputR; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; diff --git a/plugins/MacSignedAU/curve/curve.h b/plugins/MacSignedAU/curve/curve.h index d2c7b16f3..f90fa2a16 100755 --- a/plugins/MacSignedAU/curve/curve.h +++ b/plugins/MacSignedAU/curve/curve.h @@ -104,7 +104,7 @@ public: virtual ComponentResult Version() { return kcurveVersion; } private: - long double gain; + double gain; uint32_t fpd; }; diff --git a/plugins/MacSignedAU/curvemono/curvemono.cpp b/plugins/MacSignedAU/curvemono/curvemono.cpp index 5eef271dc..c11e6c6ef 100755 --- a/plugins/MacSignedAU/curvemono/curvemono.cpp +++ b/plugins/MacSignedAU/curvemono/curvemono.cpp @@ -168,8 +168,8 @@ void curvemono::curvemonoKernel::Process( const Float32 *inSourceP, Float32 *destP = inDestP; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; - if (fabs(inputSample)<1.18e-37) inputSample = fpd * 1.18e-37; + double inputSample = *sourceP; + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; inputSample *= 0.5; if (gain < 0.0078125) gain = 0.0078125; if (gain > 1.0) gain = 1.0; diff --git a/plugins/MacSignedAU/curvemono/curvemono.h b/plugins/MacSignedAU/curvemono/curvemono.h index 6b224f101..0023b8aca 100755 --- a/plugins/MacSignedAU/curvemono/curvemono.h +++ b/plugins/MacSignedAU/curvemono/curvemono.h @@ -121,7 +121,7 @@ public: virtual void Reset(); private: - long double gain; + double gain; uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/uLawDecode/uLawDecode.cpp b/plugins/MacSignedAU/uLawDecode/uLawDecode.cpp index 52cda7a61..15035d282 100755 --- a/plugins/MacSignedAU/uLawDecode/uLawDecode.cpp +++ b/plugins/MacSignedAU/uLawDecode/uLawDecode.cpp @@ -166,7 +166,7 @@ ComponentResult uLawDecode::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void uLawDecode::uLawDecodeKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,7 +181,7 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -190,27 +190,9 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; Float64 drySample = inputSample; if (gain != 1.0) { @@ -231,11 +213,11 @@ void uLawDecode::uLawDecodeKernel::Process( const Float32 *inSourceP, } //Dry/Wet control, defaults to the last slider - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/uLawDecode/uLawDecode.h b/plugins/MacSignedAU/uLawDecode/uLawDecode.h index 75726d4da..2f51f88b7 100755 --- a/plugins/MacSignedAU/uLawDecode/uLawDecode.h +++ b/plugins/MacSignedAU/uLawDecode/uLawDecode.h @@ -127,7 +127,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedAU/uLawEncode/uLawEncode.cpp b/plugins/MacSignedAU/uLawEncode/uLawEncode.cpp index 83fd537d9..82c65cfe1 100755 --- a/plugins/MacSignedAU/uLawEncode/uLawEncode.cpp +++ b/plugins/MacSignedAU/uLawEncode/uLawEncode.cpp @@ -166,7 +166,7 @@ ComponentResult uLawEncode::Initialize() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void uLawEncode::uLawEncodeKernel::Reset() { - fpNShape = 0.0; + fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,7 +181,7 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, UInt32 nSampleFrames = inFramesToProcess; const Float32 *sourceP = inSourceP; Float32 *destP = inDestP; - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= GetSampleRate(); @@ -190,27 +190,9 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, Float64 dry = 1.0 - wet; while (nSampleFrames-- > 0) { - long double inputSample = *sourceP; + double inputSample = *sourceP; - static int noisesource = 0; - int residue; - double applyresidue; - noisesource = noisesource % 1700021; noisesource++; - residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSample += applyresidue; - if (inputSample<1.2e-38 && -inputSample<1.2e-38) { - inputSample -= applyresidue; - } - //for live air, we always apply the dither noise. Then, if our result is - //effectively digital black, we'll subtract it again. We want a 'air' hiss + if (fabs(inputSample)<1.18e-23) inputSample = fpd * 1.18e-17; double drySample = inputSample; if (gain != 1.0) { @@ -229,11 +211,11 @@ void uLawEncode::uLawEncodeKernel::Process( const Float32 *inSourceP, inputSample = (inputSample * wet) + (drySample * dry); } - //32 bit dither, made small and tidy. - int expon; frexpf((Float32)inputSample, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSample += (dither-fpNShape); fpNShape = dither; - //end 32 bit dither + //begin 32 bit floating point dither + int expon; frexpf((float)inputSample, &expon); + fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + inputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *destP = inputSample; diff --git a/plugins/MacSignedAU/uLawEncode/uLawEncode.h b/plugins/MacSignedAU/uLawEncode/uLawEncode.h index b8730054d..a12457820 100755 --- a/plugins/MacSignedAU/uLawEncode/uLawEncode.h +++ b/plugins/MacSignedAU/uLawEncode/uLawEncode.h @@ -127,7 +127,7 @@ public: virtual void Reset(); private: - long double fpNShape; + uint32_t fpd; }; }; diff --git a/plugins/MacSignedVST/ADClip7/source/ADClip7.cpp b/plugins/MacSignedVST/ADClip7/source/ADClip7.cpp index 7ebc8179d..9f8bc2c88 100755 --- a/plugins/MacSignedVST/ADClip7/source/ADClip7.cpp +++ b/plugins/MacSignedVST/ADClip7/source/ADClip7.cpp @@ -30,8 +30,8 @@ ADClip7::ADClip7(audioMasterCallback audioMaster) : iirLowsBL = 0.0; iirLowsBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ADClip7/source/ADClip7.h b/plugins/MacSignedVST/ADClip7/source/ADClip7.h index f0cde6cf7..6a619cd09 100755 --- a/plugins/MacSignedVST/ADClip7/source/ADClip7.h +++ b/plugins/MacSignedVST/ADClip7/source/ADClip7.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; float bL[22200]; float bR[22200]; int gcount; @@ -69,8 +69,8 @@ private: double iirLowsAR; double iirLowsBL; double iirLowsBR; - long double refclipL; - long double refclipR; + double refclipL; + double refclipR; float A; float B; diff --git a/plugins/MacSignedVST/ADClip7/source/ADClip7Proc.cpp b/plugins/MacSignedVST/ADClip7/source/ADClip7Proc.cpp index abc9909d5..db5a449b0 100755 --- a/plugins/MacSignedVST/ADClip7/source/ADClip7Proc.cpp +++ b/plugins/MacSignedVST/ADClip7/source/ADClip7Proc.cpp @@ -17,8 +17,8 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -28,7 +28,7 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -55,51 +55,15 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -447,14 +411,14 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,8 +440,8 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -487,7 +451,7 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -514,52 +478,16 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -907,16 +835,14 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ADT/source/ADTProc.cpp b/plugins/MacSignedVST/ADT/source/ADTProc.cpp index 828579d06..555f0877e 100755 --- a/plugins/MacSignedVST/ADT/source/ADTProc.cpp +++ b/plugins/MacSignedVST/ADT/source/ADTProc.cpp @@ -29,8 +29,8 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp index 9b8422125..a96f32802 100755 --- a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp +++ b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp @@ -57,8 +57,8 @@ AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.h b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.h index 40cfab209..862629b6b 100755 --- a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.h +++ b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClip.h @@ -115,8 +115,8 @@ private: double RiirSampleD; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp index cc282b6dd..6ddecdf61 100755 --- a/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp +++ b/plugins/MacSignedVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp @@ -42,51 +42,15 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -407,14 +371,14 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); @@ -474,51 +438,15 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -839,16 +767,14 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); diff --git a/plugins/MacSignedVST/Acceleration/source/Acceleration.cpp b/plugins/MacSignedVST/Acceleration/source/Acceleration.cpp index b2721d922..a2d27752d 100755 --- a/plugins/MacSignedVST/Acceleration/source/Acceleration.cpp +++ b/plugins/MacSignedVST/Acceleration/source/Acceleration.cpp @@ -23,8 +23,8 @@ Acceleration::Acceleration(audioMasterCallback audioMaster) : o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Acceleration/source/Acceleration.h b/plugins/MacSignedVST/Acceleration/source/Acceleration.h index 02a3760ba..4e4dea014 100755 --- a/plugins/MacSignedVST/Acceleration/source/Acceleration.h +++ b/plugins/MacSignedVST/Acceleration/source/Acceleration.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double ataLastOutL; double s1L; diff --git a/plugins/MacSignedVST/Acceleration/source/AccelerationProc.cpp b/plugins/MacSignedVST/Acceleration/source/AccelerationProc.cpp index 0151dbeb1..050c433ca 100755 --- a/plugins/MacSignedVST/Acceleration/source/AccelerationProc.cpp +++ b/plugins/MacSignedVST/Acceleration/source/AccelerationProc.cpp @@ -29,51 +29,15 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -132,14 +96,14 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -173,51 +137,15 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -276,16 +204,14 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Acceleration2/source/Acceleration2.h b/plugins/MacSignedVST/Acceleration2/source/Acceleration2.h index e16c92d77..ee3a7e56f 100755 --- a/plugins/MacSignedVST/Acceleration2/source/Acceleration2.h +++ b/plugins/MacSignedVST/Acceleration2/source/Acceleration2.h @@ -64,8 +64,8 @@ private: double m1R; double m2R; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Acceleration2/source/Acceleration2Proc.cpp b/plugins/MacSignedVST/Acceleration2/source/Acceleration2Proc.cpp index 575e70a23..49ece8844 100755 --- a/plugins/MacSignedVST/Acceleration2/source/Acceleration2Proc.cpp +++ b/plugins/MacSignedVST/Acceleration2/source/Acceleration2Proc.cpp @@ -46,14 +46,14 @@ void Acceleration2::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -151,14 +151,14 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -199,12 +199,12 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Air/source/Air.cpp b/plugins/MacSignedVST/Air/source/Air.cpp index ea52c265c..5ad55b387 100755 --- a/plugins/MacSignedVST/Air/source/Air.cpp +++ b/plugins/MacSignedVST/Air/source/Air.cpp @@ -61,8 +61,8 @@ Air::Air(audioMasterCallback audioMaster) : D = 0.0; E = 1.0; F = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Air/source/Air.h b/plugins/MacSignedVST/Air/source/Air.h index a713cf275..9432f792b 100755 --- a/plugins/MacSignedVST/Air/source/Air.h +++ b/plugins/MacSignedVST/Air/source/Air.h @@ -100,8 +100,8 @@ private: bool flop; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Air/source/AirProc.cpp b/plugins/MacSignedVST/Air/source/AirProc.cpp index f5eb39fde..9e72d87e2 100755 --- a/plugins/MacSignedVST/Air/source/AirProc.cpp +++ b/plugins/MacSignedVST/Air/source/AirProc.cpp @@ -23,8 +23,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -34,44 +34,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -257,14 +221,14 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -292,8 +256,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -303,44 +267,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -526,16 +454,14 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Air2/source/Air2.h b/plugins/MacSignedVST/Air2/source/Air2.h index b50e7c919..5fa7a5325 100755 --- a/plugins/MacSignedVST/Air2/source/Air2.h +++ b/plugins/MacSignedVST/Air2/source/Air2.h @@ -106,7 +106,7 @@ private: bool flipB; bool flop; int count; - long double postsine; + double postsine; float A; diff --git a/plugins/MacSignedVST/Air2/source/Air2Proc.cpp b/plugins/MacSignedVST/Air2/source/Air2Proc.cpp index 16b6ae552..e07abffda 100755 --- a/plugins/MacSignedVST/Air2/source/Air2Proc.cpp +++ b/plugins/MacSignedVST/Air2/source/Air2Proc.cpp @@ -44,17 +44,17 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -190,7 +190,7 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -333,17 +333,17 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -479,7 +479,7 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -568,12 +568,12 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp b/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp index b6cdb8513..bc9e99ab5 100755 --- a/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp +++ b/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp @@ -37,8 +37,8 @@ void Apicolypse::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -213,8 +213,8 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h index 79a5d23d8..ebaf0919c 100755 --- a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h +++ b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBussProc.cpp b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBussProc.cpp index 16d7a3198..add056764 100755 --- a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBussProc.cpp +++ b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBussProc.cpp @@ -18,10 +18,10 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -249,14 +249,14 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -279,10 +279,10 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -510,16 +510,14 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h index 1e95258b9..4ed29b1c1 100755 --- a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h +++ b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp index bbdf44cc9..763853004 100755 --- a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp +++ b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp @@ -18,10 +18,10 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -244,14 +244,14 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -274,10 +274,10 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -500,16 +500,14 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Aura/source/Aura.cpp b/plugins/MacSignedVST/Aura/source/Aura.cpp index 8663d3bb1..b26d8a86f 100755 --- a/plugins/MacSignedVST/Aura/source/Aura.cpp +++ b/plugins/MacSignedVST/Aura/source/Aura.cpp @@ -24,8 +24,8 @@ Aura::Aura(audioMasterCallback audioMaster) : lastSampleR = 0.0; previousVelocityR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Aura/source/Aura.h b/plugins/MacSignedVST/Aura/source/Aura.h index 22d4653d0..e0feff0c2 100755 --- a/plugins/MacSignedVST/Aura/source/Aura.h +++ b/plugins/MacSignedVST/Aura/source/Aura.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; + double lastSampleL; double previousVelocityL; - long double lastSampleR; + double lastSampleR; double previousVelocityR; double bL[21]; diff --git a/plugins/MacSignedVST/Aura/source/AuraProc.cpp b/plugins/MacSignedVST/Aura/source/AuraProc.cpp index 089a8731b..e6d4f4e7a 100755 --- a/plugins/MacSignedVST/Aura/source/AuraProc.cpp +++ b/plugins/MacSignedVST/Aura/source/AuraProc.cpp @@ -27,8 +27,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -83,44 +83,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -208,14 +172,14 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,8 +211,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -303,44 +267,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -428,16 +356,14 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/AutoPan/source/AutoPanProc.cpp b/plugins/MacSignedVST/AutoPan/source/AutoPanProc.cpp index 8301a2b25..632f9bfaa 100755 --- a/plugins/MacSignedVST/AutoPan/source/AutoPanProc.cpp +++ b/plugins/MacSignedVST/AutoPan/source/AutoPanProc.cpp @@ -25,12 +25,12 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -44,8 +44,8 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -95,12 +95,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -114,8 +114,8 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -129,12 +129,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/AverMatrix/source/AverMatrixProc.cpp b/plugins/MacSignedVST/AverMatrix/source/AverMatrixProc.cpp index 381ea9c35..af0105057 100755 --- a/plugins/MacSignedVST/AverMatrix/source/AverMatrixProc.cpp +++ b/plugins/MacSignedVST/AverMatrix/source/AverMatrixProc.cpp @@ -48,15 +48,15 @@ void AverMatrix::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; @@ -140,15 +140,15 @@ void AverMatrix::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; diff --git a/plugins/MacSignedVST/Average/source/Average.cpp b/plugins/MacSignedVST/Average/source/Average.cpp index 2f39ca1db..64f301f56 100755 --- a/plugins/MacSignedVST/Average/source/Average.cpp +++ b/plugins/MacSignedVST/Average/source/Average.cpp @@ -17,8 +17,8 @@ Average::Average(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Average/source/Average.h b/plugins/MacSignedVST/Average/source/Average.h index 9932e99d9..1cdc884ba 100755 --- a/plugins/MacSignedVST/Average/source/Average.h +++ b/plugins/MacSignedVST/Average/source/Average.h @@ -57,8 +57,8 @@ private: double f[11]; double bR[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Average/source/AverageProc.cpp b/plugins/MacSignedVST/Average/source/AverageProc.cpp index 17f478362..fce6a3af4 100755 --- a/plugins/MacSignedVST/Average/source/AverageProc.cpp +++ b/plugins/MacSignedVST/Average/source/AverageProc.cpp @@ -57,44 +57,8 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -151,14 +115,14 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //in the floating point system. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -218,44 +182,8 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -311,16 +239,14 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp b/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp index a84fcce3a..025fa038a 100755 --- a/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp +++ b/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp @@ -36,8 +36,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-37) LinputSample = fpd * 1.18e-37; if (fabs(RinputSample)<1.18e-37) RinputSample = fpd * 1.18e-37; @@ -408,8 +408,8 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-43) LinputSample = fpd * 1.18e-43; if (fabs(RinputSample)<1.18e-43) RinputSample = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/BassDrive/source/BassDriveProc.cpp b/plugins/MacSignedVST/BassDrive/source/BassDriveProc.cpp index 3e199ea59..68f67e7f7 100755 --- a/plugins/MacSignedVST/BassDrive/source/BassDriveProc.cpp +++ b/plugins/MacSignedVST/BassDrive/source/BassDriveProc.cpp @@ -25,8 +25,8 @@ void BassDrive::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -349,8 +349,8 @@ void BassDrive::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/BassKit/source/BassKit.cpp b/plugins/MacSignedVST/BassKit/source/BassKit.cpp index 008f045da..0eec1c5eb 100755 --- a/plugins/MacSignedVST/BassKit/source/BassKit.cpp +++ b/plugins/MacSignedVST/BassKit/source/BassKit.cpp @@ -68,8 +68,8 @@ BassKit::BassKit(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/BassKit/source/BassKit.h b/plugins/MacSignedVST/BassKit/source/BassKit.h index f421d3d4d..c192cfa11 100755 --- a/plugins/MacSignedVST/BassKit/source/BassKit.h +++ b/plugins/MacSignedVST/BassKit/source/BassKit.h @@ -105,8 +105,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/BassKit/source/BassKitProc.cpp b/plugins/MacSignedVST/BassKit/source/BassKitProc.cpp index 9199c82d3..3044c5cec 100755 --- a/plugins/MacSignedVST/BassKit/source/BassKitProc.cpp +++ b/plugins/MacSignedVST/BassKit/source/BassKitProc.cpp @@ -33,8 +33,8 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -204,14 +204,14 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,8 +249,8 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -420,16 +420,14 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Baxandall/source/Baxandall.h b/plugins/MacSignedVST/Baxandall/source/Baxandall.h index 380e3d09f..a30751cfc 100755 --- a/plugins/MacSignedVST/Baxandall/source/Baxandall.h +++ b/plugins/MacSignedVST/Baxandall/source/Baxandall.h @@ -56,15 +56,15 @@ private: uint32_t fpd; //default stuff - long double trebleAL[9]; - long double trebleBL[9]; - long double bassAL[9]; - long double bassBL[9]; + double trebleAL[9]; + double trebleBL[9]; + double bassAL[9]; + double bassBL[9]; - long double trebleAR[9]; - long double trebleBR[9]; - long double bassAR[9]; - long double bassBR[9]; + double trebleAR[9]; + double trebleBR[9]; + double bassAR[9]; + double bassBR[9]; bool flip; float A; diff --git a/plugins/MacSignedVST/Baxandall/source/BaxandallProc.cpp b/plugins/MacSignedVST/Baxandall/source/BaxandallProc.cpp index 9f75cced2..f52cba8ec 100755 --- a/plugins/MacSignedVST/Baxandall/source/BaxandallProc.cpp +++ b/plugins/MacSignedVST/Baxandall/source/BaxandallProc.cpp @@ -45,8 +45,8 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -59,10 +59,10 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { @@ -182,8 +182,8 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -196,10 +196,10 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { diff --git a/plugins/MacSignedVST/Beam/source/BeamProc.cpp b/plugins/MacSignedVST/Beam/source/BeamProc.cpp index 5871eb5c1..15eda5357 100755 --- a/plugins/MacSignedVST/Beam/source/BeamProc.cpp +++ b/plugins/MacSignedVST/Beam/source/BeamProc.cpp @@ -35,8 +35,8 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Biquad/source/Biquad.h b/plugins/MacSignedVST/Biquad/source/Biquad.h index 17993cd4c..2476d2595 100755 --- a/plugins/MacSignedVST/Biquad/source/Biquad.h +++ b/plugins/MacSignedVST/Biquad/source/Biquad.h @@ -55,7 +55,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[11]; //note that this stereo form doesn't require L and R forms! + double biquad[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Biquad/source/BiquadProc.cpp b/plugins/MacSignedVST/Biquad/source/BiquadProc.cpp index 0dfbfe46f..cff2485a6 100755 --- a/plugins/MacSignedVST/Biquad/source/BiquadProc.cpp +++ b/plugins/MacSignedVST/Biquad/source/BiquadProc.cpp @@ -88,12 +88,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -101,16 +101,16 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -120,12 +120,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -245,12 +245,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -258,16 +258,16 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -277,12 +277,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacSignedVST/Biquad2/source/Biquad2.h b/plugins/MacSignedVST/Biquad2/source/Biquad2.h index 20c1d1ceb..1c715f1a7 100755 --- a/plugins/MacSignedVST/Biquad2/source/Biquad2.h +++ b/plugins/MacSignedVST/Biquad2/source/Biquad2.h @@ -56,7 +56,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; //note that this stereo form doesn't require L and R forms! + double biquad[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Biquad2/source/Biquad2Proc.cpp b/plugins/MacSignedVST/Biquad2/source/Biquad2Proc.cpp index 837a072b8..9e9d6bce8 100755 --- a/plugins/MacSignedVST/Biquad2/source/Biquad2Proc.cpp +++ b/plugins/MacSignedVST/Biquad2/source/Biquad2Proc.cpp @@ -79,12 +79,12 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -134,10 +134,10 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -291,12 +291,12 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -346,10 +346,10 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; diff --git a/plugins/MacSignedVST/BiquadDouble/source/BiquadDouble.h b/plugins/MacSignedVST/BiquadDouble/source/BiquadDouble.h index 525d753a0..486a9b642 100755 --- a/plugins/MacSignedVST/BiquadDouble/source/BiquadDouble.h +++ b/plugins/MacSignedVST/BiquadDouble/source/BiquadDouble.h @@ -56,8 +56,8 @@ private: std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/BiquadDouble/source/BiquadDoubleProc.cpp b/plugins/MacSignedVST/BiquadDouble/source/BiquadDoubleProc.cpp index c5318a700..055743d43 100755 --- a/plugins/MacSignedVST/BiquadDouble/source/BiquadDoubleProc.cpp +++ b/plugins/MacSignedVST/BiquadDouble/source/BiquadDoubleProc.cpp @@ -89,24 +89,24 @@ void BiquadDouble::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -238,24 +238,24 @@ void BiquadDouble::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalf.h b/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalf.h index cd9dacc2e..e3024989d 100755 --- a/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalf.h +++ b/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalf.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadAL[9]; - long double biquadAR[9]; - long double biquadBL[9]; - long double biquadBR[9]; + double biquadAL[9]; + double biquadAR[9]; + double biquadBL[9]; + double biquadBR[9]; bool flip; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp b/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp index e126dcf7e..87d9763c1 100755 --- a/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp +++ b/plugins/MacSignedVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp @@ -87,19 +87,19 @@ void BiquadOneHalf::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { @@ -239,20 +239,20 @@ void BiquadOneHalf::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { diff --git a/plugins/MacSignedVST/BiquadPlus/source/BiquadPlus.h b/plugins/MacSignedVST/BiquadPlus/source/BiquadPlus.h index bec774331..0ef273e12 100755 --- a/plugins/MacSignedVST/BiquadPlus/source/BiquadPlus.h +++ b/plugins/MacSignedVST/BiquadPlus/source/BiquadPlus.h @@ -80,7 +80,7 @@ private: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/BiquadPlus/source/BiquadPlusProc.cpp b/plugins/MacSignedVST/BiquadPlus/source/BiquadPlusProc.cpp index 34f5c68fb..b2ad19c4d 100755 --- a/plugins/MacSignedVST/BiquadPlus/source/BiquadPlusProc.cpp +++ b/plugins/MacSignedVST/BiquadPlus/source/BiquadPlusProc.cpp @@ -107,20 +107,20 @@ void BiquadPlus::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -239,20 +239,20 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -268,12 +268,12 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/BiquadTriple/source/BiquadTriple.h b/plugins/MacSignedVST/BiquadTriple/source/BiquadTriple.h index acd55ebb6..b23660d14 100755 --- a/plugins/MacSignedVST/BiquadTriple/source/BiquadTriple.h +++ b/plugins/MacSignedVST/BiquadTriple/source/BiquadTriple.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/BiquadTriple/source/BiquadTripleProc.cpp b/plugins/MacSignedVST/BiquadTriple/source/BiquadTripleProc.cpp index f6d97f74f..84ee1b7f5 100755 --- a/plugins/MacSignedVST/BiquadTriple/source/BiquadTripleProc.cpp +++ b/plugins/MacSignedVST/BiquadTriple/source/BiquadTripleProc.cpp @@ -90,24 +90,24 @@ void BiquadTriple::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -251,23 +251,23 @@ void BiquadTriple::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacSignedVST/BitGlitter/source/BitGlitterProc.cpp b/plugins/MacSignedVST/BitGlitter/source/BitGlitterProc.cpp index 288c269bf..38afa37d9 100755 --- a/plugins/MacSignedVST/BitGlitter/source/BitGlitterProc.cpp +++ b/plugins/MacSignedVST/BitGlitter/source/BitGlitterProc.cpp @@ -32,12 +32,12 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section @@ -68,7 +68,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -97,7 +97,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; @@ -252,12 +252,12 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section inputSampleL *= ingain; @@ -287,7 +287,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -316,7 +316,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; diff --git a/plugins/MacSignedVST/Bite/source/Bite.cpp b/plugins/MacSignedVST/Bite/source/Bite.cpp index c9d0fcbc2..1defea7df 100755 --- a/plugins/MacSignedVST/Bite/source/Bite.cpp +++ b/plugins/MacSignedVST/Bite/source/Bite.cpp @@ -34,8 +34,8 @@ Bite::Bite(audioMasterCallback audioMaster) : sampleHR = 0.0; sampleIR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Bite/source/Bite.h b/plugins/MacSignedVST/Bite/source/Bite.h index 288ac7f80..895aab027 100755 --- a/plugins/MacSignedVST/Bite/source/Bite.h +++ b/plugins/MacSignedVST/Bite/source/Bite.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sampleAL; double sampleBL; diff --git a/plugins/MacSignedVST/Bite/source/BiteProc.cpp b/plugins/MacSignedVST/Bite/source/BiteProc.cpp index 64e0ac419..66747041e 100755 --- a/plugins/MacSignedVST/Bite/source/BiteProc.cpp +++ b/plugins/MacSignedVST/Bite/source/BiteProc.cpp @@ -50,44 +50,8 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -116,14 +80,14 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -178,44 +142,8 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -244,16 +172,14 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/BlockParty/source/BlockPartyProc.cpp b/plugins/MacSignedVST/BlockParty/source/BlockPartyProc.cpp index 12c19d4a3..37c3a6545 100755 --- a/plugins/MacSignedVST/BlockParty/source/BlockPartyProc.cpp +++ b/plugins/MacSignedVST/BlockParty/source/BlockPartyProc.cpp @@ -29,8 +29,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); @@ -590,8 +590,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -629,8 +629,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/MacSignedVST/BrassRider/source/BrassRiderProc.cpp b/plugins/MacSignedVST/BrassRider/source/BrassRiderProc.cpp index 3acd7834c..449a965fc 100755 --- a/plugins/MacSignedVST/BrassRider/source/BrassRiderProc.cpp +++ b/plugins/MacSignedVST/BrassRider/source/BrassRiderProc.cpp @@ -21,8 +21,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -60,8 +60,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -70,7 +70,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -79,7 +79,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -102,7 +102,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); @@ -163,8 +163,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -202,8 +202,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -212,7 +212,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -221,7 +221,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -244,7 +244,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/MacSignedVST/BrightAmbience/source/BrightAmbienceProc.cpp b/plugins/MacSignedVST/BrightAmbience/source/BrightAmbienceProc.cpp index 63bfecbf8..dc4ecd233 100755 --- a/plugins/MacSignedVST/BrightAmbience/source/BrightAmbienceProc.cpp +++ b/plugins/MacSignedVST/BrightAmbience/source/BrightAmbienceProc.cpp @@ -23,8 +23,8 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -174,7 +174,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -315,7 +315,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; @@ -355,8 +355,8 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -506,7 +506,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -647,7 +647,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; diff --git a/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2.h b/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2.h index c49b14e20..860fe9551 100755 --- a/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2.h +++ b/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2.h @@ -64,9 +64,9 @@ private: int gcount; float pL[32768]; float pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; float A; float B; diff --git a/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2Proc.cpp b/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2Proc.cpp index 72b7adf6c..95daad017 100755 --- a/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2Proc.cpp +++ b/plugins/MacSignedVST/BrightAmbience2/source/BrightAmbience2Proc.cpp @@ -22,14 +22,14 @@ void BrightAmbience2::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; @@ -90,14 +90,14 @@ void BrightAmbience2::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3.h b/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3.h index ab479927b..cd9a6abd0 100755 --- a/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3.h +++ b/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3.h @@ -62,10 +62,10 @@ private: int gcount; double pL[32768]; double pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3Proc.cpp b/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3Proc.cpp index 6c912ad33..dd6875d28 100755 --- a/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3Proc.cpp +++ b/plugins/MacSignedVST/BrightAmbience3/source/BrightAmbience3Proc.cpp @@ -43,17 +43,17 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -67,7 +67,7 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -202,17 +202,17 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -226,7 +226,7 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -307,12 +307,12 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp index dfea1258a..0b61354b3 100755 --- a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp +++ b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp @@ -32,44 +32,8 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -149,44 +113,8 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacSignedVST/BussColors4/source/BussColors4.cpp b/plugins/MacSignedVST/BussColors4/source/BussColors4.cpp index c7de380ea..731e1331f 100755 --- a/plugins/MacSignedVST/BussColors4/source/BussColors4.cpp +++ b/plugins/MacSignedVST/BussColors4/source/BussColors4.cpp @@ -44,8 +44,8 @@ BussColors4::BussColors4(audioMasterCallback audioMaster) : slowdynR = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/BussColors4/source/BussColors4.h b/plugins/MacSignedVST/BussColors4/source/BussColors4.h index 6452555a5..694ce678b 100755 --- a/plugins/MacSignedVST/BussColors4/source/BussColors4.h +++ b/plugins/MacSignedVST/BussColors4/source/BussColors4.h @@ -68,8 +68,8 @@ private: double slowdynR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/BussColors4/source/BussColors4Proc.cpp b/plugins/MacSignedVST/BussColors4/source/BussColors4Proc.cpp index b1b945144..983bcc510 100755 --- a/plugins/MacSignedVST/BussColors4/source/BussColors4Proc.cpp +++ b/plugins/MacSignedVST/BussColors4/source/BussColors4Proc.cpp @@ -32,8 +32,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -58,44 +58,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -792,14 +756,14 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -836,8 +800,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -862,44 +826,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1596,16 +1524,14 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ButterComp/source/ButterComp.cpp b/plugins/MacSignedVST/ButterComp/source/ButterComp.cpp index b3123e2e2..deac8039a 100755 --- a/plugins/MacSignedVST/ButterComp/source/ButterComp.cpp +++ b/plugins/MacSignedVST/ButterComp/source/ButterComp.cpp @@ -26,8 +26,8 @@ ButterComp::ButterComp(audioMasterCallback audioMaster) : controlBnegR = 1.0; targetposR = 1.0; targetnegR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ButterComp/source/ButterComp.h b/plugins/MacSignedVST/ButterComp/source/ButterComp.h index 5c9862b3e..12c693fe2 100755 --- a/plugins/MacSignedVST/ButterComp/source/ButterComp.h +++ b/plugins/MacSignedVST/ButterComp/source/ButterComp.h @@ -65,8 +65,8 @@ private: double controlBnegR; double targetposR; double targetnegR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ButterComp/source/ButterCompProc.cpp b/plugins/MacSignedVST/ButterComp/source/ButterCompProc.cpp index d87030c41..06c02ad31 100755 --- a/plugins/MacSignedVST/ButterComp/source/ButterCompProc.cpp +++ b/plugins/MacSignedVST/ButterComp/source/ButterCompProc.cpp @@ -24,8 +24,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -34,8 +34,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -54,44 +54,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -178,14 +142,14 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -214,8 +178,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -224,8 +188,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -244,44 +208,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -368,16 +296,14 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ButterComp2/source/ButterComp2.cpp b/plugins/MacSignedVST/ButterComp2/source/ButterComp2.cpp index 0484416d5..b7bf3f1c0 100755 --- a/plugins/MacSignedVST/ButterComp2/source/ButterComp2.cpp +++ b/plugins/MacSignedVST/ButterComp2/source/ButterComp2.cpp @@ -32,8 +32,8 @@ ButterComp2::ButterComp2(audioMasterCallback audioMaster) : A = 0.0; B = 0.5; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ButterComp2/source/ButterComp2.h b/plugins/MacSignedVST/ButterComp2/source/ButterComp2.h index 188adb5c3..d1f8721c1 100755 --- a/plugins/MacSignedVST/ButterComp2/source/ButterComp2.h +++ b/plugins/MacSignedVST/ButterComp2/source/ButterComp2.h @@ -54,23 +54,23 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double controlAposL; - long double controlAnegL; - long double controlBposL; - long double controlBnegL; - long double targetposL; - long double targetnegL; - long double lastOutputL; - long double controlAposR; - long double controlAnegR; - long double controlBposR; - long double controlBnegR; - long double targetposR; - long double targetnegR; - long double lastOutputR; + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double lastOutputL; + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double lastOutputR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ButterComp2/source/ButterComp2Proc.cpp b/plugins/MacSignedVST/ButterComp2/source/ButterComp2Proc.cpp index 67a63675c..f5520a44a 100755 --- a/plugins/MacSignedVST/ButterComp2/source/ButterComp2Proc.cpp +++ b/plugins/MacSignedVST/ButterComp2/source/ButterComp2Proc.cpp @@ -30,8 +30,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,30 +75,30 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -138,23 +138,23 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -187,8 +187,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -223,14 +223,14 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -265,8 +265,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -310,30 +310,30 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -373,23 +373,23 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -422,8 +422,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -458,16 +458,14 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.cpp b/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.cpp index 8fba0ef0f..1515cfdec 100755 --- a/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.cpp +++ b/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.cpp @@ -17,8 +17,8 @@ C5RawBuss::C5RawBuss(audioMasterCallback audioMaster) : lastSampleBussL = 0.0; lastFXBussR = 0.0; lastSampleBussR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.h b/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.h index f4d01fe1e..dfc108b22 100755 --- a/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.h +++ b/plugins/MacSignedVST/C5RawBuss/source/C5RawBuss.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXBussL; double lastSampleBussL; diff --git a/plugins/MacSignedVST/C5RawBuss/source/C5RawBussProc.cpp b/plugins/MacSignedVST/C5RawBuss/source/C5RawBussProc.cpp index fab4612e2..cc884ee73 100755 --- a/plugins/MacSignedVST/C5RawBuss/source/C5RawBussProc.cpp +++ b/plugins/MacSignedVST/C5RawBuss/source/C5RawBussProc.cpp @@ -15,7 +15,7 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -108,14 +72,14 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl //build new signal off what was present in output last time //slew aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -135,7 +99,7 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -144,51 +108,15 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -228,16 +156,14 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt //build new signal off what was present in output last time //slew aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.cpp b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.cpp index ffc2ecfe7..a25bbd81d 100755 --- a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.cpp +++ b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.cpp @@ -17,8 +17,8 @@ C5RawChannel::C5RawChannel(audioMasterCallback audioMaster) : lastSampleChannelL = 0.0; lastFXChannelR = 0.0; lastSampleChannelR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.h b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.h index 3ce3e845b..8ed6e152e 100755 --- a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.h +++ b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannel.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXChannelL; double lastSampleChannelL; diff --git a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannelProc.cpp b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannelProc.cpp index b2679ffb6..d8e91ece8 100755 --- a/plugins/MacSignedVST/C5RawChannel/source/C5RawChannelProc.cpp +++ b/plugins/MacSignedVST/C5RawChannel/source/C5RawChannelProc.cpp @@ -15,7 +15,7 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -107,14 +71,14 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -134,7 +98,7 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -143,51 +107,15 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -226,16 +154,14 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/CStrip/source/CStrip.cpp b/plugins/MacSignedVST/CStrip/source/CStrip.cpp index 2049ab870..88b4e1748 100755 --- a/plugins/MacSignedVST/CStrip/source/CStrip.cpp +++ b/plugins/MacSignedVST/CStrip/source/CStrip.cpp @@ -153,8 +153,8 @@ CStrip::CStrip(audioMasterCallback audioMaster) : nvgRA = nvgRB = 0.0; //end ButterComp - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/CStrip/source/CStrip.h b/plugins/MacSignedVST/CStrip/source/CStrip.h index cc9f722af..3e4f6219e 100755 --- a/plugins/MacSignedVST/CStrip/source/CStrip.h +++ b/plugins/MacSignedVST/CStrip/source/CStrip.h @@ -63,8 +63,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/CStrip/source/CStripProc.cpp b/plugins/MacSignedVST/CStrip/source/CStripProc.cpp index 60ce59c56..0a758963e 100755 --- a/plugins/MacSignedVST/CStrip/source/CStripProc.cpp +++ b/plugins/MacSignedVST/CStrip/source/CStripProc.cpp @@ -20,10 +20,10 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -111,44 +111,8 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -726,14 +690,14 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -758,10 +722,10 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -849,44 +813,8 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -1464,16 +1392,14 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser new file mode 100644 index 000000000..094e07859 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.pbxuser @@ -0,0 +1,132 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Cabs */; + codeSenseManager = 8B02375F1D42B1C400E1E8C8 /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 364, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 324, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 667089539; + PBXWorkspaceStateSaveDate = 667089539; + }; + perUserProjectItems = { + 8B9D6B4827C2FAD800C49ABD /* PBXTextBookmark */ = 8B9D6B4827C2FAD800C49ABD /* PBXTextBookmark */; + 8BCCEDD027C2F9C500202ED0 /* PBXTextBookmark */ = 8BCCEDD027C2F9C500202ED0 /* PBXTextBookmark */; + }; + sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; + userBuildSettings = { + }; + }; + 2407DEB6089929BA00EB68BF /* Cabs.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {948, 3762}}"; + sepNavSelRange = "{5643, 0}"; + sepNavVisRange = "{1125, 1515}"; + sepNavWindowFrame = "{{12, 47}, {895, 831}}"; + }; + }; + 245463B80991757100464AD3 /* Cabs.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1110, 2340}}"; + sepNavSelRange = "{236, 0}"; + sepNavVisRange = "{3320, 524}"; + sepNavWindowFrame = "{{28, 184}, {895, 694}}"; + }; + }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {859, 20267}}"; + sepNavSelRange = "{10616, 0}"; + sepNavVisRange = "{9653, 2414}"; + sepNavWindowFrame = "{{15, 42}, {895, 831}}"; + }; + }; + 24D8286F09A914000093AEF8 /* CabsProc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {750, 50490}}"; + sepNavSelRange = "{110397, 0}"; + sepNavVisRange = "{110335, 169}"; + sepNavWindowFrame = "{{53, 17}, {1370, 861}}"; + }; + }; + 8B02375E1D42B1C400E1E8C8 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 8B02375F1D42B1C400E1E8C8 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8B9D6B4827C2FAD800C49ABD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24D8286F09A914000093AEF8 /* CabsProc.cpp */; + name = "CabsProc.cpp: 1415"; + rLen = 0; + rLoc = 110397; + rType = 0; + vrLen = 169; + vrLoc = 110335; + }; + 8BCCEDD027C2F9C500202ED0 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24D8286F09A914000093AEF8 /* CabsProc.cpp */; + name = "CabsProc.cpp: 1415"; + rLen = 0; + rLoc = 110397; + rType = 0; + vrLen = 169; + vrLoc = 110335; + }; + 8D01CCC60486CAD60068D4B7 /* Cabs */ = { + activeExec = 0; + }; +} diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 new file mode 100644 index 000000000..a089278fe --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/christopherjohnson.perspectivev3 @@ -0,0 +1,1510 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + AIODescriptionKey + DockingSystemVisible + + Extension + perspectivev3 + FavBarConfig + + PBXProjectModuleGUID + 8B02375D1D42B1C400E1E8C8 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.defaultV3 + MajorVersion + 34 + MinorVersion + 0 + Name + All-In-One + Notifications + + + XCObserverAutoDisconnectKey + + XCObserverDefintionKey + + PBXStatusErrorsKey + 0 + + XCObserverFactoryKey + XCPerspectivesSpecificationIdentifier + XCObserverGUIDKey + XCObserverProjectIdentifier + XCObserverNotificationKey + PBXStatusBuildStateMessageNotification + XCObserverTargetKey + XCMainBuildResultsModuleGUID + XCObserverTriggerKey + awakenModuleWithObserver: + XCObserverValidationKey + + PBXStatusErrorsKey + 2 + + + + OpenEditors + + PerspectiveWidths + + 810 + 810 + + Perspectives + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CA23ED40692098700951B8B + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 185 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 1C37FBAC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 6 + 4 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {185, 428}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {202, 446}} + GroupTreeTableConfiguration + + MainColumn + 185 + + RubberWindowFrame + 613 383 810 487 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 202pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 8B0237581D42B1C400E1E8C8 + PBXProjectModuleLabel + CabsProc.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 8B0237591D42B1C400E1E8C8 + PBXProjectModuleLabel + CabsProc.cpp + _historyCapacity + 0 + bookmark + 8B9D6B4827C2FAD800C49ABD + history + + 8BCCEDD027C2F9C500202ED0 + + + SplitCount + 1 + + StatusBarVisibility + + XCSharingToken + com.apple.Xcode.CommonNavigatorGroupSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {603, 102}} + RubberWindowFrame + 613 383 810 487 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 102pt + + + Proportion + 339pt + Tabs + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EDF0692099D00951B8B + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{10, 27}, {603, 312}} + RubberWindowFrame + 613 383 810 487 0 0 1440 878 + + Module + XCDetailModule + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EE00692099D00951B8B + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXProjectFindModule + + + ContentConfiguration + + PBXCVSModuleFilterTypeKey + 1032 + PBXProjectModuleGUID + 1CA23EE10692099D00951B8B + PBXProjectModuleLabel + SCM Results + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXCVSModule + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1023 + XCBuildResultsTrigger_Open + 1012 + + GeometryConfiguration + + Frame + {{10, 27}, {603, 282}} + + Module + PBXBuildResultsModule + + + + + Proportion + 603pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDockableTabModule + XCDetailModule + PBXProjectFindModule + PBXCVSModule + PBXBuildResultsModule + + TableOfContents + + 8B9D6B4927C2FAD800C49ABD + 1CA23ED40692098700951B8B + 8B9D6B4A27C2FAD800C49ABD + 8B0237581D42B1C400E1E8C8 + 8B9D6B4B27C2FAD800C49ABD + 1CA23EDF0692099D00951B8B + 1CA23EE00692099D00951B8B + 1CA23EE10692099D00951B8B + XCMainBuildResultsModuleGUID + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + debugger-restart-executable + debugger-pause + debugger-step-over + debugger-step-into + debugger-step-out + NSToolbarFlexibleSpaceItem + servicesModulebreakpoints + debugger-show-console-window + + ControllerClassBaseName + PBXDebugSessionModule + IconName + DebugTabIcon + Identifier + perspective.debug + IsVertical + 1 + Layout + + + ContentConfiguration + + PBXProjectModuleGUID + 1CCC7628064C1048000F2A68 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {810, 0}} + + Module + PBXDebugCLIModule + Proportion + 0% + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {395, 213}} + {{395, 0}, {415, 213}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {810, 213}} + {{0, 213}, {810, 225}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1CCC7629064C1048000F2A68 + PBXProjectModuleLabel + Debug + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 7}, {810, 438}} + + Module + PBXDebugSessionModule + Proportion + 443pt + + + Name + Debug + ServiceClasses + + XCModuleDock + XCModuleDock + PBXDebugCLIModule + PBXDebugSessionModule + XCConsole + + TableOfContents + + 1CC8E6A5069209BD00BB180A + 1CC8E6A6069209BD00BB180A + 1CCC7628064C1048000F2A68 + 1CCC7629064C1048000F2A68 + 1CC8E6A7069209BD00BB180A + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' + StatusbarIsVisible + + TimeStamp + 667089624.515203 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + + WindowJustification + 5 + WindowOrderList + + /Users/christopherjohnson/Desktop/airwindows/plugins/MacVST/Cabs/Cabs.xcodeproj + + WindowString + 613 383 810 487 0 0 1440 878 + WindowToolsV3 + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.build + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {500, 215}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + + GeometryConfiguration + + Frame + {{0, 222}, {500, 236}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 458pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 192 257 500 500 0 0 1280 1002 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {700, 358}} + RubberWindowFrame + 149 87 700 400 0 0 1440 878 + + Module + PBXDebugCLIModule + Proportion + 358pt + + + Proportion + 358pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D5B069F1CE1000CFCEE + 1C530D5C069F1CE1000CFCEE + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 149 87 440 400 0 0 1440 878 + WindowToolGUID + 1C530D5B069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.09500122070312 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scmV3 + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 166pt + + + Proportion + 166pt + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.projectFormatConflicts + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 8BCAE52E1D49920D0047D4BD + + GeometryConfiguration + + Frame + {{0, 0}, {472, 302}} + RubberWindowFrame + 569 378 472 322 0 0 1440 878 + + Module + XCProjectFormatConflictsModule + Proportion + 302pt + + + Proportion + 302pt + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + + TableOfContents + + 8BCAE52F1D49920D0047D4BD + 8BCAE5301D49920D0047D4BD + 8BCAE52E1D49920D0047D4BD + + WindowContentMinSize + 450 300 + WindowString + 569 378 472 322 0 0 1440 878 + WindowToolGUID + 8BCAE52F1D49920D0047D4BD + WindowToolIsVisible + + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {369, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {616, 353}} + MembersFrame + {{0, 105}, {369, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 94 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 597 125 616 374 0 0 1280 1002 + + Module + PBXClassBrowserModule + Proportion + 354pt + + + Proportion + 354pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C78EABA065D492600B07095 + 1C78EABB065D492600B07095 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 597 125 616 374 0 0 1280 1002 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.pbxproj b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.pbxproj new file mode 100755 index 000000000..20d019cb3 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.pbxproj @@ -0,0 +1,2201 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 2407DEB9089929BA00EB68BF /* Cabs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2407DEB6089929BA00EB68BF /* Cabs.cpp */; }; + 245463B90991757100464AD3 /* Cabs.h in Headers */ = {isa = PBXBuildFile; fileRef = 245463B80991757100464AD3 /* Cabs.h */; }; + 24A202190F90D1DE003BB5A7 /* aeffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF910F90D1DD003BB5A7 /* aeffect.h */; }; + 24A2021A0F90D1DE003BB5A7 /* aeffectx.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */; }; + 24A2021B0F90D1DE003BB5A7 /* vstfxstore.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */; }; + 24A2021D0F90D1DE003BB5A7 /* adelay.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF990F90D1DD003BB5A7 /* adelay.h */; }; + 24A202240F90D1DE003BB5A7 /* sdeditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */; }; + 24A202260F90D1DE003BB5A7 /* surrounddelay.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */; }; + 24A2022A0F90D1DE003BB5A7 /* again.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFAB0F90D1DD003BB5A7 /* again.h */; }; + 24A202330F90D1DE003BB5A7 /* gmnames.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */; }; + 24A202350F90D1DE003BB5A7 /* vstxsynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */; }; + 24A202460F90D1DE003BB5A7 /* aeffeditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */; }; + 24A202480F90D1DE003BB5A7 /* audioeffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */; }; + 24A2024A0F90D1DE003BB5A7 /* audioeffectx.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */; }; + 24A2024D0F90D1DE003BB5A7 /* cw_vst_prefix.pch++ in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */; }; + 24A202510F90D1DE003BB5A7 /* xcode_au_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */; }; + 24A202520F90D1DE003BB5A7 /* xcode_vst_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */; }; + 24A202680F90D1DE003BB5A7 /* controlsgui.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200050F90D1DD003BB5A7 /* controlsgui.h */; }; + 24A2026A0F90D1DE003BB5A7 /* pdrawtesteditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */; }; + 24A2026C0F90D1DE003BB5A7 /* pdrawtesteffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */; }; + 24A2026F0F90D1DE003BB5A7 /* pdrawtestview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */; }; + 24A202710F90D1DE003BB5A7 /* pprimitivesviews.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */; }; + 24A202780F90D1DE003BB5A7 /* aeffguieditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */; }; + 24A2027A0F90D1DE003BB5A7 /* cfileselector.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */; }; + 24A2027D0F90D1DE003BB5A7 /* cscrollview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */; }; + 24A2027F0F90D1DE003BB5A7 /* ctabview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001F0F90D1DD003BB5A7 /* ctabview.h */; }; + 24A203A50F90D1DE003BB5A7 /* plugguieditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201470F90D1DE003BB5A7 /* plugguieditor.h */; }; + 24A203A70F90D1DE003BB5A7 /* vstcontrols.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201490F90D1DE003BB5A7 /* vstcontrols.h */; }; + 24A203A90F90D1DE003BB5A7 /* vstgui.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014B0F90D1DE003BB5A7 /* vstgui.h */; }; + 24A203AA0F90D1DE003BB5A7 /* vstkeycode.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */; }; + 24A203AB0F90D1DE003BB5A7 /* vstplugscarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */; }; + 24A203AC0F90D1DE003BB5A7 /* vstplugsmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */; }; + 24A203AD0F90D1DE003BB5A7 /* vstplugsmacho.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */; }; + 24A203AE0F90D1DE003BB5A7 /* vstplugsquartz.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */; }; + 24A203CB0F90D251003BB5A7 /* audioeffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */; }; + 24A203CC0F90D251003BB5A7 /* audioeffectx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; }; + 24A203CD0F90D251003BB5A7 /* vstplugmain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */; }; + 24CFB70407E7A0220081BD57 /* PkgInfo in Resources */ = {isa = PBXBuildFile; fileRef = 24CFB70307E7A0220081BD57 /* PkgInfo */; }; + 24D8287009A914000093AEF8 /* CabsProc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24D8286F09A914000093AEF8 /* CabsProc.cpp */; }; + 24D8287F09A9164A0093AEF8 /* xcode_vst_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 24A203D60F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = again; + }; + 24A203D80F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4476974093DAE42008998C4; + remoteInfo = adelay; + }; + 24A203DA0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4FF52220929FBF500DDED7A; + remoteInfo = vstxsynth; + }; + 24A203DC0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4476A10093DCAF9008998C4; + remoteInfo = surrounddelay; + }; + 24A203DE0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4FF52F3092A312800DDED7A; + remoteInfo = minihost; + }; + 24A203E40F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = AudioUnit; + }; + 24A203E60F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + proxyType = 2; + remoteGlobalIDString = F4C9F1D407B2320800010DAD; + remoteInfo = VST; + }; + 24A203EC0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = AudioUnit; + }; + 24A203EE0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4C9F1D407B2320800010DAD; + remoteInfo = VST; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 2407DE920899296600EB68BF /* Cabs.vst */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Cabs.vst; sourceTree = BUILT_PRODUCTS_DIR; }; + 2407DEB6089929BA00EB68BF /* Cabs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Cabs.cpp; path = source/Cabs.cpp; sourceTree = ""; }; + 2434720A098313350063BBF1 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + 245463B80991757100464AD3 /* Cabs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Cabs.h; path = source/Cabs.h; sourceTree = ""; }; + 24A200000F90D1DD003BB5A7 /* bmp10014.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10014.bmp; sourceTree = ""; }; + 24A200010F90D1DD003BB5A7 /* bmp10015.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10015.bmp; sourceTree = ""; }; + 24A200020F90D1DD003BB5A7 /* bmp10016.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10016.bmp; sourceTree = ""; }; + 24A200040F90D1DD003BB5A7 /* controlsgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlsgui.cpp; sourceTree = ""; }; + 24A200050F90D1DD003BB5A7 /* controlsgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controlsgui.h; sourceTree = ""; }; + 24A200060F90D1DD003BB5A7 /* pdrawtesteditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtesteditor.cpp; sourceTree = ""; }; + 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtesteditor.h; sourceTree = ""; }; + 24A200080F90D1DD003BB5A7 /* pdrawtesteffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtesteffect.cpp; sourceTree = ""; }; + 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtesteffect.h; sourceTree = ""; }; + 24A2000A0F90D1DD003BB5A7 /* pdrawtestmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtestmain.cpp; sourceTree = ""; }; + 24A2000B0F90D1DD003BB5A7 /* pdrawtestview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtestview.cpp; sourceTree = ""; }; + 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtestview.h; sourceTree = ""; }; + 24A2000D0F90D1DD003BB5A7 /* pprimitivesviews.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pprimitivesviews.cpp; sourceTree = ""; }; + 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pprimitivesviews.h; sourceTree = ""; }; + 24A200100F90D1DD003BB5A7 /* drawtest.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.def; sourceTree = ""; }; + 24A200110F90D1DD003BB5A7 /* drawtest.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.rc; sourceTree = ""; }; + 24A200120F90D1DD003BB5A7 /* drawtest.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = drawtest.vcproj; sourceTree = ""; }; + 24A200140F90D1DD003BB5A7 /* drawtest.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.dsp; sourceTree = ""; }; + 24A200150F90D1DD003BB5A7 /* drawtest.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.dsw; sourceTree = ""; }; + 24A200170F90D1DD003BB5A7 /* aeffguieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aeffguieditor.cpp; sourceTree = ""; }; + 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffguieditor.h; sourceTree = ""; }; + 24A200190F90D1DD003BB5A7 /* cfileselector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cfileselector.cpp; sourceTree = ""; }; + 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfileselector.h; sourceTree = ""; }; + 24A2001B0F90D1DD003BB5A7 /* Changelog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changelog; sourceTree = ""; }; + 24A2001C0F90D1DD003BB5A7 /* cscrollview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cscrollview.cpp; sourceTree = ""; }; + 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cscrollview.h; sourceTree = ""; }; + 24A2001E0F90D1DD003BB5A7 /* ctabview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctabview.cpp; sourceTree = ""; }; + 24A2001F0F90D1DD003BB5A7 /* ctabview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctabview.h; sourceTree = ""; }; + 24A200220F90D1DD003BB5A7 /* aeffguieditor_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = aeffguieditor_8cpp.html; sourceTree = ""; }; + 24A200230F90D1DD003BB5A7 /* aeffguieditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = aeffguieditor_8h.html; sourceTree = ""; }; + 24A200240F90D1DD003BB5A7 /* annotated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = annotated.html; sourceTree = ""; }; + 24A200250F90D1DD003BB5A7 /* cfileselector_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cfileselector_8cpp.html; sourceTree = ""; }; + 24A200260F90D1DD003BB5A7 /* cfileselector_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cfileselector_8h.html; sourceTree = ""; }; + 24A200270F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_a_eff_g_u_i_editor-members.html"; sourceTree = ""; }; + 24A200280F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_a_eff_g_u_i_editor.html; sourceTree = ""; }; + 24A200290F90D1DD003BB5A7 /* class_c_anim_knob-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_anim_knob-members.html"; sourceTree = ""; }; + 24A2002A0F90D1DD003BB5A7 /* class_c_anim_knob.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_anim_knob.html; sourceTree = ""; }; + 24A2002B0F90D1DD003BB5A7 /* class_c_anim_knob.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_anim_knob.png; sourceTree = ""; }; + 24A2002C0F90D1DD003BB5A7 /* class_c_attribute_list_entry-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_attribute_list_entry-members.html"; sourceTree = ""; }; + 24A2002D0F90D1DD003BB5A7 /* class_c_attribute_list_entry.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_attribute_list_entry.html; sourceTree = ""; }; + 24A2002E0F90D1DD003BB5A7 /* class_c_auto_animation-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_auto_animation-members.html"; sourceTree = ""; }; + 24A2002F0F90D1DD003BB5A7 /* class_c_auto_animation.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_auto_animation.html; sourceTree = ""; }; + 24A200300F90D1DD003BB5A7 /* class_c_auto_animation.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_auto_animation.png; sourceTree = ""; }; + 24A200310F90D1DD003BB5A7 /* class_c_bitmap-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_bitmap-members.html"; sourceTree = ""; }; + 24A200320F90D1DD003BB5A7 /* class_c_bitmap.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_bitmap.html; sourceTree = ""; }; + 24A200330F90D1DD003BB5A7 /* class_c_bitmap.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_bitmap.png; sourceTree = ""; }; + 24A200340F90D1DD003BB5A7 /* class_c_c_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_c_view-members.html"; sourceTree = ""; }; + 24A200350F90D1DD003BB5A7 /* class_c_c_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_c_view.html; sourceTree = ""; }; + 24A200360F90D1DD003BB5A7 /* class_c_control-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_control-members.html"; sourceTree = ""; }; + 24A200370F90D1DD003BB5A7 /* class_c_control.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_control.html; sourceTree = ""; }; + 24A200380F90D1DD003BB5A7 /* class_c_control.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_control.png; sourceTree = ""; }; + 24A200390F90D1DD003BB5A7 /* class_c_control_listener-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_control_listener-members.html"; sourceTree = ""; }; + 24A2003A0F90D1DD003BB5A7 /* class_c_control_listener.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_control_listener.html; sourceTree = ""; }; + 24A2003B0F90D1DD003BB5A7 /* class_c_control_listener.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_control_listener.png; sourceTree = ""; }; + 24A2003C0F90D1DD003BB5A7 /* class_c_drag_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_drag_container-members.html"; sourceTree = ""; }; + 24A2003D0F90D1DD003BB5A7 /* class_c_drag_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_drag_container.html; sourceTree = ""; }; + 24A2003E0F90D1DD003BB5A7 /* class_c_drag_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_drag_container.png; sourceTree = ""; }; + 24A2003F0F90D1DD003BB5A7 /* class_c_draw_context-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_draw_context-members.html"; sourceTree = ""; }; + 24A200400F90D1DD003BB5A7 /* class_c_draw_context.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_draw_context.html; sourceTree = ""; }; + 24A200410F90D1DD003BB5A7 /* class_c_draw_context.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_draw_context.png; sourceTree = ""; }; + 24A200420F90D1DD003BB5A7 /* class_c_file_selector-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_file_selector-members.html"; sourceTree = ""; }; + 24A200430F90D1DD003BB5A7 /* class_c_file_selector.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_file_selector.html; sourceTree = ""; }; + 24A200440F90D1DD003BB5A7 /* class_c_frame-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_frame-members.html"; sourceTree = ""; }; + 24A200450F90D1DD003BB5A7 /* class_c_frame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_frame.html; sourceTree = ""; }; + 24A200460F90D1DD003BB5A7 /* class_c_frame.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_frame.png; sourceTree = ""; }; + 24A200470F90D1DD003BB5A7 /* class_c_horizontal_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_horizontal_slider-members.html"; sourceTree = ""; }; + 24A200480F90D1DD003BB5A7 /* class_c_horizontal_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_horizontal_slider.html; sourceTree = ""; }; + 24A200490F90D1DD003BB5A7 /* class_c_horizontal_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_horizontal_slider.png; sourceTree = ""; }; + 24A2004A0F90D1DD003BB5A7 /* class_c_horizontal_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_horizontal_switch-members.html"; sourceTree = ""; }; + 24A2004B0F90D1DD003BB5A7 /* class_c_horizontal_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_horizontal_switch.html; sourceTree = ""; }; + 24A2004C0F90D1DD003BB5A7 /* class_c_horizontal_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_horizontal_switch.png; sourceTree = ""; }; + 24A2004D0F90D1DD003BB5A7 /* class_c_kick_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_kick_button-members.html"; sourceTree = ""; }; + 24A2004E0F90D1DD003BB5A7 /* class_c_kick_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_kick_button.html; sourceTree = ""; }; + 24A2004F0F90D1DD003BB5A7 /* class_c_kick_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_kick_button.png; sourceTree = ""; }; + 24A200500F90D1DD003BB5A7 /* class_c_knob-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_knob-members.html"; sourceTree = ""; }; + 24A200510F90D1DD003BB5A7 /* class_c_knob.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_knob.html; sourceTree = ""; }; + 24A200520F90D1DD003BB5A7 /* class_c_knob.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_knob.png; sourceTree = ""; }; + 24A200530F90D1DD003BB5A7 /* class_c_movie_bitmap-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_movie_bitmap-members.html"; sourceTree = ""; }; + 24A200540F90D1DD003BB5A7 /* class_c_movie_bitmap.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_movie_bitmap.html; sourceTree = ""; }; + 24A200550F90D1DD003BB5A7 /* class_c_movie_bitmap.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_movie_bitmap.png; sourceTree = ""; }; + 24A200560F90D1DD003BB5A7 /* class_c_movie_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_movie_button-members.html"; sourceTree = ""; }; + 24A200570F90D1DD003BB5A7 /* class_c_movie_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_movie_button.html; sourceTree = ""; }; + 24A200580F90D1DD003BB5A7 /* class_c_movie_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_movie_button.png; sourceTree = ""; }; + 24A200590F90D1DD003BB5A7 /* class_c_offscreen_context-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_offscreen_context-members.html"; sourceTree = ""; }; + 24A2005A0F90D1DD003BB5A7 /* class_c_offscreen_context.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_offscreen_context.html; sourceTree = ""; }; + 24A2005B0F90D1DD003BB5A7 /* class_c_offscreen_context.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_offscreen_context.png; sourceTree = ""; }; + 24A2005C0F90D1DD003BB5A7 /* class_c_on_off_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_on_off_button-members.html"; sourceTree = ""; }; + 24A2005D0F90D1DD003BB5A7 /* class_c_on_off_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_on_off_button.html; sourceTree = ""; }; + 24A2005E0F90D1DD003BB5A7 /* class_c_on_off_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_on_off_button.png; sourceTree = ""; }; + 24A2005F0F90D1DD003BB5A7 /* class_c_option_menu-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_option_menu-members.html"; sourceTree = ""; }; + 24A200600F90D1DD003BB5A7 /* class_c_option_menu.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_option_menu.html; sourceTree = ""; }; + 24A200610F90D1DD003BB5A7 /* class_c_option_menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_option_menu.png; sourceTree = ""; }; + 24A200620F90D1DD003BB5A7 /* class_c_option_menu_scheme-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_option_menu_scheme-members.html"; sourceTree = ""; }; + 24A200630F90D1DD003BB5A7 /* class_c_option_menu_scheme.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_option_menu_scheme.html; sourceTree = ""; }; + 24A200640F90D1DD003BB5A7 /* class_c_option_menu_scheme.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_option_menu_scheme.png; sourceTree = ""; }; + 24A200650F90D1DD003BB5A7 /* class_c_param_display-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_param_display-members.html"; sourceTree = ""; }; + 24A200660F90D1DD003BB5A7 /* class_c_param_display.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_param_display.html; sourceTree = ""; }; + 24A200670F90D1DD003BB5A7 /* class_c_param_display.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_param_display.png; sourceTree = ""; }; + 24A200680F90D1DD003BB5A7 /* class_c_reference_counter-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_reference_counter-members.html"; sourceTree = ""; }; + 24A200690F90D1DD003BB5A7 /* class_c_reference_counter.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_reference_counter.html; sourceTree = ""; }; + 24A2006A0F90D1DD003BB5A7 /* class_c_reference_counter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_reference_counter.png; sourceTree = ""; }; + 24A2006B0F90D1DD003BB5A7 /* class_c_rocker_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_rocker_switch-members.html"; sourceTree = ""; }; + 24A2006C0F90D1DD003BB5A7 /* class_c_rocker_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_rocker_switch.html; sourceTree = ""; }; + 24A2006D0F90D1DD003BB5A7 /* class_c_rocker_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_rocker_switch.png; sourceTree = ""; }; + 24A2006E0F90D1DD003BB5A7 /* class_c_scroll_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scroll_container-members.html"; sourceTree = ""; }; + 24A2006F0F90D1DD003BB5A7 /* class_c_scroll_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scroll_container.html; sourceTree = ""; }; + 24A200700F90D1DD003BB5A7 /* class_c_scroll_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scroll_container.png; sourceTree = ""; }; + 24A200710F90D1DD003BB5A7 /* class_c_scroll_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scroll_view-members.html"; sourceTree = ""; }; + 24A200720F90D1DD003BB5A7 /* class_c_scroll_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scroll_view.html; sourceTree = ""; }; + 24A200730F90D1DD003BB5A7 /* class_c_scroll_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scroll_view.png; sourceTree = ""; }; + 24A200740F90D1DD003BB5A7 /* class_c_scrollbar-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scrollbar-members.html"; sourceTree = ""; }; + 24A200750F90D1DD003BB5A7 /* class_c_scrollbar.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scrollbar.html; sourceTree = ""; }; + 24A200760F90D1DD003BB5A7 /* class_c_scrollbar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scrollbar.png; sourceTree = ""; }; + 24A200770F90D1DD003BB5A7 /* class_c_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_slider-members.html"; sourceTree = ""; }; + 24A200780F90D1DD003BB5A7 /* class_c_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_slider.html; sourceTree = ""; }; + 24A200790F90D1DD003BB5A7 /* class_c_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_slider.png; sourceTree = ""; }; + 24A2007A0F90D1DD003BB5A7 /* class_c_special_digit-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_special_digit-members.html"; sourceTree = ""; }; + 24A2007B0F90D1DD003BB5A7 /* class_c_special_digit.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_special_digit.html; sourceTree = ""; }; + 24A2007C0F90D1DD003BB5A7 /* class_c_special_digit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_special_digit.png; sourceTree = ""; }; + 24A2007D0F90D1DD003BB5A7 /* class_c_splash_screen-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_splash_screen-members.html"; sourceTree = ""; }; + 24A2007E0F90D1DD003BB5A7 /* class_c_splash_screen.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_splash_screen.html; sourceTree = ""; }; + 24A2007F0F90D1DD003BB5A7 /* class_c_splash_screen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_splash_screen.png; sourceTree = ""; }; + 24A200800F90D1DD003BB5A7 /* class_c_splash_screen_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_splash_screen_view-members.html"; sourceTree = ""; }; + 24A200810F90D1DD003BB5A7 /* class_c_splash_screen_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_splash_screen_view.html; sourceTree = ""; }; + 24A200820F90D1DD003BB5A7 /* class_c_splash_screen_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_splash_screen_view.png; sourceTree = ""; }; + 24A200830F90D1DD003BB5A7 /* class_c_tab_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_button-members.html"; sourceTree = ""; }; + 24A200840F90D1DD003BB5A7 /* class_c_tab_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_button.html; sourceTree = ""; }; + 24A200850F90D1DD003BB5A7 /* class_c_tab_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_button.png; sourceTree = ""; }; + 24A200860F90D1DD003BB5A7 /* class_c_tab_child_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_child_view-members.html"; sourceTree = ""; }; + 24A200870F90D1DD003BB5A7 /* class_c_tab_child_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_child_view.html; sourceTree = ""; }; + 24A200880F90D1DD003BB5A7 /* class_c_tab_child_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_child_view.png; sourceTree = ""; }; + 24A200890F90D1DD003BB5A7 /* class_c_tab_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_view-members.html"; sourceTree = ""; }; + 24A2008A0F90D1DD003BB5A7 /* class_c_tab_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_view.html; sourceTree = ""; }; + 24A2008B0F90D1DD003BB5A7 /* class_c_tab_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_view.png; sourceTree = ""; }; + 24A2008C0F90D1DD003BB5A7 /* class_c_text_edit-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_text_edit-members.html"; sourceTree = ""; }; + 24A2008D0F90D1DD003BB5A7 /* class_c_text_edit.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_text_edit.html; sourceTree = ""; }; + 24A2008E0F90D1DD003BB5A7 /* class_c_text_edit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_text_edit.png; sourceTree = ""; }; + 24A2008F0F90D1DD003BB5A7 /* class_c_text_label-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_text_label-members.html"; sourceTree = ""; }; + 24A200900F90D1DD003BB5A7 /* class_c_text_label.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_text_label.html; sourceTree = ""; }; + 24A200910F90D1DD003BB5A7 /* class_c_text_label.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_text_label.png; sourceTree = ""; }; + 24A200920F90D1DD003BB5A7 /* class_c_vertical_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vertical_slider-members.html"; sourceTree = ""; }; + 24A200930F90D1DD003BB5A7 /* class_c_vertical_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vertical_slider.html; sourceTree = ""; }; + 24A200940F90D1DD003BB5A7 /* class_c_vertical_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vertical_slider.png; sourceTree = ""; }; + 24A200950F90D1DD003BB5A7 /* class_c_vertical_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vertical_switch-members.html"; sourceTree = ""; }; + 24A200960F90D1DD003BB5A7 /* class_c_vertical_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vertical_switch.html; sourceTree = ""; }; + 24A200970F90D1DD003BB5A7 /* class_c_vertical_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vertical_switch.png; sourceTree = ""; }; + 24A200980F90D1DD003BB5A7 /* class_c_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_view-members.html"; sourceTree = ""; }; + 24A200990F90D1DD003BB5A7 /* class_c_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_view.html; sourceTree = ""; }; + 24A2009A0F90D1DD003BB5A7 /* class_c_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_view.png; sourceTree = ""; }; + 24A2009B0F90D1DD003BB5A7 /* class_c_view_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_view_container-members.html"; sourceTree = ""; }; + 24A2009C0F90D1DD003BB5A7 /* class_c_view_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_view_container.html; sourceTree = ""; }; + 24A2009D0F90D1DD003BB5A7 /* class_c_view_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_view_container.png; sourceTree = ""; }; + 24A2009E0F90D1DD003BB5A7 /* class_c_vu_meter-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vu_meter-members.html"; sourceTree = ""; }; + 24A2009F0F90D1DD003BB5A7 /* class_c_vu_meter.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vu_meter.html; sourceTree = ""; }; + 24A200A00F90D1DD003BB5A7 /* class_c_vu_meter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vu_meter.png; sourceTree = ""; }; + 24A200A10F90D1DD003BB5A7 /* class_i_scrollbar_drawer-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_i_scrollbar_drawer-members.html"; sourceTree = ""; }; + 24A200A20F90D1DD003BB5A7 /* class_i_scrollbar_drawer.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_i_scrollbar_drawer.html; sourceTree = ""; }; + 24A200A30F90D1DD003BB5A7 /* class_plugin_g_u_i_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_plugin_g_u_i_editor-members.html"; sourceTree = ""; }; + 24A200A40F90D1DD003BB5A7 /* class_plugin_g_u_i_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_plugin_g_u_i_editor.html; sourceTree = ""; }; + 24A200A50F90D1DD003BB5A7 /* cscrollview_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cscrollview_8cpp.html; sourceTree = ""; }; + 24A200A60F90D1DD003BB5A7 /* cscrollview_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cscrollview_8h.html; sourceTree = ""; }; + 24A200A70F90D1DD003BB5A7 /* ctabview_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = ctabview_8cpp.html; sourceTree = ""; }; + 24A200A80F90D1DD003BB5A7 /* ctabview_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = ctabview_8h.html; sourceTree = ""; }; + 24A200A90F90D1DD003BB5A7 /* deprecated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = deprecated.html; sourceTree = ""; }; + 24A200AA0F90D1DD003BB5A7 /* doc_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = doc_8h.html; sourceTree = ""; }; + 24A200AB0F90D1DD003BB5A7 /* doxygen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = doxygen.css; sourceTree = ""; }; + 24A200AC0F90D1DD003BB5A7 /* doxygen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doxygen.png; sourceTree = ""; }; + 24A200AD0F90D1DD003BB5A7 /* files.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = files.html; sourceTree = ""; }; + 24A200AE0F90D1DD003BB5A7 /* ftv2blank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2blank.png; sourceTree = ""; }; + 24A200AF0F90D1DD003BB5A7 /* ftv2doc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2doc.png; sourceTree = ""; }; + 24A200B00F90D1DD003BB5A7 /* ftv2folderclosed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderclosed.png; sourceTree = ""; }; + 24A200B10F90D1DE003BB5A7 /* ftv2folderopen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderopen.png; sourceTree = ""; }; + 24A200B20F90D1DE003BB5A7 /* ftv2lastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2lastnode.png; sourceTree = ""; }; + 24A200B30F90D1DE003BB5A7 /* ftv2link.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2link.png; sourceTree = ""; }; + 24A200B40F90D1DE003BB5A7 /* ftv2mlastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mlastnode.png; sourceTree = ""; }; + 24A200B50F90D1DE003BB5A7 /* ftv2mnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mnode.png; sourceTree = ""; }; + 24A200B60F90D1DE003BB5A7 /* ftv2node.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2node.png; sourceTree = ""; }; + 24A200B70F90D1DE003BB5A7 /* ftv2plastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2plastnode.png; sourceTree = ""; }; + 24A200B80F90D1DE003BB5A7 /* ftv2pnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2pnode.png; sourceTree = ""; }; + 24A200B90F90D1DE003BB5A7 /* ftv2vertline.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2vertline.png; sourceTree = ""; }; + 24A200BA0F90D1DE003BB5A7 /* functions.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions.html; sourceTree = ""; }; + 24A200BB0F90D1DE003BB5A7 /* functions_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x62.html; sourceTree = ""; }; + 24A200BC0F90D1DE003BB5A7 /* functions_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x63.html; sourceTree = ""; }; + 24A200BD0F90D1DE003BB5A7 /* functions_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x64.html; sourceTree = ""; }; + 24A200BE0F90D1DE003BB5A7 /* functions_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x65.html; sourceTree = ""; }; + 24A200BF0F90D1DE003BB5A7 /* functions_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x66.html; sourceTree = ""; }; + 24A200C00F90D1DE003BB5A7 /* functions_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x67.html; sourceTree = ""; }; + 24A200C10F90D1DE003BB5A7 /* functions_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x68.html; sourceTree = ""; }; + 24A200C20F90D1DE003BB5A7 /* functions_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x69.html; sourceTree = ""; }; + 24A200C30F90D1DE003BB5A7 /* functions_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6b.html; sourceTree = ""; }; + 24A200C40F90D1DE003BB5A7 /* functions_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6c.html; sourceTree = ""; }; + 24A200C50F90D1DE003BB5A7 /* functions_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6d.html; sourceTree = ""; }; + 24A200C60F90D1DE003BB5A7 /* functions_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6e.html; sourceTree = ""; }; + 24A200C70F90D1DE003BB5A7 /* functions_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6f.html; sourceTree = ""; }; + 24A200C80F90D1DE003BB5A7 /* functions_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x70.html; sourceTree = ""; }; + 24A200C90F90D1DE003BB5A7 /* functions_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x72.html; sourceTree = ""; }; + 24A200CA0F90D1DE003BB5A7 /* functions_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x73.html; sourceTree = ""; }; + 24A200CB0F90D1DE003BB5A7 /* functions_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x74.html; sourceTree = ""; }; + 24A200CC0F90D1DE003BB5A7 /* functions_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x75.html; sourceTree = ""; }; + 24A200CD0F90D1DE003BB5A7 /* functions_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x76.html; sourceTree = ""; }; + 24A200CE0F90D1DE003BB5A7 /* functions_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x77.html; sourceTree = ""; }; + 24A200CF0F90D1DE003BB5A7 /* functions_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x78.html; sourceTree = ""; }; + 24A200D00F90D1DE003BB5A7 /* functions_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x79.html; sourceTree = ""; }; + 24A200D10F90D1DE003BB5A7 /* functions_0x7a.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x7a.html; sourceTree = ""; }; + 24A200D20F90D1DE003BB5A7 /* functions_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x7e.html; sourceTree = ""; }; + 24A200D30F90D1DE003BB5A7 /* functions_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_eval.html; sourceTree = ""; }; + 24A200D40F90D1DE003BB5A7 /* functions_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func.html; sourceTree = ""; }; + 24A200D50F90D1DE003BB5A7 /* functions_func_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x62.html; sourceTree = ""; }; + 24A200D60F90D1DE003BB5A7 /* functions_func_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x63.html; sourceTree = ""; }; + 24A200D70F90D1DE003BB5A7 /* functions_func_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x64.html; sourceTree = ""; }; + 24A200D80F90D1DE003BB5A7 /* functions_func_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x65.html; sourceTree = ""; }; + 24A200D90F90D1DE003BB5A7 /* functions_func_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x66.html; sourceTree = ""; }; + 24A200DA0F90D1DE003BB5A7 /* functions_func_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x67.html; sourceTree = ""; }; + 24A200DB0F90D1DE003BB5A7 /* functions_func_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x68.html; sourceTree = ""; }; + 24A200DC0F90D1DE003BB5A7 /* functions_func_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x69.html; sourceTree = ""; }; + 24A200DD0F90D1DE003BB5A7 /* functions_func_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6c.html; sourceTree = ""; }; + 24A200DE0F90D1DE003BB5A7 /* functions_func_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6d.html; sourceTree = ""; }; + 24A200DF0F90D1DE003BB5A7 /* functions_func_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6e.html; sourceTree = ""; }; + 24A200E00F90D1DE003BB5A7 /* functions_func_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6f.html; sourceTree = ""; }; + 24A200E10F90D1DE003BB5A7 /* functions_func_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x70.html; sourceTree = ""; }; + 24A200E20F90D1DE003BB5A7 /* functions_func_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x72.html; sourceTree = ""; }; + 24A200E30F90D1DE003BB5A7 /* functions_func_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x73.html; sourceTree = ""; }; + 24A200E40F90D1DE003BB5A7 /* functions_func_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x74.html; sourceTree = ""; }; + 24A200E50F90D1DE003BB5A7 /* functions_func_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x75.html; sourceTree = ""; }; + 24A200E60F90D1DE003BB5A7 /* functions_func_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x76.html; sourceTree = ""; }; + 24A200E70F90D1DE003BB5A7 /* functions_func_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x77.html; sourceTree = ""; }; + 24A200E80F90D1DE003BB5A7 /* functions_func_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x7e.html; sourceTree = ""; }; + 24A200E90F90D1DE003BB5A7 /* functions_rela.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_rela.html; sourceTree = ""; }; + 24A200EA0F90D1DE003BB5A7 /* functions_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars.html; sourceTree = ""; }; + 24A200EB0F90D1DE003BB5A7 /* functions_vars_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x62.html; sourceTree = ""; }; + 24A200EC0F90D1DE003BB5A7 /* functions_vars_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x63.html; sourceTree = ""; }; + 24A200ED0F90D1DE003BB5A7 /* functions_vars_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x64.html; sourceTree = ""; }; + 24A200EE0F90D1DE003BB5A7 /* functions_vars_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x65.html; sourceTree = ""; }; + 24A200EF0F90D1DE003BB5A7 /* functions_vars_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x66.html; sourceTree = ""; }; + 24A200F00F90D1DE003BB5A7 /* functions_vars_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x67.html; sourceTree = ""; }; + 24A200F10F90D1DE003BB5A7 /* functions_vars_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x68.html; sourceTree = ""; }; + 24A200F20F90D1DE003BB5A7 /* functions_vars_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x69.html; sourceTree = ""; }; + 24A200F30F90D1DE003BB5A7 /* functions_vars_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6b.html; sourceTree = ""; }; + 24A200F40F90D1DE003BB5A7 /* functions_vars_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6c.html; sourceTree = ""; }; + 24A200F50F90D1DE003BB5A7 /* functions_vars_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6d.html; sourceTree = ""; }; + 24A200F60F90D1DE003BB5A7 /* functions_vars_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6e.html; sourceTree = ""; }; + 24A200F70F90D1DE003BB5A7 /* functions_vars_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6f.html; sourceTree = ""; }; + 24A200F80F90D1DE003BB5A7 /* functions_vars_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x70.html; sourceTree = ""; }; + 24A200F90F90D1DE003BB5A7 /* functions_vars_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x72.html; sourceTree = ""; }; + 24A200FA0F90D1DE003BB5A7 /* functions_vars_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x73.html; sourceTree = ""; }; + 24A200FB0F90D1DE003BB5A7 /* functions_vars_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x74.html; sourceTree = ""; }; + 24A200FC0F90D1DE003BB5A7 /* functions_vars_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x75.html; sourceTree = ""; }; + 24A200FD0F90D1DE003BB5A7 /* functions_vars_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x76.html; sourceTree = ""; }; + 24A200FE0F90D1DE003BB5A7 /* functions_vars_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x77.html; sourceTree = ""; }; + 24A200FF0F90D1DE003BB5A7 /* functions_vars_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x78.html; sourceTree = ""; }; + 24A201000F90D1DE003BB5A7 /* functions_vars_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x79.html; sourceTree = ""; }; + 24A201010F90D1DE003BB5A7 /* functions_vars_0x7a.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x7a.html; sourceTree = ""; }; + 24A201020F90D1DE003BB5A7 /* globals.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals.html; sourceTree = ""; }; + 24A201030F90D1DE003BB5A7 /* globals_0x61.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x61.html; sourceTree = ""; }; + 24A201040F90D1DE003BB5A7 /* globals_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x62.html; sourceTree = ""; }; + 24A201050F90D1DE003BB5A7 /* globals_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x63.html; sourceTree = ""; }; + 24A201060F90D1DE003BB5A7 /* globals_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x65.html; sourceTree = ""; }; + 24A201070F90D1DE003BB5A7 /* globals_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x66.html; sourceTree = ""; }; + 24A201080F90D1DE003BB5A7 /* globals_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x67.html; sourceTree = ""; }; + 24A201090F90D1DE003BB5A7 /* globals_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6b.html; sourceTree = ""; }; + 24A2010A0F90D1DE003BB5A7 /* globals_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6d.html; sourceTree = ""; }; + 24A2010B0F90D1DE003BB5A7 /* globals_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6e.html; sourceTree = ""; }; + 24A2010C0F90D1DE003BB5A7 /* globals_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6f.html; sourceTree = ""; }; + 24A2010D0F90D1DE003BB5A7 /* globals_0x71.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x71.html; sourceTree = ""; }; + 24A2010E0F90D1DE003BB5A7 /* globals_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x72.html; sourceTree = ""; }; + 24A2010F0F90D1DE003BB5A7 /* globals_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x73.html; sourceTree = ""; }; + 24A201100F90D1DE003BB5A7 /* globals_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x74.html; sourceTree = ""; }; + 24A201110F90D1DE003BB5A7 /* globals_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x75.html; sourceTree = ""; }; + 24A201120F90D1DE003BB5A7 /* globals_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x76.html; sourceTree = ""; }; + 24A201130F90D1DE003BB5A7 /* globals_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x77.html; sourceTree = ""; }; + 24A201140F90D1DE003BB5A7 /* globals_defs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_defs.html; sourceTree = ""; }; + 24A201150F90D1DE003BB5A7 /* globals_enum.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_enum.html; sourceTree = ""; }; + 24A201160F90D1DE003BB5A7 /* globals_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_eval.html; sourceTree = ""; }; + 24A201170F90D1DE003BB5A7 /* globals_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_type.html; sourceTree = ""; }; + 24A201180F90D1DE003BB5A7 /* globals_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_vars.html; sourceTree = ""; }; + 24A201190F90D1DE003BB5A7 /* hierarchy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = hierarchy.html; sourceTree = ""; }; + 24A2011A0F90D1DE003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = index.html; sourceTree = ""; }; + 24A2011B0F90D1DE003BB5A7 /* intro.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = intro.html; sourceTree = ""; }; + 24A2011C0F90D1DE003BB5A7 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = license.html; sourceTree = ""; }; + 24A2011D0F90D1DE003BB5A7 /* maceditor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = maceditor.html; sourceTree = ""; }; + 24A2011E0F90D1DE003BB5A7 /* main.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = main.html; sourceTree = ""; }; + 24A2011F0F90D1DE003BB5A7 /* others.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = others.html; sourceTree = ""; }; + 24A201200F90D1DE003BB5A7 /* pages.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = pages.html; sourceTree = ""; }; + 24A201210F90D1DE003BB5A7 /* plugguieditor_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = plugguieditor_8cpp.html; sourceTree = ""; }; + 24A201220F90D1DE003BB5A7 /* plugguieditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = plugguieditor_8h.html; sourceTree = ""; }; + 24A201230F90D1DE003BB5A7 /* sequences.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = sequences.html; sourceTree = ""; }; + 24A201240F90D1DE003BB5A7 /* struct_c_color-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_color-members.html"; sourceTree = ""; }; + 24A201250F90D1DE003BB5A7 /* struct_c_color.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_color.html; sourceTree = ""; }; + 24A201260F90D1DE003BB5A7 /* struct_c_point-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_point-members.html"; sourceTree = ""; }; + 24A201270F90D1DE003BB5A7 /* struct_c_point.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_point.html; sourceTree = ""; }; + 24A201280F90D1DE003BB5A7 /* struct_c_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_rect-members.html"; sourceTree = ""; }; + 24A201290F90D1DE003BB5A7 /* struct_c_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_rect.html; sourceTree = ""; }; + 24A2012A0F90D1DE003BB5A7 /* struct_e_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_e_rect-members.html"; sourceTree = ""; }; + 24A2012B0F90D1DE003BB5A7 /* struct_e_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_e_rect.html; sourceTree = ""; }; + 24A2012C0F90D1DE003BB5A7 /* struct_vst_file_select-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_file_select-members.html"; sourceTree = ""; }; + 24A2012D0F90D1DE003BB5A7 /* struct_vst_file_select.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_file_select.html; sourceTree = ""; }; + 24A2012E0F90D1DE003BB5A7 /* struct_vst_file_type-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_file_type-members.html"; sourceTree = ""; }; + 24A2012F0F90D1DE003BB5A7 /* struct_vst_file_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_file_type.html; sourceTree = ""; }; + 24A201300F90D1DE003BB5A7 /* struct_vst_key_code-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_key_code-members.html"; sourceTree = ""; }; + 24A201310F90D1DE003BB5A7 /* struct_vst_key_code.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_key_code.html; sourceTree = ""; }; + 24A201320F90D1DE003BB5A7 /* tab_b.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_b.gif; sourceTree = ""; }; + 24A201330F90D1DE003BB5A7 /* tab_l.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_l.gif; sourceTree = ""; }; + 24A201340F90D1DE003BB5A7 /* tab_r.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_r.gif; sourceTree = ""; }; + 24A201350F90D1DE003BB5A7 /* tabs.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = tabs.css; sourceTree = ""; }; + 24A201360F90D1DE003BB5A7 /* thanks.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = thanks.html; sourceTree = ""; }; + 24A201370F90D1DE003BB5A7 /* tree.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = tree.html; sourceTree = ""; }; + 24A201380F90D1DE003BB5A7 /* vstcontrols_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstcontrols_8cpp.html; sourceTree = ""; }; + 24A201390F90D1DE003BB5A7 /* vstcontrols_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstcontrols_8h.html; sourceTree = ""; }; + 24A2013A0F90D1DE003BB5A7 /* vstgui_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstgui_8cpp.html; sourceTree = ""; }; + 24A2013B0F90D1DE003BB5A7 /* vstgui_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstgui_8h.html; sourceTree = ""; }; + 24A2013C0F90D1DE003BB5A7 /* vstkeycode_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstkeycode_8h.html; sourceTree = ""; }; + 24A2013D0F90D1DE003BB5A7 /* vstoffline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstoffline.html; sourceTree = ""; }; + 24A2013E0F90D1DE003BB5A7 /* vstparamstruct.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstparamstruct.html; sourceTree = ""; }; + 24A2013F0F90D1DE003BB5A7 /* vstplugscarbon_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugscarbon_8h.html; sourceTree = ""; }; + 24A201400F90D1DE003BB5A7 /* vstplugsmac_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsmac_8h.html; sourceTree = ""; }; + 24A201410F90D1DE003BB5A7 /* vstplugsmacho_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsmacho_8h.html; sourceTree = ""; }; + 24A201420F90D1DE003BB5A7 /* vstplugsquartz_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsquartz_8h.html; sourceTree = ""; }; + 24A201430F90D1DE003BB5A7 /* whatsnew.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = whatsnew.html; sourceTree = ""; }; + 24A201440F90D1DE003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = index.html; sourceTree = ""; }; + 24A201450F90D1DE003BB5A7 /* Migrating from 2.3.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Migrating from 2.3.rtf"; sourceTree = ""; }; + 24A201460F90D1DE003BB5A7 /* plugguieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plugguieditor.cpp; sourceTree = ""; }; + 24A201470F90D1DE003BB5A7 /* plugguieditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plugguieditor.h; sourceTree = ""; }; + 24A201480F90D1DE003BB5A7 /* vstcontrols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstcontrols.cpp; sourceTree = ""; }; + 24A201490F90D1DE003BB5A7 /* vstcontrols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstcontrols.h; sourceTree = ""; }; + 24A2014A0F90D1DE003BB5A7 /* vstgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstgui.cpp; sourceTree = ""; }; + 24A2014B0F90D1DE003BB5A7 /* vstgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstgui.h; sourceTree = ""; }; + 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstkeycode.h; sourceTree = ""; }; + 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugscarbon.h; sourceTree = ""; }; + 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsmac.h; sourceTree = ""; }; + 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsmacho.h; sourceTree = ""; }; + 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsquartz.h; sourceTree = ""; }; + 24A2FEBD0F90D1DC003BB5A7 /* Thumbs.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = Thumbs.db; sourceTree = ""; }; + 24A2FEBE0F90D1DC003BB5A7 /* VST_Logo_Usage_Guideline.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = VST_Logo_Usage_Guideline.pdf; sourceTree = ""; }; + 24A2FEBF0F90D1DC003BB5A7 /* VSTLogoAlpha.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VSTLogoAlpha.png; sourceTree = ""; }; + 24A2FEC00F90D1DC003BB5A7 /* VSTLogoBlack.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = VSTLogoBlack.jpg; sourceTree = ""; }; + 24A2FEC10F90D1DC003BB5A7 /* VSTLogoWhite.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = VSTLogoWhite.jpg; sourceTree = ""; }; + 24A2FEC60F90D1DC003BB5A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 24A2FEC80F90D1DC003BB5A7 /* VSTMonitor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = VSTMonitor; sourceTree = ""; }; + 24A2FEC90F90D1DC003BB5A7 /* PkgInfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PkgInfo; sourceTree = ""; }; + 24A2FECB0F90D1DC003BB5A7 /* bmp50000.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50000.bmp; sourceTree = ""; }; + 24A2FECC0F90D1DC003BB5A7 /* bmp50001.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50001.bmp; sourceTree = ""; }; + 24A2FECD0F90D1DC003BB5A7 /* bmp50002.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50002.bmp; sourceTree = ""; }; + 24A2FECE0F90D1DC003BB5A7 /* bmp50003.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50003.bmp; sourceTree = ""; }; + 24A2FECF0F90D1DC003BB5A7 /* bmp50004.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50004.bmp; sourceTree = ""; }; + 24A2FED00F90D1DC003BB5A7 /* bmp50005.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50005.bmp; sourceTree = ""; }; + 24A2FED10F90D1DC003BB5A7 /* bmp50006.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50006.bmp; sourceTree = ""; }; + 24A2FED20F90D1DC003BB5A7 /* bmp50007.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50007.bmp; sourceTree = ""; }; + 24A2FED30F90D1DC003BB5A7 /* bmp50008.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50008.bmp; sourceTree = ""; }; + 24A2FED40F90D1DC003BB5A7 /* VSTParamTool.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = VSTParamTool.app; sourceTree = ""; }; + 24A2FED60F90D1DC003BB5A7 /* vstmonitor.dll */ = {isa = PBXFileReference; lastKnownFileType = file; path = vstmonitor.dll; sourceTree = ""; }; + 24A2FED70F90D1DC003BB5A7 /* vstparamtool.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = vstparamtool.exe; sourceTree = ""; }; + 24A2FEDA0F90D1DC003BB5A7 /* folder.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = folder.gif; sourceTree = ""; }; + 24A2FEDB0F90D1DC003BB5A7 /* mac.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = mac.gif; sourceTree = ""; }; + 24A2FEDC0F90D1DC003BB5A7 /* vstpluglogo_small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = vstpluglogo_small.jpg; sourceTree = ""; }; + 24A2FEDD0F90D1DC003BB5A7 /* win.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = win.gif; sourceTree = ""; }; + 24A2FEDF0F90D1DC003BB5A7 /* aeffect_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffect_8h.html; sourceTree = ""; }; + 24A2FEE00F90D1DC003BB5A7 /* aeffectx_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffectx_8h.html; sourceTree = ""; }; + 24A2FEE10F90D1DC003BB5A7 /* aeffeditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffeditor_8h.html; sourceTree = ""; }; + 24A2FEE20F90D1DC003BB5A7 /* annotated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = annotated.html; sourceTree = ""; }; + 24A2FEE30F90D1DC003BB5A7 /* audioeffect_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffect_8cpp.html; sourceTree = ""; }; + 24A2FEE40F90D1DC003BB5A7 /* audioeffect_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffect_8h.html; sourceTree = ""; }; + 24A2FEE50F90D1DC003BB5A7 /* audioeffectx_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffectx_8cpp.html; sourceTree = ""; }; + 24A2FEE60F90D1DC003BB5A7 /* audioeffectx_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffectx_8h.html; sourceTree = ""; }; + 24A2FEE70F90D1DC003BB5A7 /* Blocksizechange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Blocksizechange.gif; sourceTree = ""; }; + 24A2FEE80F90D1DC003BB5A7 /* class_a_eff_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_a_eff_editor-members.html"; sourceTree = ""; }; + 24A2FEE90F90D1DC003BB5A7 /* class_a_eff_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_a_eff_editor.html; sourceTree = ""; }; + 24A2FEEA0F90D1DC003BB5A7 /* class_audio_effect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_audio_effect-members.html"; sourceTree = ""; }; + 24A2FEEB0F90D1DC003BB5A7 /* class_audio_effect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_audio_effect.html; sourceTree = ""; }; + 24A2FEEC0F90D1DC003BB5A7 /* class_audio_effect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_audio_effect.png; sourceTree = ""; }; + 24A2FEED0F90D1DC003BB5A7 /* class_audio_effect_x-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_audio_effect_x-members.html"; sourceTree = ""; }; + 24A2FEEE0F90D1DC003BB5A7 /* class_audio_effect_x.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_audio_effect_x.html; sourceTree = ""; }; + 24A2FEEF0F90D1DC003BB5A7 /* class_audio_effect_x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_audio_effect_x.png; sourceTree = ""; }; + 24A2FEF00F90D1DC003BB5A7 /* ControlChanged.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = ControlChanged.gif; sourceTree = ""; }; + 24A2FEF10F90D1DC003BB5A7 /* deprecated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = deprecated.html; sourceTree = ""; }; + 24A2FEF20F90D1DC003BB5A7 /* dir_2d3252dd12c84c66c1d25b26bb45a1f5.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_2d3252dd12c84c66c1d25b26bb45a1f5.html; sourceTree = ""; }; + 24A2FEF30F90D1DC003BB5A7 /* dir_77c628dfee72e555f82d5ef53b733f38.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_77c628dfee72e555f82d5ef53b733f38.html; sourceTree = ""; }; + 24A2FEF40F90D1DC003BB5A7 /* dir_f81105d3b854bea570aaf3bae5cb64c1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_f81105d3b854bea570aaf3bae5cb64c1.html; sourceTree = ""; }; + 24A2FEF50F90D1DC003BB5A7 /* dir_fa0454ab79b4262333bf837ea3d765e9.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_fa0454ab79b4262333bf837ea3d765e9.html; sourceTree = ""; }; + 24A2FEF60F90D1DC003BB5A7 /* dirs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dirs.html; sourceTree = ""; }; + 24A2FEF70F90D1DC003BB5A7 /* doc_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = doc_8h.html; sourceTree = ""; }; + 24A2FEF80F90D1DC003BB5A7 /* doxygen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = doxygen.css; sourceTree = ""; }; + 24A2FEF90F90D1DC003BB5A7 /* doxygen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doxygen.png; sourceTree = ""; }; + 24A2FEFA0F90D1DC003BB5A7 /* files.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = files.html; sourceTree = ""; }; + 24A2FEFB0F90D1DC003BB5A7 /* ftv2blank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2blank.png; sourceTree = ""; }; + 24A2FEFC0F90D1DC003BB5A7 /* ftv2doc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2doc.png; sourceTree = ""; }; + 24A2FEFD0F90D1DC003BB5A7 /* ftv2folderclosed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderclosed.png; sourceTree = ""; }; + 24A2FEFE0F90D1DC003BB5A7 /* ftv2folderopen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderopen.png; sourceTree = ""; }; + 24A2FEFF0F90D1DC003BB5A7 /* ftv2lastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2lastnode.png; sourceTree = ""; }; + 24A2FF000F90D1DC003BB5A7 /* ftv2link.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2link.png; sourceTree = ""; }; + 24A2FF010F90D1DC003BB5A7 /* ftv2mlastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mlastnode.png; sourceTree = ""; }; + 24A2FF020F90D1DC003BB5A7 /* ftv2mnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mnode.png; sourceTree = ""; }; + 24A2FF030F90D1DC003BB5A7 /* ftv2node.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2node.png; sourceTree = ""; }; + 24A2FF040F90D1DC003BB5A7 /* ftv2plastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2plastnode.png; sourceTree = ""; }; + 24A2FF050F90D1DC003BB5A7 /* ftv2pnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2pnode.png; sourceTree = ""; }; + 24A2FF060F90D1DC003BB5A7 /* ftv2vertline.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2vertline.png; sourceTree = ""; }; + 24A2FF070F90D1DC003BB5A7 /* functions.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions.html; sourceTree = ""; }; + 24A2FF080F90D1DC003BB5A7 /* functions_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x62.html; sourceTree = ""; }; + 24A2FF090F90D1DC003BB5A7 /* functions_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x63.html; sourceTree = ""; }; + 24A2FF0A0F90D1DC003BB5A7 /* functions_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x64.html; sourceTree = ""; }; + 24A2FF0B0F90D1DC003BB5A7 /* functions_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x65.html; sourceTree = ""; }; + 24A2FF0C0F90D1DC003BB5A7 /* functions_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x66.html; sourceTree = ""; }; + 24A2FF0D0F90D1DC003BB5A7 /* functions_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x67.html; sourceTree = ""; }; + 24A2FF0E0F90D1DC003BB5A7 /* functions_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x68.html; sourceTree = ""; }; + 24A2FF0F0F90D1DC003BB5A7 /* functions_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x69.html; sourceTree = ""; }; + 24A2FF100F90D1DC003BB5A7 /* functions_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6b.html; sourceTree = ""; }; + 24A2FF110F90D1DC003BB5A7 /* functions_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6c.html; sourceTree = ""; }; + 24A2FF120F90D1DC003BB5A7 /* functions_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6d.html; sourceTree = ""; }; + 24A2FF130F90D1DC003BB5A7 /* functions_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6e.html; sourceTree = ""; }; + 24A2FF140F90D1DC003BB5A7 /* functions_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6f.html; sourceTree = ""; }; + 24A2FF150F90D1DC003BB5A7 /* functions_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x70.html; sourceTree = ""; }; + 24A2FF160F90D1DC003BB5A7 /* functions_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x72.html; sourceTree = ""; }; + 24A2FF170F90D1DC003BB5A7 /* functions_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x73.html; sourceTree = ""; }; + 24A2FF180F90D1DC003BB5A7 /* functions_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x74.html; sourceTree = ""; }; + 24A2FF190F90D1DC003BB5A7 /* functions_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x75.html; sourceTree = ""; }; + 24A2FF1A0F90D1DC003BB5A7 /* functions_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x76.html; sourceTree = ""; }; + 24A2FF1B0F90D1DC003BB5A7 /* functions_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x77.html; sourceTree = ""; }; + 24A2FF1C0F90D1DC003BB5A7 /* functions_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x78.html; sourceTree = ""; }; + 24A2FF1D0F90D1DC003BB5A7 /* functions_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x79.html; sourceTree = ""; }; + 24A2FF1E0F90D1DC003BB5A7 /* functions_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x7e.html; sourceTree = ""; }; + 24A2FF1F0F90D1DC003BB5A7 /* functions_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_func.html; sourceTree = ""; }; + 24A2FF200F90D1DC003BB5A7 /* functions_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_vars.html; sourceTree = ""; }; + 24A2FF210F90D1DC003BB5A7 /* globals.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals.html; sourceTree = ""; }; + 24A2FF220F90D1DC003BB5A7 /* globals_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x62.html; sourceTree = ""; }; + 24A2FF230F90D1DC003BB5A7 /* globals_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x63.html; sourceTree = ""; }; + 24A2FF240F90D1DC003BB5A7 /* globals_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x64.html; sourceTree = ""; }; + 24A2FF250F90D1DC003BB5A7 /* globals_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x65.html; sourceTree = ""; }; + 24A2FF260F90D1DC003BB5A7 /* globals_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x66.html; sourceTree = ""; }; + 24A2FF270F90D1DC003BB5A7 /* globals_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x6b.html; sourceTree = ""; }; + 24A2FF280F90D1DC003BB5A7 /* globals_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x6d.html; sourceTree = ""; }; + 24A2FF290F90D1DC003BB5A7 /* globals_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x74.html; sourceTree = ""; }; + 24A2FF2A0F90D1DC003BB5A7 /* globals_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x76.html; sourceTree = ""; }; + 24A2FF2B0F90D1DC003BB5A7 /* globals_defs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_defs.html; sourceTree = ""; }; + 24A2FF2C0F90D1DC003BB5A7 /* globals_enum.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_enum.html; sourceTree = ""; }; + 24A2FF2D0F90D1DC003BB5A7 /* globals_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval.html; sourceTree = ""; }; + 24A2FF2E0F90D1DC003BB5A7 /* globals_eval_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x65.html; sourceTree = ""; }; + 24A2FF2F0F90D1DC003BB5A7 /* globals_eval_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x6b.html; sourceTree = ""; }; + 24A2FF300F90D1DC003BB5A7 /* globals_eval_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x6d.html; sourceTree = ""; }; + 24A2FF310F90D1DC003BB5A7 /* globals_eval_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x76.html; sourceTree = ""; }; + 24A2FF320F90D1DC003BB5A7 /* globals_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_func.html; sourceTree = ""; }; + 24A2FF330F90D1DC003BB5A7 /* globals_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_type.html; sourceTree = ""; }; + 24A2FF340F90D1DC003BB5A7 /* globals_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_vars.html; sourceTree = ""; }; + 24A2FF350F90D1DC003BB5A7 /* hierarchy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = hierarchy.html; sourceTree = ""; }; + 24A2FF360F90D1DC003BB5A7 /* history.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = history.html; sourceTree = ""; }; + 24A2FF370F90D1DC003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; + 24A2FF380F90D1DC003BB5A7 /* Initialisation.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Initialisation.gif; sourceTree = ""; }; + 24A2FF390F90D1DC003BB5A7 /* intro.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = intro.html; sourceTree = ""; }; + 24A2FF3A0F90D1DC003BB5A7 /* IOchange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = IOchange.gif; sourceTree = ""; }; + 24A2FF3B0F90D1DC003BB5A7 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = license.html; sourceTree = ""; }; + 24A2FF3C0F90D1DC003BB5A7 /* maceditor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = maceditor.html; sourceTree = ""; }; + 24A2FF3D0F90D1DC003BB5A7 /* main.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = main.html; sourceTree = ""; }; + 24A2FF3E0F90D1DC003BB5A7 /* namespace_host_can_dos.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespace_host_can_dos.html; sourceTree = ""; }; + 24A2FF3F0F90D1DC003BB5A7 /* namespace_plug_can_dos.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespace_plug_can_dos.html; sourceTree = ""; }; + 24A2FF400F90D1DC003BB5A7 /* namespacemembers.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespacemembers.html; sourceTree = ""; }; + 24A2FF410F90D1DC003BB5A7 /* namespacemembers_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespacemembers_vars.html; sourceTree = ""; }; + 24A2FF420F90D1DC003BB5A7 /* namespaces.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespaces.html; sourceTree = ""; }; + 24A2FF430F90D1DC003BB5A7 /* Offlineprocessing.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Offlineprocessing.gif; sourceTree = ""; }; + 24A2FF440F90D1DC003BB5A7 /* others.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = others.html; sourceTree = ""; }; + 24A2FF450F90D1DC003BB5A7 /* pages.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = pages.html; sourceTree = ""; }; + 24A2FF460F90D1DC003BB5A7 /* Sampleratechange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Sampleratechange.gif; sourceTree = ""; }; + 24A2FF470F90D1DC003BB5A7 /* sequences.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sequences.html; sourceTree = ""; }; + 24A2FF480F90D1DC003BB5A7 /* SpeakerarrangementnegotiationforVSTfx.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = SpeakerarrangementnegotiationforVSTfx.gif; sourceTree = ""; }; + 24A2FF490F90D1DC003BB5A7 /* struct_a_effect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_a_effect-members.html"; sourceTree = ""; }; + 24A2FF4A0F90D1DC003BB5A7 /* struct_a_effect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_a_effect.html; sourceTree = ""; }; + 24A2FF4B0F90D1DC003BB5A7 /* struct_e_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_e_rect-members.html"; sourceTree = ""; }; + 24A2FF4C0F90D1DC003BB5A7 /* struct_e_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_e_rect.html; sourceTree = ""; }; + 24A2FF4D0F90D1DC003BB5A7 /* struct_midi_key_name-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_key_name-members.html"; sourceTree = ""; }; + 24A2FF4E0F90D1DC003BB5A7 /* struct_midi_key_name.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_key_name.html; sourceTree = ""; }; + 24A2FF4F0F90D1DC003BB5A7 /* struct_midi_program_category-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_program_category-members.html"; sourceTree = ""; }; + 24A2FF500F90D1DC003BB5A7 /* struct_midi_program_category.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_program_category.html; sourceTree = ""; }; + 24A2FF510F90D1DC003BB5A7 /* struct_midi_program_name-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_program_name-members.html"; sourceTree = ""; }; + 24A2FF520F90D1DC003BB5A7 /* struct_midi_program_name.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_program_name.html; sourceTree = ""; }; + 24A2FF530F90D1DC003BB5A7 /* struct_vst_audio_file-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_audio_file-members.html"; sourceTree = ""; }; + 24A2FF540F90D1DC003BB5A7 /* struct_vst_audio_file.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_audio_file.html; sourceTree = ""; }; + 24A2FF550F90D1DC003BB5A7 /* struct_vst_audio_file_marker-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_audio_file_marker-members.html"; sourceTree = ""; }; + 24A2FF560F90D1DC003BB5A7 /* struct_vst_audio_file_marker.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_audio_file_marker.html; sourceTree = ""; }; + 24A2FF570F90D1DC003BB5A7 /* struct_vst_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_event-members.html"; sourceTree = ""; }; + 24A2FF580F90D1DC003BB5A7 /* struct_vst_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_event.html; sourceTree = ""; }; + 24A2FF590F90D1DD003BB5A7 /* struct_vst_events-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_events-members.html"; sourceTree = ""; }; + 24A2FF5A0F90D1DD003BB5A7 /* struct_vst_events.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_events.html; sourceTree = ""; }; + 24A2FF5B0F90D1DD003BB5A7 /* struct_vst_file_select-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_file_select-members.html"; sourceTree = ""; }; + 24A2FF5C0F90D1DD003BB5A7 /* struct_vst_file_select.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_file_select.html; sourceTree = ""; }; + 24A2FF5D0F90D1DD003BB5A7 /* struct_vst_file_type-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_file_type-members.html"; sourceTree = ""; }; + 24A2FF5E0F90D1DD003BB5A7 /* struct_vst_file_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_file_type.html; sourceTree = ""; }; + 24A2FF5F0F90D1DD003BB5A7 /* struct_vst_key_code-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_key_code-members.html"; sourceTree = ""; }; + 24A2FF600F90D1DD003BB5A7 /* struct_vst_key_code.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_key_code.html; sourceTree = ""; }; + 24A2FF610F90D1DD003BB5A7 /* struct_vst_midi_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_midi_event-members.html"; sourceTree = ""; }; + 24A2FF620F90D1DD003BB5A7 /* struct_vst_midi_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_midi_event.html; sourceTree = ""; }; + 24A2FF630F90D1DD003BB5A7 /* struct_vst_midi_sysex_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_midi_sysex_event-members.html"; sourceTree = ""; }; + 24A2FF640F90D1DD003BB5A7 /* struct_vst_midi_sysex_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_midi_sysex_event.html; sourceTree = ""; }; + 24A2FF650F90D1DD003BB5A7 /* struct_vst_offline_task-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_offline_task-members.html"; sourceTree = ""; }; + 24A2FF660F90D1DD003BB5A7 /* struct_vst_offline_task.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_offline_task.html; sourceTree = ""; }; + 24A2FF670F90D1DD003BB5A7 /* struct_vst_parameter_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_parameter_properties-members.html"; sourceTree = ""; }; + 24A2FF680F90D1DD003BB5A7 /* struct_vst_parameter_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_parameter_properties.html; sourceTree = ""; }; + 24A2FF690F90D1DD003BB5A7 /* struct_vst_patch_chunk_info-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_patch_chunk_info-members.html"; sourceTree = ""; }; + 24A2FF6A0F90D1DD003BB5A7 /* struct_vst_patch_chunk_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_patch_chunk_info.html; sourceTree = ""; }; + 24A2FF6B0F90D1DD003BB5A7 /* struct_vst_pin_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_pin_properties-members.html"; sourceTree = ""; }; + 24A2FF6C0F90D1DD003BB5A7 /* struct_vst_pin_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_pin_properties.html; sourceTree = ""; }; + 24A2FF6D0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_speaker_arrangement-members.html"; sourceTree = ""; }; + 24A2FF6E0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_speaker_arrangement.html; sourceTree = ""; }; + 24A2FF6F0F90D1DD003BB5A7 /* struct_vst_speaker_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_speaker_properties-members.html"; sourceTree = ""; }; + 24A2FF700F90D1DD003BB5A7 /* struct_vst_speaker_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_speaker_properties.html; sourceTree = ""; }; + 24A2FF710F90D1DD003BB5A7 /* struct_vst_time_info-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_time_info-members.html"; sourceTree = ""; }; + 24A2FF720F90D1DD003BB5A7 /* struct_vst_time_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_time_info.html; sourceTree = ""; }; + 24A2FF730F90D1DD003BB5A7 /* struct_vst_variable_io-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_variable_io-members.html"; sourceTree = ""; }; + 24A2FF740F90D1DD003BB5A7 /* struct_vst_variable_io.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_variable_io.html; sourceTree = ""; }; + 24A2FF750F90D1DD003BB5A7 /* struct_vst_window-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_window-members.html"; sourceTree = ""; }; + 24A2FF760F90D1DD003BB5A7 /* struct_vst_window.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_window.html; sourceTree = ""; }; + 24A2FF770F90D1DD003BB5A7 /* structfx_bank-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "structfx_bank-members.html"; sourceTree = ""; }; + 24A2FF780F90D1DD003BB5A7 /* structfx_bank.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = structfx_bank.html; sourceTree = ""; }; + 24A2FF790F90D1DD003BB5A7 /* structfx_program-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "structfx_program-members.html"; sourceTree = ""; }; + 24A2FF7A0F90D1DD003BB5A7 /* structfx_program.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = structfx_program.html; sourceTree = ""; }; + 24A2FF7B0F90D1DD003BB5A7 /* tab_b.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_b.gif; sourceTree = ""; }; + 24A2FF7C0F90D1DD003BB5A7 /* tab_l.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_l.gif; sourceTree = ""; }; + 24A2FF7D0F90D1DD003BB5A7 /* tab_r.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_r.gif; sourceTree = ""; }; + 24A2FF7E0F90D1DD003BB5A7 /* tabs.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = tabs.css; sourceTree = ""; }; + 24A2FF7F0F90D1DD003BB5A7 /* Termination.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Termination.gif; sourceTree = ""; }; + 24A2FF800F90D1DD003BB5A7 /* thanks.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = thanks.html; sourceTree = ""; }; + 24A2FF810F90D1DD003BB5A7 /* tree.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = tree.html; sourceTree = ""; }; + 24A2FF820F90D1DD003BB5A7 /* TurnOff.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = TurnOff.gif; sourceTree = ""; }; + 24A2FF830F90D1DD003BB5A7 /* TurnOn.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = TurnOn.gif; sourceTree = ""; }; + 24A2FF840F90D1DD003BB5A7 /* vstfxstore_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstfxstore_8h.html; sourceTree = ""; }; + 24A2FF850F90D1DD003BB5A7 /* vstoffline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstoffline.html; sourceTree = ""; }; + 24A2FF860F90D1DD003BB5A7 /* vstparamstruct.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstparamstruct.html; sourceTree = ""; }; + 24A2FF870F90D1DD003BB5A7 /* vstpluglogo.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = vstpluglogo.jpg; sourceTree = ""; }; + 24A2FF880F90D1DD003BB5A7 /* vstplugmain_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstplugmain_8cpp.html; sourceTree = ""; }; + 24A2FF890F90D1DD003BB5A7 /* whatsnew.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = whatsnew.html; sourceTree = ""; }; + 24A2FF8A0F90D1DD003BB5A7 /* sdk.menu.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sdk.menu.html; sourceTree = ""; }; + 24A2FF8B0F90D1DD003BB5A7 /* sdk.overview.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sdk.overview.html; sourceTree = ""; }; + 24A2FF8C0F90D1DD003BB5A7 /* sdkdoc.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = sdkdoc.css; sourceTree = ""; }; + 24A2FF8D0F90D1DD003BB5A7 /* VST Licensing Agreement.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "VST Licensing Agreement.rtf"; sourceTree = ""; }; + 24A2FF8E0F90D1DD003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; + 24A2FF910F90D1DD003BB5A7 /* aeffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffect.h; sourceTree = ""; }; + 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffectx.h; sourceTree = ""; }; + 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstfxstore.h; sourceTree = ""; }; + 24A2FF980F90D1DD003BB5A7 /* adelay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adelay.cpp; sourceTree = ""; }; + 24A2FF990F90D1DD003BB5A7 /* adelay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adelay.h; sourceTree = ""; }; + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adelaymain.cpp; sourceTree = ""; }; + 24A2FF9D0F90D1DD003BB5A7 /* bmp00128.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00128.bmp; sourceTree = ""; }; + 24A2FF9E0F90D1DD003BB5A7 /* bmp00129.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00129.bmp; sourceTree = ""; }; + 24A2FF9F0F90D1DD003BB5A7 /* bmp00130.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00130.bmp; sourceTree = ""; }; + 24A2FFA00F90D1DD003BB5A7 /* surrounddelay.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = surrounddelay.rc; sourceTree = ""; }; + 24A2FFA10F90D1DD003BB5A7 /* sdeditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sdeditor.cpp; sourceTree = ""; }; + 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdeditor.h; sourceTree = ""; }; + 24A2FFA30F90D1DD003BB5A7 /* surrounddelay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = surrounddelay.cpp; sourceTree = ""; }; + 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surrounddelay.h; sourceTree = ""; }; + 24A2FFA60F90D1DD003BB5A7 /* adelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = adelay.vcproj; sourceTree = ""; }; + 24A2FFA70F90D1DD003BB5A7 /* surrounddelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = surrounddelay.vcproj; sourceTree = ""; }; + 24A2FFAA0F90D1DD003BB5A7 /* again.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = again.cpp; sourceTree = ""; }; + 24A2FFAB0F90D1DD003BB5A7 /* again.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = again.h; sourceTree = ""; }; + 24A2FFAD0F90D1DD003BB5A7 /* again.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = again.vcproj; sourceTree = ""; }; + 24A2FFAF0F90D1DD003BB5A7 /* minihost-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "minihost-Info.plist"; sourceTree = ""; }; + 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "vst 2.4 examples.xcodeproj"; sourceTree = ""; }; + 24A2FFB30F90D1DD003BB5A7 /* vst2.4Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = vst2.4Info.plist; sourceTree = ""; }; + 24A2FFB60F90D1DD003BB5A7 /* minieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minieditor.cpp; sourceTree = ""; }; + 24A2FFB70F90D1DD003BB5A7 /* minihost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minihost.cpp; sourceTree = ""; }; + 24A2FFB90F90D1DD003BB5A7 /* minihost.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = minihost.vcproj; sourceTree = ""; }; + 24A2FFBC0F90D1DD003BB5A7 /* vstxsynth.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.rc; sourceTree = ""; }; + 24A2FFBD0F90D1DD003BB5A7 /* vstxsynth.vstxml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.vstxml; sourceTree = ""; }; + 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gmnames.h; sourceTree = ""; }; + 24A2FFC00F90D1DD003BB5A7 /* vstxsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstxsynth.cpp; sourceTree = ""; }; + 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstxsynth.h; sourceTree = ""; }; + 24A2FFC20F90D1DD003BB5A7 /* vstxsynthproc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstxsynthproc.cpp; sourceTree = ""; }; + 24A2FFC40F90D1DD003BB5A7 /* vstxsynth.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = vstxsynth.vcproj; sourceTree = ""; }; + 24A2FFC60F90D1DD003BB5A7 /* samples.sln */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.sln; sourceTree = ""; }; + 24A2FFC70F90D1DD003BB5A7 /* vstplug.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstplug.def; sourceTree = ""; }; + 24A2FFC90F90D1DD003BB5A7 /* adelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = adelay.vcproj; sourceTree = ""; }; + 24A2FFCA0F90D1DD003BB5A7 /* again.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = again.vcproj; sourceTree = ""; }; + 24A2FFCB0F90D1DD003BB5A7 /* minihost.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = minihost.vcproj; sourceTree = ""; }; + 24A2FFCC0F90D1DD003BB5A7 /* samples.sln */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.sln; sourceTree = ""; }; + 24A2FFCD0F90D1DD003BB5A7 /* surrounddelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = surrounddelay.vcproj; sourceTree = ""; }; + 24A2FFCE0F90D1DD003BB5A7 /* vstxsynth.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = vstxsynth.vcproj; sourceTree = ""; }; + 24A2FFD00F90D1DD003BB5A7 /* adelay.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = adelay.dsp; sourceTree = ""; }; + 24A2FFD10F90D1DD003BB5A7 /* again.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = again.dsp; sourceTree = ""; }; + 24A2FFD20F90D1DD003BB5A7 /* minihost.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = minihost.dsp; sourceTree = ""; }; + 24A2FFD30F90D1DD003BB5A7 /* samples.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.dsw; sourceTree = ""; }; + 24A2FFD40F90D1DD003BB5A7 /* surrounddelay.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = surrounddelay.dsp; sourceTree = ""; }; + 24A2FFD50F90D1DD003BB5A7 /* vstxsynth.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.dsp; sourceTree = ""; }; + 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffeditor.h; sourceTree = ""; }; + 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioeffect.cpp; sourceTree = ""; }; + 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioeffect.h; sourceTree = ""; }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioeffectx.cpp; sourceTree = ""; }; + 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioeffectx.h; sourceTree = ""; }; + 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstplugmain.cpp; sourceTree = ""; }; + 24A2FFE10F90D1DD003BB5A7 /* audiounit.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = audiounit.exp; sourceTree = ""; }; + 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "cw_vst_prefix.pch++"; sourceTree = ""; }; + 24A2FFE30F90D1DD003BB5A7 /* drawtest.cw9prj */ = {isa = PBXFileReference; lastKnownFileType = file; path = drawtest.cw9prj; sourceTree = ""; }; + 24A2FFE40F90D1DD003BB5A7 /* drawtest.plc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.plc; sourceTree = ""; }; + 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = drawtest.xcode; sourceTree = ""; }; + 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = drawtest.xcodeproj; sourceTree = ""; }; + 24A2FFEB0F90D1DD003BB5A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xcode_au_prefix.h; sourceTree = ""; }; + 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xcode_vst_prefix.h; sourceTree = ""; }; + 24A2FFEF0F90D1DD003BB5A7 /* audiounit.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; path = audiounit.r; sourceTree = ""; }; + 24A2FFF00F90D1DD003BB5A7 /* bmp00001.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp00001.png; sourceTree = ""; }; + 24A2FFF10F90D1DD003BB5A7 /* bmp00100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp00100.png; sourceTree = ""; }; + 24A2FFF20F90D1DD003BB5A7 /* bmp01000.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp01000.png; sourceTree = ""; }; + 24A2FFF30F90D1DD003BB5A7 /* bmp10001.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10001.bmp; sourceTree = ""; }; + 24A2FFF40F90D1DD003BB5A7 /* bmp10002.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10002.bmp; sourceTree = ""; }; + 24A2FFF50F90D1DD003BB5A7 /* bmp10003.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10003.bmp; sourceTree = ""; }; + 24A2FFF60F90D1DD003BB5A7 /* bmp10004.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10004.bmp; sourceTree = ""; }; + 24A2FFF70F90D1DD003BB5A7 /* bmp10005.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10005.bmp; sourceTree = ""; }; + 24A2FFF80F90D1DD003BB5A7 /* bmp10006.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10006.bmp; sourceTree = ""; }; + 24A2FFF90F90D1DD003BB5A7 /* bmp10007.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10007.bmp; sourceTree = ""; }; + 24A2FFFA0F90D1DD003BB5A7 /* bmp10008.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10008.bmp; sourceTree = ""; }; + 24A2FFFB0F90D1DD003BB5A7 /* bmp10009.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10009.bmp; sourceTree = ""; }; + 24A2FFFC0F90D1DD003BB5A7 /* bmp10010.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10010.bmp; sourceTree = ""; }; + 24A2FFFD0F90D1DD003BB5A7 /* bmp10011.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10011.bmp; sourceTree = ""; }; + 24A2FFFE0F90D1DD003BB5A7 /* bmp10012.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10012.bmp; sourceTree = ""; }; + 24A2FFFF0F90D1DD003BB5A7 /* bmp10013.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10013.bmp; sourceTree = ""; }; + 24CFB70307E7A0220081BD57 /* PkgInfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PkgInfo; path = mac/PkgInfo; sourceTree = ""; }; + 24D8286F09A914000093AEF8 /* CabsProc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CabsProc.cpp; path = source/CabsProc.cpp; sourceTree = ""; }; + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = xcode_vst_prefix.h; path = mac/xcode_vst_prefix.h; sourceTree = SOURCE_ROOT; }; + 8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* FM-Chopper */ = { + isa = PBXGroup; + children = ( + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + 089C167CFE841241C02AAC07 /* Resources */, + 08FB77ADFE841716C02AAC07 /* Source */, + 24A2FEBB0F90D1DB003BB5A7 /* vstsdk2.4 */, + ); + name = "FM-Chopper"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 2434720A098313350063BBF1 /* QuickTime.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */, + 24CFB70307E7A0220081BD57 /* PkgInfo */, + 8D01CCD10486CAD60068D4B7 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 2407DEB6089929BA00EB68BF /* Cabs.cpp */, + 24D8286F09A914000093AEF8 /* CabsProc.cpp */, + 245463B80991757100464AD3 /* Cabs.h */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2407DE920899296600EB68BF /* Cabs.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A200030F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A200040F90D1DD003BB5A7 /* controlsgui.cpp */, + 24A200050F90D1DD003BB5A7 /* controlsgui.h */, + 24A200060F90D1DD003BB5A7 /* pdrawtesteditor.cpp */, + 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */, + 24A200080F90D1DD003BB5A7 /* pdrawtesteffect.cpp */, + 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */, + 24A2000A0F90D1DD003BB5A7 /* pdrawtestmain.cpp */, + 24A2000B0F90D1DD003BB5A7 /* pdrawtestview.cpp */, + 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */, + 24A2000D0F90D1DD003BB5A7 /* pprimitivesviews.cpp */, + 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */, + ); + name = source; + path = /vstsdk2.4/vstgui.sf/drawtest/source; + sourceTree = ""; + }; + 24A2000F0F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A200100F90D1DD003BB5A7 /* drawtest.def */, + 24A200110F90D1DD003BB5A7 /* drawtest.rc */, + 24A200120F90D1DD003BB5A7 /* drawtest.vcproj */, + ); + name = win; + path = /vstsdk2.4/vstgui.sf/drawtest/win; + sourceTree = ""; + }; + 24A200130F90D1DD003BB5A7 /* win.vc6 */ = { + isa = PBXGroup; + children = ( + 24A200140F90D1DD003BB5A7 /* drawtest.dsp */, + 24A200150F90D1DD003BB5A7 /* drawtest.dsw */, + ); + name = win.vc6; + path = /vstsdk2.4/vstgui.sf/drawtest/win.vc6; + sourceTree = ""; + }; + 24A200160F90D1DD003BB5A7 /* vstgui */ = { + isa = PBXGroup; + children = ( + 24A200170F90D1DD003BB5A7 /* aeffguieditor.cpp */, + 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */, + 24A200190F90D1DD003BB5A7 /* cfileselector.cpp */, + 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */, + 24A2001B0F90D1DD003BB5A7 /* Changelog */, + 24A2001C0F90D1DD003BB5A7 /* cscrollview.cpp */, + 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */, + 24A2001E0F90D1DD003BB5A7 /* ctabview.cpp */, + 24A2001F0F90D1DD003BB5A7 /* ctabview.h */, + 24A200200F90D1DD003BB5A7 /* Documentation */, + 24A201460F90D1DE003BB5A7 /* plugguieditor.cpp */, + 24A201470F90D1DE003BB5A7 /* plugguieditor.h */, + 24A201480F90D1DE003BB5A7 /* vstcontrols.cpp */, + 24A201490F90D1DE003BB5A7 /* vstcontrols.h */, + 24A2014A0F90D1DE003BB5A7 /* vstgui.cpp */, + 24A2014B0F90D1DE003BB5A7 /* vstgui.h */, + 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */, + 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */, + 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */, + 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */, + 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */, + ); + name = vstgui; + path = /vstsdk2.4/vstgui.sf/vstgui; + sourceTree = ""; + }; + 24A200200F90D1DD003BB5A7 /* Documentation */ = { + isa = PBXGroup; + children = ( + 24A200210F90D1DD003BB5A7 /* html */, + 24A201440F90D1DE003BB5A7 /* index.html */, + 24A201450F90D1DE003BB5A7 /* Migrating from 2.3.rtf */, + ); + name = Documentation; + path = /vstsdk2.4/vstgui.sf/vstgui/Documentation; + sourceTree = ""; + }; + 24A200210F90D1DD003BB5A7 /* html */ = { + isa = PBXGroup; + children = ( + 24A200220F90D1DD003BB5A7 /* aeffguieditor_8cpp.html */, + 24A200230F90D1DD003BB5A7 /* aeffguieditor_8h.html */, + 24A200240F90D1DD003BB5A7 /* annotated.html */, + 24A200250F90D1DD003BB5A7 /* cfileselector_8cpp.html */, + 24A200260F90D1DD003BB5A7 /* cfileselector_8h.html */, + 24A200270F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor-members.html */, + 24A200280F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor.html */, + 24A200290F90D1DD003BB5A7 /* class_c_anim_knob-members.html */, + 24A2002A0F90D1DD003BB5A7 /* class_c_anim_knob.html */, + 24A2002B0F90D1DD003BB5A7 /* class_c_anim_knob.png */, + 24A2002C0F90D1DD003BB5A7 /* class_c_attribute_list_entry-members.html */, + 24A2002D0F90D1DD003BB5A7 /* class_c_attribute_list_entry.html */, + 24A2002E0F90D1DD003BB5A7 /* class_c_auto_animation-members.html */, + 24A2002F0F90D1DD003BB5A7 /* class_c_auto_animation.html */, + 24A200300F90D1DD003BB5A7 /* class_c_auto_animation.png */, + 24A200310F90D1DD003BB5A7 /* class_c_bitmap-members.html */, + 24A200320F90D1DD003BB5A7 /* class_c_bitmap.html */, + 24A200330F90D1DD003BB5A7 /* class_c_bitmap.png */, + 24A200340F90D1DD003BB5A7 /* class_c_c_view-members.html */, + 24A200350F90D1DD003BB5A7 /* class_c_c_view.html */, + 24A200360F90D1DD003BB5A7 /* class_c_control-members.html */, + 24A200370F90D1DD003BB5A7 /* class_c_control.html */, + 24A200380F90D1DD003BB5A7 /* class_c_control.png */, + 24A200390F90D1DD003BB5A7 /* class_c_control_listener-members.html */, + 24A2003A0F90D1DD003BB5A7 /* class_c_control_listener.html */, + 24A2003B0F90D1DD003BB5A7 /* class_c_control_listener.png */, + 24A2003C0F90D1DD003BB5A7 /* class_c_drag_container-members.html */, + 24A2003D0F90D1DD003BB5A7 /* class_c_drag_container.html */, + 24A2003E0F90D1DD003BB5A7 /* class_c_drag_container.png */, + 24A2003F0F90D1DD003BB5A7 /* class_c_draw_context-members.html */, + 24A200400F90D1DD003BB5A7 /* class_c_draw_context.html */, + 24A200410F90D1DD003BB5A7 /* class_c_draw_context.png */, + 24A200420F90D1DD003BB5A7 /* class_c_file_selector-members.html */, + 24A200430F90D1DD003BB5A7 /* class_c_file_selector.html */, + 24A200440F90D1DD003BB5A7 /* class_c_frame-members.html */, + 24A200450F90D1DD003BB5A7 /* class_c_frame.html */, + 24A200460F90D1DD003BB5A7 /* class_c_frame.png */, + 24A200470F90D1DD003BB5A7 /* class_c_horizontal_slider-members.html */, + 24A200480F90D1DD003BB5A7 /* class_c_horizontal_slider.html */, + 24A200490F90D1DD003BB5A7 /* class_c_horizontal_slider.png */, + 24A2004A0F90D1DD003BB5A7 /* class_c_horizontal_switch-members.html */, + 24A2004B0F90D1DD003BB5A7 /* class_c_horizontal_switch.html */, + 24A2004C0F90D1DD003BB5A7 /* class_c_horizontal_switch.png */, + 24A2004D0F90D1DD003BB5A7 /* class_c_kick_button-members.html */, + 24A2004E0F90D1DD003BB5A7 /* class_c_kick_button.html */, + 24A2004F0F90D1DD003BB5A7 /* class_c_kick_button.png */, + 24A200500F90D1DD003BB5A7 /* class_c_knob-members.html */, + 24A200510F90D1DD003BB5A7 /* class_c_knob.html */, + 24A200520F90D1DD003BB5A7 /* class_c_knob.png */, + 24A200530F90D1DD003BB5A7 /* class_c_movie_bitmap-members.html */, + 24A200540F90D1DD003BB5A7 /* class_c_movie_bitmap.html */, + 24A200550F90D1DD003BB5A7 /* class_c_movie_bitmap.png */, + 24A200560F90D1DD003BB5A7 /* class_c_movie_button-members.html */, + 24A200570F90D1DD003BB5A7 /* class_c_movie_button.html */, + 24A200580F90D1DD003BB5A7 /* class_c_movie_button.png */, + 24A200590F90D1DD003BB5A7 /* class_c_offscreen_context-members.html */, + 24A2005A0F90D1DD003BB5A7 /* class_c_offscreen_context.html */, + 24A2005B0F90D1DD003BB5A7 /* class_c_offscreen_context.png */, + 24A2005C0F90D1DD003BB5A7 /* class_c_on_off_button-members.html */, + 24A2005D0F90D1DD003BB5A7 /* class_c_on_off_button.html */, + 24A2005E0F90D1DD003BB5A7 /* class_c_on_off_button.png */, + 24A2005F0F90D1DD003BB5A7 /* class_c_option_menu-members.html */, + 24A200600F90D1DD003BB5A7 /* class_c_option_menu.html */, + 24A200610F90D1DD003BB5A7 /* class_c_option_menu.png */, + 24A200620F90D1DD003BB5A7 /* class_c_option_menu_scheme-members.html */, + 24A200630F90D1DD003BB5A7 /* class_c_option_menu_scheme.html */, + 24A200640F90D1DD003BB5A7 /* class_c_option_menu_scheme.png */, + 24A200650F90D1DD003BB5A7 /* class_c_param_display-members.html */, + 24A200660F90D1DD003BB5A7 /* class_c_param_display.html */, + 24A200670F90D1DD003BB5A7 /* class_c_param_display.png */, + 24A200680F90D1DD003BB5A7 /* class_c_reference_counter-members.html */, + 24A200690F90D1DD003BB5A7 /* class_c_reference_counter.html */, + 24A2006A0F90D1DD003BB5A7 /* class_c_reference_counter.png */, + 24A2006B0F90D1DD003BB5A7 /* class_c_rocker_switch-members.html */, + 24A2006C0F90D1DD003BB5A7 /* class_c_rocker_switch.html */, + 24A2006D0F90D1DD003BB5A7 /* class_c_rocker_switch.png */, + 24A2006E0F90D1DD003BB5A7 /* class_c_scroll_container-members.html */, + 24A2006F0F90D1DD003BB5A7 /* class_c_scroll_container.html */, + 24A200700F90D1DD003BB5A7 /* class_c_scroll_container.png */, + 24A200710F90D1DD003BB5A7 /* class_c_scroll_view-members.html */, + 24A200720F90D1DD003BB5A7 /* class_c_scroll_view.html */, + 24A200730F90D1DD003BB5A7 /* class_c_scroll_view.png */, + 24A200740F90D1DD003BB5A7 /* class_c_scrollbar-members.html */, + 24A200750F90D1DD003BB5A7 /* class_c_scrollbar.html */, + 24A200760F90D1DD003BB5A7 /* class_c_scrollbar.png */, + 24A200770F90D1DD003BB5A7 /* class_c_slider-members.html */, + 24A200780F90D1DD003BB5A7 /* class_c_slider.html */, + 24A200790F90D1DD003BB5A7 /* class_c_slider.png */, + 24A2007A0F90D1DD003BB5A7 /* class_c_special_digit-members.html */, + 24A2007B0F90D1DD003BB5A7 /* class_c_special_digit.html */, + 24A2007C0F90D1DD003BB5A7 /* class_c_special_digit.png */, + 24A2007D0F90D1DD003BB5A7 /* class_c_splash_screen-members.html */, + 24A2007E0F90D1DD003BB5A7 /* class_c_splash_screen.html */, + 24A2007F0F90D1DD003BB5A7 /* class_c_splash_screen.png */, + 24A200800F90D1DD003BB5A7 /* class_c_splash_screen_view-members.html */, + 24A200810F90D1DD003BB5A7 /* class_c_splash_screen_view.html */, + 24A200820F90D1DD003BB5A7 /* class_c_splash_screen_view.png */, + 24A200830F90D1DD003BB5A7 /* class_c_tab_button-members.html */, + 24A200840F90D1DD003BB5A7 /* class_c_tab_button.html */, + 24A200850F90D1DD003BB5A7 /* class_c_tab_button.png */, + 24A200860F90D1DD003BB5A7 /* class_c_tab_child_view-members.html */, + 24A200870F90D1DD003BB5A7 /* class_c_tab_child_view.html */, + 24A200880F90D1DD003BB5A7 /* class_c_tab_child_view.png */, + 24A200890F90D1DD003BB5A7 /* class_c_tab_view-members.html */, + 24A2008A0F90D1DD003BB5A7 /* class_c_tab_view.html */, + 24A2008B0F90D1DD003BB5A7 /* class_c_tab_view.png */, + 24A2008C0F90D1DD003BB5A7 /* class_c_text_edit-members.html */, + 24A2008D0F90D1DD003BB5A7 /* class_c_text_edit.html */, + 24A2008E0F90D1DD003BB5A7 /* class_c_text_edit.png */, + 24A2008F0F90D1DD003BB5A7 /* class_c_text_label-members.html */, + 24A200900F90D1DD003BB5A7 /* class_c_text_label.html */, + 24A200910F90D1DD003BB5A7 /* class_c_text_label.png */, + 24A200920F90D1DD003BB5A7 /* class_c_vertical_slider-members.html */, + 24A200930F90D1DD003BB5A7 /* class_c_vertical_slider.html */, + 24A200940F90D1DD003BB5A7 /* class_c_vertical_slider.png */, + 24A200950F90D1DD003BB5A7 /* class_c_vertical_switch-members.html */, + 24A200960F90D1DD003BB5A7 /* class_c_vertical_switch.html */, + 24A200970F90D1DD003BB5A7 /* class_c_vertical_switch.png */, + 24A200980F90D1DD003BB5A7 /* class_c_view-members.html */, + 24A200990F90D1DD003BB5A7 /* class_c_view.html */, + 24A2009A0F90D1DD003BB5A7 /* class_c_view.png */, + 24A2009B0F90D1DD003BB5A7 /* class_c_view_container-members.html */, + 24A2009C0F90D1DD003BB5A7 /* class_c_view_container.html */, + 24A2009D0F90D1DD003BB5A7 /* class_c_view_container.png */, + 24A2009E0F90D1DD003BB5A7 /* class_c_vu_meter-members.html */, + 24A2009F0F90D1DD003BB5A7 /* class_c_vu_meter.html */, + 24A200A00F90D1DD003BB5A7 /* class_c_vu_meter.png */, + 24A200A10F90D1DD003BB5A7 /* class_i_scrollbar_drawer-members.html */, + 24A200A20F90D1DD003BB5A7 /* class_i_scrollbar_drawer.html */, + 24A200A30F90D1DD003BB5A7 /* class_plugin_g_u_i_editor-members.html */, + 24A200A40F90D1DD003BB5A7 /* class_plugin_g_u_i_editor.html */, + 24A200A50F90D1DD003BB5A7 /* cscrollview_8cpp.html */, + 24A200A60F90D1DD003BB5A7 /* cscrollview_8h.html */, + 24A200A70F90D1DD003BB5A7 /* ctabview_8cpp.html */, + 24A200A80F90D1DD003BB5A7 /* ctabview_8h.html */, + 24A200A90F90D1DD003BB5A7 /* deprecated.html */, + 24A200AA0F90D1DD003BB5A7 /* doc_8h.html */, + 24A200AB0F90D1DD003BB5A7 /* doxygen.css */, + 24A200AC0F90D1DD003BB5A7 /* doxygen.png */, + 24A200AD0F90D1DD003BB5A7 /* files.html */, + 24A200AE0F90D1DD003BB5A7 /* ftv2blank.png */, + 24A200AF0F90D1DD003BB5A7 /* ftv2doc.png */, + 24A200B00F90D1DD003BB5A7 /* ftv2folderclosed.png */, + 24A200B10F90D1DE003BB5A7 /* ftv2folderopen.png */, + 24A200B20F90D1DE003BB5A7 /* ftv2lastnode.png */, + 24A200B30F90D1DE003BB5A7 /* ftv2link.png */, + 24A200B40F90D1DE003BB5A7 /* ftv2mlastnode.png */, + 24A200B50F90D1DE003BB5A7 /* ftv2mnode.png */, + 24A200B60F90D1DE003BB5A7 /* ftv2node.png */, + 24A200B70F90D1DE003BB5A7 /* ftv2plastnode.png */, + 24A200B80F90D1DE003BB5A7 /* ftv2pnode.png */, + 24A200B90F90D1DE003BB5A7 /* ftv2vertline.png */, + 24A200BA0F90D1DE003BB5A7 /* functions.html */, + 24A200BB0F90D1DE003BB5A7 /* functions_0x62.html */, + 24A200BC0F90D1DE003BB5A7 /* functions_0x63.html */, + 24A200BD0F90D1DE003BB5A7 /* functions_0x64.html */, + 24A200BE0F90D1DE003BB5A7 /* functions_0x65.html */, + 24A200BF0F90D1DE003BB5A7 /* functions_0x66.html */, + 24A200C00F90D1DE003BB5A7 /* functions_0x67.html */, + 24A200C10F90D1DE003BB5A7 /* functions_0x68.html */, + 24A200C20F90D1DE003BB5A7 /* functions_0x69.html */, + 24A200C30F90D1DE003BB5A7 /* functions_0x6b.html */, + 24A200C40F90D1DE003BB5A7 /* functions_0x6c.html */, + 24A200C50F90D1DE003BB5A7 /* functions_0x6d.html */, + 24A200C60F90D1DE003BB5A7 /* functions_0x6e.html */, + 24A200C70F90D1DE003BB5A7 /* functions_0x6f.html */, + 24A200C80F90D1DE003BB5A7 /* functions_0x70.html */, + 24A200C90F90D1DE003BB5A7 /* functions_0x72.html */, + 24A200CA0F90D1DE003BB5A7 /* functions_0x73.html */, + 24A200CB0F90D1DE003BB5A7 /* functions_0x74.html */, + 24A200CC0F90D1DE003BB5A7 /* functions_0x75.html */, + 24A200CD0F90D1DE003BB5A7 /* functions_0x76.html */, + 24A200CE0F90D1DE003BB5A7 /* functions_0x77.html */, + 24A200CF0F90D1DE003BB5A7 /* functions_0x78.html */, + 24A200D00F90D1DE003BB5A7 /* functions_0x79.html */, + 24A200D10F90D1DE003BB5A7 /* functions_0x7a.html */, + 24A200D20F90D1DE003BB5A7 /* functions_0x7e.html */, + 24A200D30F90D1DE003BB5A7 /* functions_eval.html */, + 24A200D40F90D1DE003BB5A7 /* functions_func.html */, + 24A200D50F90D1DE003BB5A7 /* functions_func_0x62.html */, + 24A200D60F90D1DE003BB5A7 /* functions_func_0x63.html */, + 24A200D70F90D1DE003BB5A7 /* functions_func_0x64.html */, + 24A200D80F90D1DE003BB5A7 /* functions_func_0x65.html */, + 24A200D90F90D1DE003BB5A7 /* functions_func_0x66.html */, + 24A200DA0F90D1DE003BB5A7 /* functions_func_0x67.html */, + 24A200DB0F90D1DE003BB5A7 /* functions_func_0x68.html */, + 24A200DC0F90D1DE003BB5A7 /* functions_func_0x69.html */, + 24A200DD0F90D1DE003BB5A7 /* functions_func_0x6c.html */, + 24A200DE0F90D1DE003BB5A7 /* functions_func_0x6d.html */, + 24A200DF0F90D1DE003BB5A7 /* functions_func_0x6e.html */, + 24A200E00F90D1DE003BB5A7 /* functions_func_0x6f.html */, + 24A200E10F90D1DE003BB5A7 /* functions_func_0x70.html */, + 24A200E20F90D1DE003BB5A7 /* functions_func_0x72.html */, + 24A200E30F90D1DE003BB5A7 /* functions_func_0x73.html */, + 24A200E40F90D1DE003BB5A7 /* functions_func_0x74.html */, + 24A200E50F90D1DE003BB5A7 /* functions_func_0x75.html */, + 24A200E60F90D1DE003BB5A7 /* functions_func_0x76.html */, + 24A200E70F90D1DE003BB5A7 /* functions_func_0x77.html */, + 24A200E80F90D1DE003BB5A7 /* functions_func_0x7e.html */, + 24A200E90F90D1DE003BB5A7 /* functions_rela.html */, + 24A200EA0F90D1DE003BB5A7 /* functions_vars.html */, + 24A200EB0F90D1DE003BB5A7 /* functions_vars_0x62.html */, + 24A200EC0F90D1DE003BB5A7 /* functions_vars_0x63.html */, + 24A200ED0F90D1DE003BB5A7 /* functions_vars_0x64.html */, + 24A200EE0F90D1DE003BB5A7 /* functions_vars_0x65.html */, + 24A200EF0F90D1DE003BB5A7 /* functions_vars_0x66.html */, + 24A200F00F90D1DE003BB5A7 /* functions_vars_0x67.html */, + 24A200F10F90D1DE003BB5A7 /* functions_vars_0x68.html */, + 24A200F20F90D1DE003BB5A7 /* functions_vars_0x69.html */, + 24A200F30F90D1DE003BB5A7 /* functions_vars_0x6b.html */, + 24A200F40F90D1DE003BB5A7 /* functions_vars_0x6c.html */, + 24A200F50F90D1DE003BB5A7 /* functions_vars_0x6d.html */, + 24A200F60F90D1DE003BB5A7 /* functions_vars_0x6e.html */, + 24A200F70F90D1DE003BB5A7 /* functions_vars_0x6f.html */, + 24A200F80F90D1DE003BB5A7 /* functions_vars_0x70.html */, + 24A200F90F90D1DE003BB5A7 /* functions_vars_0x72.html */, + 24A200FA0F90D1DE003BB5A7 /* functions_vars_0x73.html */, + 24A200FB0F90D1DE003BB5A7 /* functions_vars_0x74.html */, + 24A200FC0F90D1DE003BB5A7 /* functions_vars_0x75.html */, + 24A200FD0F90D1DE003BB5A7 /* functions_vars_0x76.html */, + 24A200FE0F90D1DE003BB5A7 /* functions_vars_0x77.html */, + 24A200FF0F90D1DE003BB5A7 /* functions_vars_0x78.html */, + 24A201000F90D1DE003BB5A7 /* functions_vars_0x79.html */, + 24A201010F90D1DE003BB5A7 /* functions_vars_0x7a.html */, + 24A201020F90D1DE003BB5A7 /* globals.html */, + 24A201030F90D1DE003BB5A7 /* globals_0x61.html */, + 24A201040F90D1DE003BB5A7 /* globals_0x62.html */, + 24A201050F90D1DE003BB5A7 /* globals_0x63.html */, + 24A201060F90D1DE003BB5A7 /* globals_0x65.html */, + 24A201070F90D1DE003BB5A7 /* globals_0x66.html */, + 24A201080F90D1DE003BB5A7 /* globals_0x67.html */, + 24A201090F90D1DE003BB5A7 /* globals_0x6b.html */, + 24A2010A0F90D1DE003BB5A7 /* globals_0x6d.html */, + 24A2010B0F90D1DE003BB5A7 /* globals_0x6e.html */, + 24A2010C0F90D1DE003BB5A7 /* globals_0x6f.html */, + 24A2010D0F90D1DE003BB5A7 /* globals_0x71.html */, + 24A2010E0F90D1DE003BB5A7 /* globals_0x72.html */, + 24A2010F0F90D1DE003BB5A7 /* globals_0x73.html */, + 24A201100F90D1DE003BB5A7 /* globals_0x74.html */, + 24A201110F90D1DE003BB5A7 /* globals_0x75.html */, + 24A201120F90D1DE003BB5A7 /* globals_0x76.html */, + 24A201130F90D1DE003BB5A7 /* globals_0x77.html */, + 24A201140F90D1DE003BB5A7 /* globals_defs.html */, + 24A201150F90D1DE003BB5A7 /* globals_enum.html */, + 24A201160F90D1DE003BB5A7 /* globals_eval.html */, + 24A201170F90D1DE003BB5A7 /* globals_type.html */, + 24A201180F90D1DE003BB5A7 /* globals_vars.html */, + 24A201190F90D1DE003BB5A7 /* hierarchy.html */, + 24A2011A0F90D1DE003BB5A7 /* index.html */, + 24A2011B0F90D1DE003BB5A7 /* intro.html */, + 24A2011C0F90D1DE003BB5A7 /* license.html */, + 24A2011D0F90D1DE003BB5A7 /* maceditor.html */, + 24A2011E0F90D1DE003BB5A7 /* main.html */, + 24A2011F0F90D1DE003BB5A7 /* others.html */, + 24A201200F90D1DE003BB5A7 /* pages.html */, + 24A201210F90D1DE003BB5A7 /* plugguieditor_8cpp.html */, + 24A201220F90D1DE003BB5A7 /* plugguieditor_8h.html */, + 24A201230F90D1DE003BB5A7 /* sequences.html */, + 24A201240F90D1DE003BB5A7 /* struct_c_color-members.html */, + 24A201250F90D1DE003BB5A7 /* struct_c_color.html */, + 24A201260F90D1DE003BB5A7 /* struct_c_point-members.html */, + 24A201270F90D1DE003BB5A7 /* struct_c_point.html */, + 24A201280F90D1DE003BB5A7 /* struct_c_rect-members.html */, + 24A201290F90D1DE003BB5A7 /* struct_c_rect.html */, + 24A2012A0F90D1DE003BB5A7 /* struct_e_rect-members.html */, + 24A2012B0F90D1DE003BB5A7 /* struct_e_rect.html */, + 24A2012C0F90D1DE003BB5A7 /* struct_vst_file_select-members.html */, + 24A2012D0F90D1DE003BB5A7 /* struct_vst_file_select.html */, + 24A2012E0F90D1DE003BB5A7 /* struct_vst_file_type-members.html */, + 24A2012F0F90D1DE003BB5A7 /* struct_vst_file_type.html */, + 24A201300F90D1DE003BB5A7 /* struct_vst_key_code-members.html */, + 24A201310F90D1DE003BB5A7 /* struct_vst_key_code.html */, + 24A201320F90D1DE003BB5A7 /* tab_b.gif */, + 24A201330F90D1DE003BB5A7 /* tab_l.gif */, + 24A201340F90D1DE003BB5A7 /* tab_r.gif */, + 24A201350F90D1DE003BB5A7 /* tabs.css */, + 24A201360F90D1DE003BB5A7 /* thanks.html */, + 24A201370F90D1DE003BB5A7 /* tree.html */, + 24A201380F90D1DE003BB5A7 /* vstcontrols_8cpp.html */, + 24A201390F90D1DE003BB5A7 /* vstcontrols_8h.html */, + 24A2013A0F90D1DE003BB5A7 /* vstgui_8cpp.html */, + 24A2013B0F90D1DE003BB5A7 /* vstgui_8h.html */, + 24A2013C0F90D1DE003BB5A7 /* vstkeycode_8h.html */, + 24A2013D0F90D1DE003BB5A7 /* vstoffline.html */, + 24A2013E0F90D1DE003BB5A7 /* vstparamstruct.html */, + 24A2013F0F90D1DE003BB5A7 /* vstplugscarbon_8h.html */, + 24A201400F90D1DE003BB5A7 /* vstplugsmac_8h.html */, + 24A201410F90D1DE003BB5A7 /* vstplugsmacho_8h.html */, + 24A201420F90D1DE003BB5A7 /* vstplugsquartz_8h.html */, + 24A201430F90D1DE003BB5A7 /* whatsnew.html */, + ); + name = html; + path = /vstsdk2.4/vstgui.sf/vstgui/Documentation/html; + sourceTree = ""; + }; + 24A203CE0F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203D70F90D272003BB5A7 /* again.vst */, + 24A203D90F90D272003BB5A7 /* adelay.vst */, + 24A203DB0F90D272003BB5A7 /* vstxsynth.vst */, + 24A203DD0F90D272003BB5A7 /* surrounddelay.vst */, + 24A203DF0F90D272003BB5A7 /* minihost.app */, + ); + name = Products; + sourceTree = ""; + }; + 24A203E00F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203E50F90D272003BB5A7 /* drawtest.component */, + 24A203E70F90D272003BB5A7 /* drawtest.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A203E80F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203ED0F90D272003BB5A7 /* drawtest.component */, + 24A203EF0F90D272003BB5A7 /* drawtest.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A2FEBB0F90D1DB003BB5A7 /* vstsdk2.4 */ = { + isa = PBXGroup; + children = ( + 24A2FEBC0F90D1DC003BB5A7 /* artwork */, + 24A2FEC20F90D1DC003BB5A7 /* bin */, + 24A2FED80F90D1DC003BB5A7 /* doc */, + 24A2FF8E0F90D1DD003BB5A7 /* index.html */, + 24A2FF8F0F90D1DD003BB5A7 /* pluginterfaces */, + 24A2FF940F90D1DD003BB5A7 /* public.sdk */, + 24A2FFDE0F90D1DD003BB5A7 /* vstgui.sf */, + ); + name = vstsdk2.4; + path = /vstsdk2.4; + sourceTree = ""; + }; + 24A2FEBC0F90D1DC003BB5A7 /* artwork */ = { + isa = PBXGroup; + children = ( + 24A2FEBD0F90D1DC003BB5A7 /* Thumbs.db */, + 24A2FEBE0F90D1DC003BB5A7 /* VST_Logo_Usage_Guideline.pdf */, + 24A2FEBF0F90D1DC003BB5A7 /* VSTLogoAlpha.png */, + 24A2FEC00F90D1DC003BB5A7 /* VSTLogoBlack.jpg */, + 24A2FEC10F90D1DC003BB5A7 /* VSTLogoWhite.jpg */, + ); + name = artwork; + path = /vstsdk2.4/artwork; + sourceTree = ""; + }; + 24A2FEC20F90D1DC003BB5A7 /* bin */ = { + isa = PBXGroup; + children = ( + 24A2FEC30F90D1DC003BB5A7 /* mac */, + 24A2FED50F90D1DC003BB5A7 /* win */, + ); + name = bin; + path = /vstsdk2.4/bin; + sourceTree = ""; + }; + 24A2FEC30F90D1DC003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FEC40F90D1DC003BB5A7 /* VSTMonitor.vst */, + 24A2FED40F90D1DC003BB5A7 /* VSTParamTool.app */, + ); + name = mac; + path = /vstsdk2.4/bin/mac; + sourceTree = ""; + }; + 24A2FEC40F90D1DC003BB5A7 /* VSTMonitor.vst */ = { + isa = PBXGroup; + children = ( + 24A2FEC50F90D1DC003BB5A7 /* Contents */, + ); + name = VSTMonitor.vst; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst; + sourceTree = ""; + }; + 24A2FEC50F90D1DC003BB5A7 /* Contents */ = { + isa = PBXGroup; + children = ( + 24A2FEC60F90D1DC003BB5A7 /* Info.plist */, + 24A2FEC70F90D1DC003BB5A7 /* MacOS */, + 24A2FEC90F90D1DC003BB5A7 /* PkgInfo */, + 24A2FECA0F90D1DC003BB5A7 /* Resources */, + ); + name = Contents; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents; + sourceTree = ""; + }; + 24A2FEC70F90D1DC003BB5A7 /* MacOS */ = { + isa = PBXGroup; + children = ( + 24A2FEC80F90D1DC003BB5A7 /* VSTMonitor */, + ); + name = MacOS; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents/MacOS; + sourceTree = ""; + }; + 24A2FECA0F90D1DC003BB5A7 /* Resources */ = { + isa = PBXGroup; + children = ( + 24A2FECB0F90D1DC003BB5A7 /* bmp50000.bmp */, + 24A2FECC0F90D1DC003BB5A7 /* bmp50001.bmp */, + 24A2FECD0F90D1DC003BB5A7 /* bmp50002.bmp */, + 24A2FECE0F90D1DC003BB5A7 /* bmp50003.bmp */, + 24A2FECF0F90D1DC003BB5A7 /* bmp50004.bmp */, + 24A2FED00F90D1DC003BB5A7 /* bmp50005.bmp */, + 24A2FED10F90D1DC003BB5A7 /* bmp50006.bmp */, + 24A2FED20F90D1DC003BB5A7 /* bmp50007.bmp */, + 24A2FED30F90D1DC003BB5A7 /* bmp50008.bmp */, + ); + name = Resources; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents/Resources; + sourceTree = ""; + }; + 24A2FED50F90D1DC003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FED60F90D1DC003BB5A7 /* vstmonitor.dll */, + 24A2FED70F90D1DC003BB5A7 /* vstparamtool.exe */, + ); + name = win; + path = /vstsdk2.4/bin/win; + sourceTree = ""; + }; + 24A2FED80F90D1DC003BB5A7 /* doc */ = { + isa = PBXGroup; + children = ( + 24A2FED90F90D1DC003BB5A7 /* gfx */, + 24A2FEDE0F90D1DC003BB5A7 /* html */, + 24A2FF8A0F90D1DD003BB5A7 /* sdk.menu.html */, + 24A2FF8B0F90D1DD003BB5A7 /* sdk.overview.html */, + 24A2FF8C0F90D1DD003BB5A7 /* sdkdoc.css */, + 24A2FF8D0F90D1DD003BB5A7 /* VST Licensing Agreement.rtf */, + ); + name = doc; + path = /vstsdk2.4/doc; + sourceTree = ""; + }; + 24A2FED90F90D1DC003BB5A7 /* gfx */ = { + isa = PBXGroup; + children = ( + 24A2FEDA0F90D1DC003BB5A7 /* folder.gif */, + 24A2FEDB0F90D1DC003BB5A7 /* mac.gif */, + 24A2FEDC0F90D1DC003BB5A7 /* vstpluglogo_small.jpg */, + 24A2FEDD0F90D1DC003BB5A7 /* win.gif */, + ); + name = gfx; + path = /vstsdk2.4/doc/gfx; + sourceTree = ""; + }; + 24A2FEDE0F90D1DC003BB5A7 /* html */ = { + isa = PBXGroup; + children = ( + 24A2FEDF0F90D1DC003BB5A7 /* aeffect_8h.html */, + 24A2FEE00F90D1DC003BB5A7 /* aeffectx_8h.html */, + 24A2FEE10F90D1DC003BB5A7 /* aeffeditor_8h.html */, + 24A2FEE20F90D1DC003BB5A7 /* annotated.html */, + 24A2FEE30F90D1DC003BB5A7 /* audioeffect_8cpp.html */, + 24A2FEE40F90D1DC003BB5A7 /* audioeffect_8h.html */, + 24A2FEE50F90D1DC003BB5A7 /* audioeffectx_8cpp.html */, + 24A2FEE60F90D1DC003BB5A7 /* audioeffectx_8h.html */, + 24A2FEE70F90D1DC003BB5A7 /* Blocksizechange.gif */, + 24A2FEE80F90D1DC003BB5A7 /* class_a_eff_editor-members.html */, + 24A2FEE90F90D1DC003BB5A7 /* class_a_eff_editor.html */, + 24A2FEEA0F90D1DC003BB5A7 /* class_audio_effect-members.html */, + 24A2FEEB0F90D1DC003BB5A7 /* class_audio_effect.html */, + 24A2FEEC0F90D1DC003BB5A7 /* class_audio_effect.png */, + 24A2FEED0F90D1DC003BB5A7 /* class_audio_effect_x-members.html */, + 24A2FEEE0F90D1DC003BB5A7 /* class_audio_effect_x.html */, + 24A2FEEF0F90D1DC003BB5A7 /* class_audio_effect_x.png */, + 24A2FEF00F90D1DC003BB5A7 /* ControlChanged.gif */, + 24A2FEF10F90D1DC003BB5A7 /* deprecated.html */, + 24A2FEF20F90D1DC003BB5A7 /* dir_2d3252dd12c84c66c1d25b26bb45a1f5.html */, + 24A2FEF30F90D1DC003BB5A7 /* dir_77c628dfee72e555f82d5ef53b733f38.html */, + 24A2FEF40F90D1DC003BB5A7 /* dir_f81105d3b854bea570aaf3bae5cb64c1.html */, + 24A2FEF50F90D1DC003BB5A7 /* dir_fa0454ab79b4262333bf837ea3d765e9.html */, + 24A2FEF60F90D1DC003BB5A7 /* dirs.html */, + 24A2FEF70F90D1DC003BB5A7 /* doc_8h.html */, + 24A2FEF80F90D1DC003BB5A7 /* doxygen.css */, + 24A2FEF90F90D1DC003BB5A7 /* doxygen.png */, + 24A2FEFA0F90D1DC003BB5A7 /* files.html */, + 24A2FEFB0F90D1DC003BB5A7 /* ftv2blank.png */, + 24A2FEFC0F90D1DC003BB5A7 /* ftv2doc.png */, + 24A2FEFD0F90D1DC003BB5A7 /* ftv2folderclosed.png */, + 24A2FEFE0F90D1DC003BB5A7 /* ftv2folderopen.png */, + 24A2FEFF0F90D1DC003BB5A7 /* ftv2lastnode.png */, + 24A2FF000F90D1DC003BB5A7 /* ftv2link.png */, + 24A2FF010F90D1DC003BB5A7 /* ftv2mlastnode.png */, + 24A2FF020F90D1DC003BB5A7 /* ftv2mnode.png */, + 24A2FF030F90D1DC003BB5A7 /* ftv2node.png */, + 24A2FF040F90D1DC003BB5A7 /* ftv2plastnode.png */, + 24A2FF050F90D1DC003BB5A7 /* ftv2pnode.png */, + 24A2FF060F90D1DC003BB5A7 /* ftv2vertline.png */, + 24A2FF070F90D1DC003BB5A7 /* functions.html */, + 24A2FF080F90D1DC003BB5A7 /* functions_0x62.html */, + 24A2FF090F90D1DC003BB5A7 /* functions_0x63.html */, + 24A2FF0A0F90D1DC003BB5A7 /* functions_0x64.html */, + 24A2FF0B0F90D1DC003BB5A7 /* functions_0x65.html */, + 24A2FF0C0F90D1DC003BB5A7 /* functions_0x66.html */, + 24A2FF0D0F90D1DC003BB5A7 /* functions_0x67.html */, + 24A2FF0E0F90D1DC003BB5A7 /* functions_0x68.html */, + 24A2FF0F0F90D1DC003BB5A7 /* functions_0x69.html */, + 24A2FF100F90D1DC003BB5A7 /* functions_0x6b.html */, + 24A2FF110F90D1DC003BB5A7 /* functions_0x6c.html */, + 24A2FF120F90D1DC003BB5A7 /* functions_0x6d.html */, + 24A2FF130F90D1DC003BB5A7 /* functions_0x6e.html */, + 24A2FF140F90D1DC003BB5A7 /* functions_0x6f.html */, + 24A2FF150F90D1DC003BB5A7 /* functions_0x70.html */, + 24A2FF160F90D1DC003BB5A7 /* functions_0x72.html */, + 24A2FF170F90D1DC003BB5A7 /* functions_0x73.html */, + 24A2FF180F90D1DC003BB5A7 /* functions_0x74.html */, + 24A2FF190F90D1DC003BB5A7 /* functions_0x75.html */, + 24A2FF1A0F90D1DC003BB5A7 /* functions_0x76.html */, + 24A2FF1B0F90D1DC003BB5A7 /* functions_0x77.html */, + 24A2FF1C0F90D1DC003BB5A7 /* functions_0x78.html */, + 24A2FF1D0F90D1DC003BB5A7 /* functions_0x79.html */, + 24A2FF1E0F90D1DC003BB5A7 /* functions_0x7e.html */, + 24A2FF1F0F90D1DC003BB5A7 /* functions_func.html */, + 24A2FF200F90D1DC003BB5A7 /* functions_vars.html */, + 24A2FF210F90D1DC003BB5A7 /* globals.html */, + 24A2FF220F90D1DC003BB5A7 /* globals_0x62.html */, + 24A2FF230F90D1DC003BB5A7 /* globals_0x63.html */, + 24A2FF240F90D1DC003BB5A7 /* globals_0x64.html */, + 24A2FF250F90D1DC003BB5A7 /* globals_0x65.html */, + 24A2FF260F90D1DC003BB5A7 /* globals_0x66.html */, + 24A2FF270F90D1DC003BB5A7 /* globals_0x6b.html */, + 24A2FF280F90D1DC003BB5A7 /* globals_0x6d.html */, + 24A2FF290F90D1DC003BB5A7 /* globals_0x74.html */, + 24A2FF2A0F90D1DC003BB5A7 /* globals_0x76.html */, + 24A2FF2B0F90D1DC003BB5A7 /* globals_defs.html */, + 24A2FF2C0F90D1DC003BB5A7 /* globals_enum.html */, + 24A2FF2D0F90D1DC003BB5A7 /* globals_eval.html */, + 24A2FF2E0F90D1DC003BB5A7 /* globals_eval_0x65.html */, + 24A2FF2F0F90D1DC003BB5A7 /* globals_eval_0x6b.html */, + 24A2FF300F90D1DC003BB5A7 /* globals_eval_0x6d.html */, + 24A2FF310F90D1DC003BB5A7 /* globals_eval_0x76.html */, + 24A2FF320F90D1DC003BB5A7 /* globals_func.html */, + 24A2FF330F90D1DC003BB5A7 /* globals_type.html */, + 24A2FF340F90D1DC003BB5A7 /* globals_vars.html */, + 24A2FF350F90D1DC003BB5A7 /* hierarchy.html */, + 24A2FF360F90D1DC003BB5A7 /* history.html */, + 24A2FF370F90D1DC003BB5A7 /* index.html */, + 24A2FF380F90D1DC003BB5A7 /* Initialisation.gif */, + 24A2FF390F90D1DC003BB5A7 /* intro.html */, + 24A2FF3A0F90D1DC003BB5A7 /* IOchange.gif */, + 24A2FF3B0F90D1DC003BB5A7 /* license.html */, + 24A2FF3C0F90D1DC003BB5A7 /* maceditor.html */, + 24A2FF3D0F90D1DC003BB5A7 /* main.html */, + 24A2FF3E0F90D1DC003BB5A7 /* namespace_host_can_dos.html */, + 24A2FF3F0F90D1DC003BB5A7 /* namespace_plug_can_dos.html */, + 24A2FF400F90D1DC003BB5A7 /* namespacemembers.html */, + 24A2FF410F90D1DC003BB5A7 /* namespacemembers_vars.html */, + 24A2FF420F90D1DC003BB5A7 /* namespaces.html */, + 24A2FF430F90D1DC003BB5A7 /* Offlineprocessing.gif */, + 24A2FF440F90D1DC003BB5A7 /* others.html */, + 24A2FF450F90D1DC003BB5A7 /* pages.html */, + 24A2FF460F90D1DC003BB5A7 /* Sampleratechange.gif */, + 24A2FF470F90D1DC003BB5A7 /* sequences.html */, + 24A2FF480F90D1DC003BB5A7 /* SpeakerarrangementnegotiationforVSTfx.gif */, + 24A2FF490F90D1DC003BB5A7 /* struct_a_effect-members.html */, + 24A2FF4A0F90D1DC003BB5A7 /* struct_a_effect.html */, + 24A2FF4B0F90D1DC003BB5A7 /* struct_e_rect-members.html */, + 24A2FF4C0F90D1DC003BB5A7 /* struct_e_rect.html */, + 24A2FF4D0F90D1DC003BB5A7 /* struct_midi_key_name-members.html */, + 24A2FF4E0F90D1DC003BB5A7 /* struct_midi_key_name.html */, + 24A2FF4F0F90D1DC003BB5A7 /* struct_midi_program_category-members.html */, + 24A2FF500F90D1DC003BB5A7 /* struct_midi_program_category.html */, + 24A2FF510F90D1DC003BB5A7 /* struct_midi_program_name-members.html */, + 24A2FF520F90D1DC003BB5A7 /* struct_midi_program_name.html */, + 24A2FF530F90D1DC003BB5A7 /* struct_vst_audio_file-members.html */, + 24A2FF540F90D1DC003BB5A7 /* struct_vst_audio_file.html */, + 24A2FF550F90D1DC003BB5A7 /* struct_vst_audio_file_marker-members.html */, + 24A2FF560F90D1DC003BB5A7 /* struct_vst_audio_file_marker.html */, + 24A2FF570F90D1DC003BB5A7 /* struct_vst_event-members.html */, + 24A2FF580F90D1DC003BB5A7 /* struct_vst_event.html */, + 24A2FF590F90D1DD003BB5A7 /* struct_vst_events-members.html */, + 24A2FF5A0F90D1DD003BB5A7 /* struct_vst_events.html */, + 24A2FF5B0F90D1DD003BB5A7 /* struct_vst_file_select-members.html */, + 24A2FF5C0F90D1DD003BB5A7 /* struct_vst_file_select.html */, + 24A2FF5D0F90D1DD003BB5A7 /* struct_vst_file_type-members.html */, + 24A2FF5E0F90D1DD003BB5A7 /* struct_vst_file_type.html */, + 24A2FF5F0F90D1DD003BB5A7 /* struct_vst_key_code-members.html */, + 24A2FF600F90D1DD003BB5A7 /* struct_vst_key_code.html */, + 24A2FF610F90D1DD003BB5A7 /* struct_vst_midi_event-members.html */, + 24A2FF620F90D1DD003BB5A7 /* struct_vst_midi_event.html */, + 24A2FF630F90D1DD003BB5A7 /* struct_vst_midi_sysex_event-members.html */, + 24A2FF640F90D1DD003BB5A7 /* struct_vst_midi_sysex_event.html */, + 24A2FF650F90D1DD003BB5A7 /* struct_vst_offline_task-members.html */, + 24A2FF660F90D1DD003BB5A7 /* struct_vst_offline_task.html */, + 24A2FF670F90D1DD003BB5A7 /* struct_vst_parameter_properties-members.html */, + 24A2FF680F90D1DD003BB5A7 /* struct_vst_parameter_properties.html */, + 24A2FF690F90D1DD003BB5A7 /* struct_vst_patch_chunk_info-members.html */, + 24A2FF6A0F90D1DD003BB5A7 /* struct_vst_patch_chunk_info.html */, + 24A2FF6B0F90D1DD003BB5A7 /* struct_vst_pin_properties-members.html */, + 24A2FF6C0F90D1DD003BB5A7 /* struct_vst_pin_properties.html */, + 24A2FF6D0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement-members.html */, + 24A2FF6E0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement.html */, + 24A2FF6F0F90D1DD003BB5A7 /* struct_vst_speaker_properties-members.html */, + 24A2FF700F90D1DD003BB5A7 /* struct_vst_speaker_properties.html */, + 24A2FF710F90D1DD003BB5A7 /* struct_vst_time_info-members.html */, + 24A2FF720F90D1DD003BB5A7 /* struct_vst_time_info.html */, + 24A2FF730F90D1DD003BB5A7 /* struct_vst_variable_io-members.html */, + 24A2FF740F90D1DD003BB5A7 /* struct_vst_variable_io.html */, + 24A2FF750F90D1DD003BB5A7 /* struct_vst_window-members.html */, + 24A2FF760F90D1DD003BB5A7 /* struct_vst_window.html */, + 24A2FF770F90D1DD003BB5A7 /* structfx_bank-members.html */, + 24A2FF780F90D1DD003BB5A7 /* structfx_bank.html */, + 24A2FF790F90D1DD003BB5A7 /* structfx_program-members.html */, + 24A2FF7A0F90D1DD003BB5A7 /* structfx_program.html */, + 24A2FF7B0F90D1DD003BB5A7 /* tab_b.gif */, + 24A2FF7C0F90D1DD003BB5A7 /* tab_l.gif */, + 24A2FF7D0F90D1DD003BB5A7 /* tab_r.gif */, + 24A2FF7E0F90D1DD003BB5A7 /* tabs.css */, + 24A2FF7F0F90D1DD003BB5A7 /* Termination.gif */, + 24A2FF800F90D1DD003BB5A7 /* thanks.html */, + 24A2FF810F90D1DD003BB5A7 /* tree.html */, + 24A2FF820F90D1DD003BB5A7 /* TurnOff.gif */, + 24A2FF830F90D1DD003BB5A7 /* TurnOn.gif */, + 24A2FF840F90D1DD003BB5A7 /* vstfxstore_8h.html */, + 24A2FF850F90D1DD003BB5A7 /* vstoffline.html */, + 24A2FF860F90D1DD003BB5A7 /* vstparamstruct.html */, + 24A2FF870F90D1DD003BB5A7 /* vstpluglogo.jpg */, + 24A2FF880F90D1DD003BB5A7 /* vstplugmain_8cpp.html */, + 24A2FF890F90D1DD003BB5A7 /* whatsnew.html */, + ); + name = html; + path = /vstsdk2.4/doc/html; + sourceTree = ""; + }; + 24A2FF8F0F90D1DD003BB5A7 /* pluginterfaces */ = { + isa = PBXGroup; + children = ( + 24A2FF900F90D1DD003BB5A7 /* vst2.x */, + ); + name = pluginterfaces; + path = /vstsdk2.4/pluginterfaces; + sourceTree = ""; + }; + 24A2FF900F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FF910F90D1DD003BB5A7 /* aeffect.h */, + 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */, + 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */, + ); + name = vst2.x; + path = /vstsdk2.4/pluginterfaces/vst2.x; + sourceTree = ""; + }; + 24A2FF940F90D1DD003BB5A7 /* public.sdk */ = { + isa = PBXGroup; + children = ( + 24A2FF950F90D1DD003BB5A7 /* samples */, + 24A2FFD60F90D1DD003BB5A7 /* source */, + ); + name = public.sdk; + path = /vstsdk2.4/public.sdk; + sourceTree = ""; + }; + 24A2FF950F90D1DD003BB5A7 /* samples */ = { + isa = PBXGroup; + children = ( + 24A2FF960F90D1DD003BB5A7 /* vst2.x */, + ); + name = samples; + path = /vstsdk2.4/public.sdk/samples; + sourceTree = ""; + }; + 24A2FF960F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FF970F90D1DD003BB5A7 /* adelay */, + 24A2FFA80F90D1DD003BB5A7 /* again */, + 24A2FFAE0F90D1DD003BB5A7 /* mac */, + 24A2FFB40F90D1DD003BB5A7 /* minihost */, + 24A2FFBA0F90D1DD003BB5A7 /* vstxsynth */, + 24A2FFC50F90D1DD003BB5A7 /* win */, + 24A2FFC80F90D1DD003BB5A7 /* win.vc2003 */, + 24A2FFCF0F90D1DD003BB5A7 /* win.vc6 */, + ); + name = vst2.x; + path = /vstsdk2.4/public.sdk/samples/vst2.x; + sourceTree = ""; + }; + 24A2FF970F90D1DD003BB5A7 /* adelay */ = { + isa = PBXGroup; + children = ( + 24A2FF980F90D1DD003BB5A7 /* adelay.cpp */, + 24A2FF990F90D1DD003BB5A7 /* adelay.h */, + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */, + 24A2FF9B0F90D1DD003BB5A7 /* editor */, + 24A2FFA30F90D1DD003BB5A7 /* surrounddelay.cpp */, + 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */, + 24A2FFA50F90D1DD003BB5A7 /* win */, + ); + name = adelay; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay; + sourceTree = ""; + }; + 24A2FF9B0F90D1DD003BB5A7 /* editor */ = { + isa = PBXGroup; + children = ( + 24A2FF9C0F90D1DD003BB5A7 /* resources */, + 24A2FFA10F90D1DD003BB5A7 /* sdeditor.cpp */, + 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */, + ); + name = editor; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/editor; + sourceTree = ""; + }; + 24A2FF9C0F90D1DD003BB5A7 /* resources */ = { + isa = PBXGroup; + children = ( + 24A2FF9D0F90D1DD003BB5A7 /* bmp00128.bmp */, + 24A2FF9E0F90D1DD003BB5A7 /* bmp00129.bmp */, + 24A2FF9F0F90D1DD003BB5A7 /* bmp00130.bmp */, + 24A2FFA00F90D1DD003BB5A7 /* surrounddelay.rc */, + ); + name = resources; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/editor/resources; + sourceTree = ""; + }; + 24A2FFA50F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFA60F90D1DD003BB5A7 /* adelay.vcproj */, + 24A2FFA70F90D1DD003BB5A7 /* surrounddelay.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/win; + sourceTree = ""; + }; + 24A2FFA80F90D1DD003BB5A7 /* again */ = { + isa = PBXGroup; + children = ( + 24A2FFA90F90D1DD003BB5A7 /* source */, + 24A2FFAC0F90D1DD003BB5A7 /* win */, + ); + name = again; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again; + sourceTree = ""; + }; + 24A2FFA90F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFAA0F90D1DD003BB5A7 /* again.cpp */, + 24A2FFAB0F90D1DD003BB5A7 /* again.h */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again/source; + sourceTree = ""; + }; + 24A2FFAC0F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFAD0F90D1DD003BB5A7 /* again.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again/win; + sourceTree = ""; + }; + 24A2FFAE0F90D1DD003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FFAF0F90D1DD003BB5A7 /* minihost-Info.plist */, + 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */, + 24A2FFB30F90D1DD003BB5A7 /* vst2.4Info.plist */, + ); + name = mac; + path = /vstsdk2.4/public.sdk/samples/vst2.x/mac; + sourceTree = ""; + }; + 24A2FFB40F90D1DD003BB5A7 /* minihost */ = { + isa = PBXGroup; + children = ( + 24A2FFB50F90D1DD003BB5A7 /* source */, + 24A2FFB80F90D1DD003BB5A7 /* win */, + ); + name = minihost; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost; + sourceTree = ""; + }; + 24A2FFB50F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFB60F90D1DD003BB5A7 /* minieditor.cpp */, + 24A2FFB70F90D1DD003BB5A7 /* minihost.cpp */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost/source; + sourceTree = ""; + }; + 24A2FFB80F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFB90F90D1DD003BB5A7 /* minihost.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost/win; + sourceTree = ""; + }; + 24A2FFBA0F90D1DD003BB5A7 /* vstxsynth */ = { + isa = PBXGroup; + children = ( + 24A2FFBB0F90D1DD003BB5A7 /* resource */, + 24A2FFBE0F90D1DD003BB5A7 /* source */, + 24A2FFC30F90D1DD003BB5A7 /* win */, + ); + name = vstxsynth; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth; + sourceTree = ""; + }; + 24A2FFBB0F90D1DD003BB5A7 /* resource */ = { + isa = PBXGroup; + children = ( + 24A2FFBC0F90D1DD003BB5A7 /* vstxsynth.rc */, + 24A2FFBD0F90D1DD003BB5A7 /* vstxsynth.vstxml */, + ); + name = resource; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/resource; + sourceTree = ""; + }; + 24A2FFBE0F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */, + 24A2FFC00F90D1DD003BB5A7 /* vstxsynth.cpp */, + 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */, + 24A2FFC20F90D1DD003BB5A7 /* vstxsynthproc.cpp */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/source; + sourceTree = ""; + }; + 24A2FFC30F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFC40F90D1DD003BB5A7 /* vstxsynth.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/win; + sourceTree = ""; + }; + 24A2FFC50F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFC60F90D1DD003BB5A7 /* samples.sln */, + 24A2FFC70F90D1DD003BB5A7 /* vstplug.def */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win; + sourceTree = ""; + }; + 24A2FFC80F90D1DD003BB5A7 /* win.vc2003 */ = { + isa = PBXGroup; + children = ( + 24A2FFC90F90D1DD003BB5A7 /* adelay.vcproj */, + 24A2FFCA0F90D1DD003BB5A7 /* again.vcproj */, + 24A2FFCB0F90D1DD003BB5A7 /* minihost.vcproj */, + 24A2FFCC0F90D1DD003BB5A7 /* samples.sln */, + 24A2FFCD0F90D1DD003BB5A7 /* surrounddelay.vcproj */, + 24A2FFCE0F90D1DD003BB5A7 /* vstxsynth.vcproj */, + ); + name = win.vc2003; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win.vc2003; + sourceTree = ""; + }; + 24A2FFCF0F90D1DD003BB5A7 /* win.vc6 */ = { + isa = PBXGroup; + children = ( + 24A2FFD00F90D1DD003BB5A7 /* adelay.dsp */, + 24A2FFD10F90D1DD003BB5A7 /* again.dsp */, + 24A2FFD20F90D1DD003BB5A7 /* minihost.dsp */, + 24A2FFD30F90D1DD003BB5A7 /* samples.dsw */, + 24A2FFD40F90D1DD003BB5A7 /* surrounddelay.dsp */, + 24A2FFD50F90D1DD003BB5A7 /* vstxsynth.dsp */, + ); + name = win.vc6; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win.vc6; + sourceTree = ""; + }; + 24A2FFD60F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFD70F90D1DD003BB5A7 /* vst2.x */, + ); + name = source; + path = /vstsdk2.4/public.sdk/source; + sourceTree = ""; + }; + 24A2FFD70F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */, + 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */, + 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */, + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */, + 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */, + 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */, + ); + name = vst2.x; + path = /vstsdk2.4/public.sdk/source/vst2.x; + sourceTree = ""; + }; + 24A2FFDE0F90D1DD003BB5A7 /* vstgui.sf */ = { + isa = PBXGroup; + children = ( + 24A2FFDF0F90D1DD003BB5A7 /* drawtest */, + 24A200160F90D1DD003BB5A7 /* vstgui */, + ); + name = vstgui.sf; + path = /vstsdk2.4/vstgui.sf; + sourceTree = ""; + }; + 24A2FFDF0F90D1DD003BB5A7 /* drawtest */ = { + isa = PBXGroup; + children = ( + 24A2FFE00F90D1DD003BB5A7 /* mac */, + 24A2FFEE0F90D1DD003BB5A7 /* resources */, + 24A200030F90D1DD003BB5A7 /* source */, + 24A2000F0F90D1DD003BB5A7 /* win */, + 24A200130F90D1DD003BB5A7 /* win.vc6 */, + ); + name = drawtest; + path = /vstsdk2.4/vstgui.sf/drawtest; + sourceTree = ""; + }; + 24A2FFE00F90D1DD003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FFE10F90D1DD003BB5A7 /* audiounit.exp */, + 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */, + 24A2FFE30F90D1DD003BB5A7 /* drawtest.cw9prj */, + 24A2FFE40F90D1DD003BB5A7 /* drawtest.plc */, + 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */, + 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */, + 24A2FFEB0F90D1DD003BB5A7 /* Info.plist */, + 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */, + 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */, + ); + name = mac; + path = /vstsdk2.4/vstgui.sf/drawtest/mac; + sourceTree = ""; + }; + 24A2FFEE0F90D1DD003BB5A7 /* resources */ = { + isa = PBXGroup; + children = ( + 24A2FFEF0F90D1DD003BB5A7 /* audiounit.r */, + 24A2FFF00F90D1DD003BB5A7 /* bmp00001.png */, + 24A2FFF10F90D1DD003BB5A7 /* bmp00100.png */, + 24A2FFF20F90D1DD003BB5A7 /* bmp01000.png */, + 24A2FFF30F90D1DD003BB5A7 /* bmp10001.bmp */, + 24A2FFF40F90D1DD003BB5A7 /* bmp10002.bmp */, + 24A2FFF50F90D1DD003BB5A7 /* bmp10003.bmp */, + 24A2FFF60F90D1DD003BB5A7 /* bmp10004.bmp */, + 24A2FFF70F90D1DD003BB5A7 /* bmp10005.bmp */, + 24A2FFF80F90D1DD003BB5A7 /* bmp10006.bmp */, + 24A2FFF90F90D1DD003BB5A7 /* bmp10007.bmp */, + 24A2FFFA0F90D1DD003BB5A7 /* bmp10008.bmp */, + 24A2FFFB0F90D1DD003BB5A7 /* bmp10009.bmp */, + 24A2FFFC0F90D1DD003BB5A7 /* bmp10010.bmp */, + 24A2FFFD0F90D1DD003BB5A7 /* bmp10011.bmp */, + 24A2FFFE0F90D1DD003BB5A7 /* bmp10012.bmp */, + 24A2FFFF0F90D1DD003BB5A7 /* bmp10013.bmp */, + 24A200000F90D1DD003BB5A7 /* bmp10014.bmp */, + 24A200010F90D1DD003BB5A7 /* bmp10015.bmp */, + 24A200020F90D1DD003BB5A7 /* bmp10016.bmp */, + ); + name = resources; + path = /vstsdk2.4/vstgui.sf/drawtest/resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 245463B90991757100464AD3 /* Cabs.h in Headers */, + 24D8287F09A9164A0093AEF8 /* xcode_vst_prefix.h in Headers */, + 24A202190F90D1DE003BB5A7 /* aeffect.h in Headers */, + 24A2021A0F90D1DE003BB5A7 /* aeffectx.h in Headers */, + 24A2021B0F90D1DE003BB5A7 /* vstfxstore.h in Headers */, + 24A2021D0F90D1DE003BB5A7 /* adelay.h in Headers */, + 24A202240F90D1DE003BB5A7 /* sdeditor.h in Headers */, + 24A202260F90D1DE003BB5A7 /* surrounddelay.h in Headers */, + 24A2022A0F90D1DE003BB5A7 /* again.h in Headers */, + 24A202330F90D1DE003BB5A7 /* gmnames.h in Headers */, + 24A202350F90D1DE003BB5A7 /* vstxsynth.h in Headers */, + 24A202460F90D1DE003BB5A7 /* aeffeditor.h in Headers */, + 24A202480F90D1DE003BB5A7 /* audioeffect.h in Headers */, + 24A2024A0F90D1DE003BB5A7 /* audioeffectx.h in Headers */, + 24A2024D0F90D1DE003BB5A7 /* cw_vst_prefix.pch++ in Headers */, + 24A202510F90D1DE003BB5A7 /* xcode_au_prefix.h in Headers */, + 24A202520F90D1DE003BB5A7 /* xcode_vst_prefix.h in Headers */, + 24A202680F90D1DE003BB5A7 /* controlsgui.h in Headers */, + 24A2026A0F90D1DE003BB5A7 /* pdrawtesteditor.h in Headers */, + 24A2026C0F90D1DE003BB5A7 /* pdrawtesteffect.h in Headers */, + 24A2026F0F90D1DE003BB5A7 /* pdrawtestview.h in Headers */, + 24A202710F90D1DE003BB5A7 /* pprimitivesviews.h in Headers */, + 24A202780F90D1DE003BB5A7 /* aeffguieditor.h in Headers */, + 24A2027A0F90D1DE003BB5A7 /* cfileselector.h in Headers */, + 24A2027D0F90D1DE003BB5A7 /* cscrollview.h in Headers */, + 24A2027F0F90D1DE003BB5A7 /* ctabview.h in Headers */, + 24A203A50F90D1DE003BB5A7 /* plugguieditor.h in Headers */, + 24A203A70F90D1DE003BB5A7 /* vstcontrols.h in Headers */, + 24A203A90F90D1DE003BB5A7 /* vstgui.h in Headers */, + 24A203AA0F90D1DE003BB5A7 /* vstkeycode.h in Headers */, + 24A203AB0F90D1DE003BB5A7 /* vstplugscarbon.h in Headers */, + 24A203AC0F90D1DE003BB5A7 /* vstplugsmac.h in Headers */, + 24A203AD0F90D1DE003BB5A7 /* vstplugsmacho.h in Headers */, + 24A203AE0F90D1DE003BB5A7 /* vstplugsquartz.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* Cabs */ = { + isa = PBXNativeTarget; + buildConfigurationList = 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Cabs" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + 24CFB70807E7A07C0081BD57 /* Copy PkgInfo */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Cabs; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = "FM-Chopper"; + productReference = 2407DE920899296600EB68BF /* Cabs.vst */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 24BEAAF108919AE700E695F9 /* Build configuration list for PBXProject "Cabs" */; + compatibilityVersion = "Xcode 2.4"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 089C166AFE841209C02AAC07 /* FM-Chopper */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 24A203E00F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + }, + { + ProductGroup = 24A203E80F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + }, + { + ProductGroup = 24A203CE0F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* Cabs */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 24A203D70F90D272003BB5A7 /* again.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = again.vst; + remoteRef = 24A203D60F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203D90F90D272003BB5A7 /* adelay.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = adelay.vst; + remoteRef = 24A203D80F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DB0F90D272003BB5A7 /* vstxsynth.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = vstxsynth.vst; + remoteRef = 24A203DA0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DD0F90D272003BB5A7 /* surrounddelay.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = surrounddelay.vst; + remoteRef = 24A203DC0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DF0F90D272003BB5A7 /* minihost.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = minihost.app; + remoteRef = 24A203DE0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203E50F90D272003BB5A7 /* drawtest.component */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.component; + remoteRef = 24A203E40F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203E70F90D272003BB5A7 /* drawtest.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.vst; + remoteRef = 24A203E60F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203ED0F90D272003BB5A7 /* drawtest.component */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.component; + remoteRef = 24A203EC0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203EF0F90D272003BB5A7 /* drawtest.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.vst; + remoteRef = 24A203EE0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 24CFB70407E7A0220081BD57 /* PkgInfo in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 24CFB70807E7A07C0081BD57 /* Copy PkgInfo */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy PkgInfo"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "cp mac/PkgInfo \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.vst/Contents/\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2407DEB9089929BA00EB68BF /* Cabs.cpp in Sources */, + 24D8287009A914000093AEF8 /* CabsProc.cpp in Sources */, + 24A203CB0F90D251003BB5A7 /* audioeffect.cpp in Sources */, + 24A203CC0F90D251003BB5A7 /* audioeffectx.cpp in Sources */, + 24A203CD0F90D251003BB5A7 /* vstplugmain.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 24BEAAEE08919AE700E695F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = "/vstsdk2.4/**"; + INFOPLIST_FILE = ./mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = Gain; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = vst; + }; + name = Debug; + }; + 24BEAAEF08919AE700E695F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + x86_64, + ); + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = "/vstsdk2.4/**"; + INFOPLIST_FILE = ./mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = Cabs; + SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + SECTORDER_FLAGS = ""; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = vst; + }; + name = Release; + }; + 24BEAAF208919AE700E695F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; + INFOPLIST_FILE = ""; + INFOPLIST_PREPROCESS = NO; + }; + name = Debug; + }; + 24BEAAF308919AE700E695F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = s; + INFOPLIST_FILE = ""; + INFOPLIST_PREPROCESS = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Cabs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24BEAAEE08919AE700E695F9 /* Debug */, + 24BEAAEF08919AE700E695F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 24BEAAF108919AE700E695F9 /* Build configuration list for PBXProject "Cabs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24BEAAF208919AE700E695F9 /* Debug */, + 24BEAAF308919AE700E695F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..a80c03824 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..5c38f9460675438b0fec50998b84b4a658168d63 GIT binary patch literal 12075 zcmbVS2Yi!N*S{le)1*n$B+XvUC}ngn%5G^v1WKi)lx0cVr)?l@Y6eg%as%ReQB)kS zib`AN>%;|4R9xUdhRP5H5tQXXMTX? z&&t{ZAV2^E0f+&y0hpYGdrrDj|`eqkxuCn_*ZE^r_UiEYm z%mZ;i2oyjGl0knk01O0!Ksv|(nIH>fgB&mf3YyGPpb?s&8CqZp zv_c!S!vQb{=E6Lf4-4QZSPV)?9$1bhy@1K)-3!S~@dxE+1~KZGB_o$y=u9Xt+C zz?1M4JPp5xKfoX1Pw)&p2me4ZC>BXkBGMuq(jx=PLAfXo<)Z>rhz6q~Gz1Mr!%#6Q zL8H-FbTyiYDo_<_KpbjBO{f{UkO#G)d1yWgqQz(lx(VHm?nKMceduA-iPoX@=qdC( zdKJBf-a+r8kI@eF3EGLiMc<+0=ma{6PNCE2d-MbP5uHW9p+C@{Scv1X2#awdPQg}e z!*=Yzskk3b!~JnSF2IF&FfPHP@i;sQSK_I-2G7K^uoH9Gh3DW_?7dc1ReZO(eG)Ked5;adH*GJ9eE;KDIEg{A3PS%qWL^GZqz z(@U}nv(ocQi?ee|O0$de@(UvqtAH7#tp{qL0a~B~dSC!XU?MRjmc$Vui6E(`ZS{@uc&ALB;F}pD<0|W$xfYHx;9n;PT1z>f-_`2$Q-iIQ8KW4C z@j6?$O4s#Vm`ANFYl73~AMI&rb8~dU3TEd%KivtQZHd#zHG~+u{OyyuHjkHXQDS7b zrn*`iJoA0EGRs?^j09<&U<8qOf>9)y z^xF+aQ|&1QWnc^#%k-y?E_Vj~_Hu5zee*a1h>|F3Wy2d?Zf;0sX66(h-Js0+W-r|& zPg^tRo#Sb4^?6z|>7LJ}EtzATuGY{;#sapgHoBb5UEpdk9!vler}O&QO3$E%f8=~q z$}8zcbt9O0biBV+r)*>aWu1?E0b4pZhA;u zL*%F@cZ(d6Y&8{joS$p) z?F!j=6PVKlnt_WLiH)R27`TB4$h$xbXeB0M?gDM#I$|Ly#5#+z8P`B{($(nVytOhJ zeP2-8+CJEE=$49*OpgK4EUXOZm!ttb+&hdrQjA&P8Bfp%1?G1xV=`U z=ppQ#wHw^V=A}!zbXWO}x&til1b31FBxet}8{7j{P!+!y+y};j2d4Q#=SHQU=6AJF zlyJ7R&1eWiAJsxKhzukOl5Hz~^=<8uV^0Yqi+cz>!mRgUu#%*cj4tpfc#LF{EYh!< zKhJ7jZ>}Iy6*CBaMQg!23P(}uajE`vgY{qoTif50(T$oYE4`(B9ckXqT$|2Nx==Expx2Rj(>d;mTKAAyg_ zFfyEsAR||UPry!U3%kiEQcOz7XlAdP3a_h$8bjnXsv?R-q2Q9PYM0MNb$)cS)9a+@ z;hpSkZQ^EK$y@_Iq8eO(DApF9Hgn1jyIJ7#IuVpb*AG5fsA&QbDdElSw71B2!2;nYtcI zX`rzSCP6t=Kqat{8X9PnkZEK(nL%dKXX`Y72;VD9$4__p%G|Cdb{@4d72jM+eLy`o z&NtOX{U67$U)i@K0`j#oIp18&QUE`71OYE)5^m&~jB&QO-0iip|kh?CS2>y-Jf27hyP zGv{h*_S;6?yE26Pwo%JS=pn+m5Dul_0SCh(ID|A1jx=_|VQ@Hw!zOYw14J57(Q}NB zn8MK&h26?P3$qpeh%31!7IM;U)?7AZQXBIzv`ckaSCz}}=0Z>pOTnBqundlYW8qbB z9BC#V;v@6P4L$x5PJk6m-ifdrP9iQchs^DU*TBiJlDJ6=X=U=JUN%FNc+?y{UK;$> z$_D;DVTrSTZY9@7ZJP$FwX*(yPtDI!?Q{n?+bCgZk3l`KI1sQzss2nj`?3W%VI8a| zZR9%QrM5PT9}KRsOeqPt+zpYVa>16%Mz%r^Y$JXWAoJKr89#LLkmxz*!Rs#@*#U2W z3&{e~POhgTNB$Tk@h-R+h~W}=6N@1moPOt|Bs8}!l1)Q|1u?NhhyAlG`pGz9qD-eZ z*c}72^9sXxPP|B*Ad%AeFuZMi@JNG^Vn0QTI%*R>n%^W4JgqWNU(az3T*K}pxk#bX zULh;$QYI4tiRn^nXqpmF#MR}MV?3>XN;%r&_IURgO=giL#cHGNEK{JfHjZ&Sn|$=0 z;gfAtD!=$7iHv1AwK7Y_Rh)Ys=XcdR%eer@Lg8_()Jz*`VwGOvaX0Kr?U&a7O2Kb< z>aMf_y|M40bWuiT7L{fy0~fl+kW`f{ODo9&GE792T~2O9+^(Df^gX{IIx@>=jf0CQ zD)rf;27dRth77o3J56lLE5~!~G~o%?Hg*mlQRVe``~=dfMiNc%Y_yt@Lvxoh8qZIr z^@}B<{H_c+A{=tt( zM=17zH^W2GJ=>3^YQ z0Y`|k2S;RZ7hFXRvJ-YO^=F|j^X{788qUrkH}PAw8m{4Yh3kT=L(z1Vr@`57ar!N} zL$U{3DkjQK@F2SZ%;}`%158r+_b0)e)qM0wGs#f=NaVeM`#gLVq^*N5z!%{rxEa0# zUxu%c+sVJkGI9sGlPo89t%I+@*Wnf*g`1eWCU=v2$O_7SS;$%UyO!Y@(*TahSU2+al2T4)Y)zo?g z4oo1Pzl-xR?V-cQ&~inE)8EWuN7p(vlxAK&hI)WN zC|-?7YD6?r+<;8Tj4UVxS&S%D3zSQo3@Mr<+PecUqVWZu0o?$kxl&bcra&G7{F0^pZ06es7@NZXOT@2 zg_we7Qs;=O(Nt7}rct$+L0%)TlP%;8st|9kMYHI^*V6w^R7c*TN4}l@|B!sd4xUw% zdybA(uByBo^TJd%sHo5^X?_Q;JZ95=`_O)LfE*-WlCQ`ia+rKgj*xH2 zQ3j7+Qm=Xt9z6y>Qx^hj|8DO2u(p~4#IxSQe+IzO1Zi~QxoUqJs(SS zc~`~C1hrJPTN|9-2Ij#SG2caPteU@xpUE%eS8{e8)?yvjV*~02`QTad8#zaQ4?-c?Nn|ug?l+Ty6vuK9=9Xsg zLWRVo?vl^8n1_r$66yt9QDVMOj zsZVcn2YmboZwBF$zyok5kY8Q`#aTET?83R^Jh?#i`y#d0P$}}f4n&nAdn=Kj;vzf* zi1AQ73=hX6@JKug9;7A^ktb4CyS7(W7P^HfTBvIDHZyNd!-55q8Y5$S`+_ir{27FC zy@I`qw?$319e)sn)*!UeTLP;1JVe_@xn@UA`w8A1 zHEIw3Gzc9*m>P*CBR-T5MP|Mc8odYa#|Q8i6a)`~GW-=jL~{>TSL3ydx!3a0t$@0T zYjp*D{M@YmKoy_w(X{cmOqX>9X#pPuVOkL8eulrsN9Y{i;G_5$o#!Av4j;uQ;Ey%* zn!?@SbWN^;7sXkLy90 z8H5AEILvF?8HTDq<6rQvK{zl72L)mJC9oPs(JLZfxKRLj+{^fT+>6=*K|I}rROrY9}MXdXc+f@LVAUgtw1j@ObLY+p{lKx{_bWV4M~Q8k?3(6ufI-z@wAghu?Nvt z=rB4)fAe$#ox+&9`$Bvb^>q_)Idx={aTTtnzhZLXxwwV?dg(ffpaDD|x6|J--GiUT zuTp>XvmjM4SWqdb5;z5of@Z-Sfk$wiz$XX@o)+vC92I;gI3YMK_(AZK;Ln)Y75f?wvo7YDm}g_2k9jd>bIi*zM`M+-qhsg9 z&X2u5_J-I+vBB6Su@A(qid_@CE_Org07UBEC zkA(Y$2ZUb;zZ9Mno)P{cJS#jW{3{;Di=Q6f6z__k8{ZPYG5+=V zH{#!le_Mn^i6V_iCo+gkB8#ZMXrL%vlqt#<<%-Hh0nrlCk>X}%?U3hyp^ycVOPSQgwGT9B^*fjF5z^- z4+%ddoJ}~Fa3SG$36jK1rHl2XZh$vu+CCC^K?NZyoe zmAoT)PqIz&fn=}bE6HKW5y?@>DarSeA0=lbzetVJ@zVKHBE3brO!}a7m9$H`TDn&H zr1WX&M(K0X7o@LC-;lm5-7VcO{X+Vs^pNyh>2c{v>1pW?(sR;_i6Bvus7zEPY7%vc zDT%g3M`FLk{)st>MTsSeS0}xc^h(m(NxPEvB^^pSopd4T_oP4NK#t@Bd8}L^PnN6Y zTDe|sl$+%#@-gzc^84glJu~~6mnWns2 z*{BREA5pGVZcsk1d{X(c@+0LAQJz(vQ(jR1uKY6@ zB%@?Oa%{3WIVX8Ua%*xh`I+Rc$-9ydC4ZfKGWlHc#pFL!K!sESl|&_1DODR}s}>)lI6KRd=YCtL|2U?#fx=1}#JzPCfU929hE>q7|d(=zR z52)9wUsvx^f3LwBoyMj~(+toI(qw4nYSwC=*1W3Os@bO5rP;0dRP&|gE6rie3C&5( zY0X*9dCf)5A6k)Ct<`GvTBFviP0`x4S=tYmrVsN1Z2NB6#NyY3_14&6@Om%78cBf4X{ z?{p`0zv(XMe%Jk_hkC3}&};Puy-A;<3nV6HaLHQ#8y!@SD;s(Fj~P4nC4 zcg^pcFIcceWJ$0jTI3d`CB;I25@N}-6j+KZB^IZp(X!NXkL6y=1D1y@D=ix=PgtI^ zY_z;+*=l*m^1fxeWw+(H<@*#tiX>%l%J7utlt)t5rff)gBIT)+_fqzx985WsawO$g z%JGylDZi$iOSzEpN6KGTp;c}*TJxowLY>s0G(Yn`>h+GKTE=UQ*GuC;En zer-KzJ!SpgdeQo)4cY{@Sewvhu=TeMvSrw^ZF#l=+ellfZLIBT+XUM*+qJgYwmMsr zZH}$Q=CLiXEw$ZlTV}h{w!(J5?Lphaw$-+cwr6e6**r(a&*caI!v_Eg( zWPi#2s(p)nul=z7JNqvVwZrCcIMN&g9T|?%jxmmLjtP!(M}=dWW45E-(dckF<~kNQ zu6NwvSmapdxYKdB<6cLnW3^+gV}s)<$19H49B(+@avX4c={V##;yCK~-tm*;7spx0 pU#b05Gg50(ovF8^E=zqj_3hMcsXIbpD?o_<78v>O$Y<)#{{dZm;Qasq literal 0 HcmV?d00001 diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..314de0ff8716f1de186bd9e12b891393458717e5 GIT binary patch literal 10373 zcmcgSX?Rmr)90LvXJxXhW-M3h^;9L>-L+#JblIBhbu}vxesIN0 zax6v?6p55bh1BSFbO*WVTyRipP#xwAP zcrJbjFT{`IMR*B*7PsPccs<^L|AV*SSMXc-L;MNej}PI`@L_x$pTb|_v-mu|fPcc* z@t*{dNFpV2q9975BArPW(v{p!?jU!PZX}hYkqpv<^d@(ayU9Q@h?J8dq=F15BgrUI zLu$zw;vg>4LZ*`$WG0zQ9wHBu$H^kHn5-k~$p*5Kyg*(gFOf~;WwM!UBX5!IA5^ zm+8m!XY!aLW*}3_lre*u;Y=k{#f)I885>j2jAfjRi}5gCX40@^XG>$_K_o>{C>qI7 z3}P#iYa8tz&+sx!+Bj~qX9WH9n-i3`p;#0L1ei7?M+y+ZP8*w?o|WG#CnvoqwO3wN zMrw9$@9fmv!rbiCtc+fTS-HJ)ih5?{+gMd`LE&(hdz`1)Udt7@YFnB(r#C=YgS03S ztZR`D#Unj3paf(@CS(RNM1TY$K?+e24YIYU6S@s0p=8R30d+x15CgHmf}HXc2@YUK z^HdzpI@iP^x4nt8v7P9`V0Rto=IVmft@fIHm(%NZH8xU*v9a;NL&eS_Dh^Mro8z3N zt~z@D?wi>TJ7~+#%goBk$jnXck=d&tHM?g)dTL&JkD}D<{Gz;!%))}6`Psc~Y`2>c z2&{#O4|6)kw{XRER1}VS2j{l2W(uBL>!m*1F}pW&YjwFAYwYe~PldzdsA;6!>Vh|+ ztmcJpO`V$2Gpk!-@7~k9B~H!APEV)L>FLv_AE3&QMp-Bu;#!dbA`hTmC{wP=OjW zpamVouSLaFdxKC3Dn(`VsT}lFdy8N(JPohXr}|O!B87Dhugjh5=Il0>rSFz8u8C## z362IkU9P4J^o}L=8m`gCrt&)QmK_9uJMocBfb1+*4wo>}t8m#;Z{sFPo8Q6dH|e=ssjeHK-O0 zkN`$7ff*8^6Wq3z+IKxK6XZZ+(Kysd?K_E=35?DLchxSE!R2F@=aO;BJy zyR}d@>g?`1UXDDlz|jcdL$GWm-74Vf?JbR7A1Xl%iTK9zX9)G&u~&2G*^AM9S5 zTj)LI0m?yvj%f7V)JokZWC;_|WU#iPNs!!%ra+2~O%bRIQnCFNfe?Zj2zUfDp>r#m z1zoJAc84>tD?@Y8!%*Ii9z=7|L(mm&hdbKQJSwzD;Z7>51{-^O7&$5sFK40F<81If z7C5Mrxtw;lPj%{WSgw&~Pp;0!hOZCgTuq$UJvrbpi+GP&4BY}uY0wh%JXqJDr_fUL zGdHKt*DLutVF9I8+t%4*y&FV)Q&82G;#%YuiZMi znfK;gU-q_B*A7=gwZN|LB2*uOB~z$kFV|G&3w!Z_2;0G)A+T3CiRzax7(xN4IK+aTESN(7VE7Z=%-|V&1#xJsX=qX@ulX5mJls zu~=?*xZBYCh;s9{Fv^*K3jYqGk0{k$XgB&8?WyuQnmCV_Qmd}>CqF7;K+qrV;+flv zK1KVgXs-46D8k(~maC`M(5HL%Mk>w5F)oi+5JFb>5=V{O?w%~Xb}tunl9HKj<>+0g znR~idSgiEDys@Rh;q<>0*4I&_Np;S7s?~@$%*-T)Q0|K!uL-A3p2K@=H>1u5vdw z!QpE0ge~Utl@aBs1NbzLtHoW*mC&G>=HWBV1Yf4<)&Xb$wbkx!;QYzLkGUgoi$5IQ zDsRe2atGLL!dkJj-X+|G`f(UoXeS^t4Z4i3^0D>`6t|*la4#R^E3Coz&c_vx;8Hix zFJNgyzoOq@5DW<*kfA>@q2(b)7()q^wqXW~pbQ3&qG&=M#|MB4E1!Z(?F~+cx229N zPa04+0P+8PHiDyY^vE(xFgj0e!%?VjkPME+@>|F#DVd>310HO?35f=4M+a@$SFf~V z4PUVcG~%(InrRRqM64ah^W-R-x605TPq2x`6Ksazhj`z{ozO0P8&1N>IHk(t(-IA) zPz5#^0hRxj11IHfS-5c77n|1vq@=-j;8d`-;X83RsD_bkI1P7)Q82nfu!jo4?mD<- z6K&ecY1=m#-An7XeA@h#(K@b_KEEkQt_SXEV~t_fbgNai<6bz2m*L-obsQ%`SLloT zfpx_Se|)yFy?jK|!bn?Mnwwp2Z<=te03+cr6eAvhb8#NdN4u+Oe06g)MDpb|eXg;4 zIN+cT(7&ZDL5u_OJ;TZ@H2$~YV$@f7WT^xA3UOS@+gKUUbg7y;l~(ELe8El|tZs=p znc35)OG84k;3}}L!d5&CSK#5e62?IzG=URbtMCY1jYrbIqoEnbgNOcYp%GpvzKUoD z^6*t)RRt}8_<-*jPMZ>stC1TaKnNuwUsQ%_!(cdIafpQm?4W@Ij{$cp9s$iZRv$#k z`*|RCS!!L)q1q5TaWj9)1>RO#``6QO<0nrGATQ_UsfS3k;E93QgeSoSe;mS7X&l1S z@N}36Qv$#;40v`}fOr7Ufk`lVR2WxD1Ezv6T!hZe!;giXn~xX3RG3!n=Zi0n=_w(| z1Wsx26ZlEqN<#}v@iReQm%+>cug~+mF2^eXV0HjlhTHM#Fq&)dT9^g*S5c`8CY?0E zao;U`zJND{op~8=h6i8{Rc%05{+1wVz{nlGvxo3j{3`W=*YN9TH+~auqlIO&+tEZT z2!RUUj&hT{Wxjq_+rT*;EuIc`6mFNxD_93#==0z(mliOO!~DZ|JANDQ!0%8pJMp`8 zB(sf2q~0&ymy1SHYEZe$`kjkC^;aPZ&28%#c3AXUm z&V>9xt;`;5r(jAtu_#5iQY?c%ml;l0b~`JS>M5&2mX!QhAdI+=+D(}#vq$f4iM?_HlOxidq{EsOJ|iWWB#UMm*8di54;jM zTI@d>crT?kN&1n&upVBlqy>8&Re7LZB^F_G7~R}dHIx&|^x$rluv<-cH&dbVEwS5a zZ%p)!4=3^?r9`TSM4{!Pvw{Fgn{duf&uyui;PHCu#$~2u2X;AOw}I|%t+4nSgOG8J zBTWIvB2IWMaArJM+KHQZh!B@K84ZaMb|nICp;0a*w;;2nWzaO%||Q4M*LEC=g4vV=TE zmXfE*Gh`WgmOMwEhj-yUcppB158)%&1-s$nb<}@o4M5t-O0tTq=KYEK&>lL%xdPYW zH~5|RDOw5T(F8oM+2wG0J-+cMZF8y1=>5|wAzk_AA)X?an^soTlC{E|in^FEcFp6) z(D{$cJyMvjT588|{DfE~ybf(~(m|is;q*-|Xg&?Nm2jBi(+Tb-&Icq;^Q&fqkvyUD!`Igi0ChLAz;Hd>5b)>~69TtR1)1 zWIsAf4w6H(r9MDg>Vt5IZ>j&Pxn~#;xgRC%!XT|ovVx@c> zopsf_g0f;5CK9YG84)99A{Ysrf-m4SoLR|8nJARR$ly!(iaIE*eRSnQNg419Yhc_( zhZMJL`7>kw7`xj}$E@z5c4q@O>K;cOm)qD_?D4el!}OF}4h8a5_$i-7%v`!4zmjj1 zGP8S6uMj$>&`)^B%vXUl{z~!l(E3iaHEYG##F#B@GC7MDXs!K;-e!w z|FoKp`-5w~ZpBM$H#$qEHm_5r{6cX9ML?{V$l<#R#CfX zi)gFpHPIWQZKCa>9ipA0_e7tGj);zlPKZ7iof4fEeJT1{bXgoBR*3V&!^97WpAv5p zza@TKyia^Ud`Ns)d{lf~d{X>h@fYGt;>+Tz;_KoY;$OwTi~o$k5vqvPh`td;5hEjJ zMl6naK4L?}3lWl&B?INxURca+@Ss z(pfT8GFEcGmF$-slzb*RA~_~G zAvqVxM8-uXMfQ&z73qka9l11eL*yHgpG1Bec|P*{$R8pvMP8PsNYkY0(ky8Y>D|&| z=^$yT)G8e%ohF?nT_Ig3-74K7-6P#A-6uUDJt6&CdNyisRAtoIsPR!#qGm@u9rb+F zmZ-O)&P9D6t&2{H?h>6DogLjXIw!hMbie3<(Z$h&qD!L(M-Pdf6}>U~ge*#yAsZyC zl#P&$lG$W6vO3u$*(}*?*+a5VDD!iU>|1}vrE{e>@xN__6_z!b{D&c-OKK053*<3E9^D) z2Ky`fhaAbJ@@P3LSIAZJPVyvqSNR?CZt@Iymb`~NUtS`wl2^;`lh?@Wk{CEHmLHXWEyL-DKP zcg3Gdl~SYBDfP+(rAgUEdAqWkGELb_*<0CHnWr42tW=Irj#Q3TPE<}-PE}4<&Qw06 zoTq$Dxj?y8xl{R}@{;lwRiY|IHAppDHBQx}YF4>bEvktsP~ESZt9n@Vh-#_o8P#%C ztEyeKR<&NWQT2*yr|Lb`F4f1XPgDm~hg64Er&JeI7gd*4S5?2hVF6QGrBdpb-Hc3?YbSh zox1mQALu^P?bhwl?bV&ueX09ecUJeU?!4}M-4D7;y36rV@m=C`> z8^169K>V@z6Y-zNpNjt`{#^Wb@fY-JeSdw4zDz$vZ_!uiEA^bdLGRFy(@)Y*(a+J( z)jzC%ME{t6f&Ll&v-;=tEA(ypmHO@a{rcnjlloKo)B2zESM=BPKkI)nFb3A3FlY_& z27@8daGN37(92L@C^8H(lo|#btcD6hrGYav7#xOi2Crd);Y-7hhMx>q4A%^QCg6nH zgysZy!qkN62{RLBCCpBEG+}SDUxbf>Ar)MQ#{dfK$i^sH%>X^m;E>1ES))BC26O=nC$m@b*Fn68;_n0_@&&B^8r zbCx;B+{fI{oNLZE7n-Zgy{=mG;eAs-{eB6A} z{H^)C`J(y9#9@gwiFJt$iH^jN6OSeyPy9UbRHu?oqdV1ha`=V;h!EkEnJ#<={&pJo Ee-@_#ZU6uP literal 0 HcmV?d00001 diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.mode1v3 b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.mode1v3 new file mode 100644 index 000000000..c5723261d --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.mode1v3 @@ -0,0 +1,1372 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Xcode3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 91857D9F148EF61800AAA11B + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 089C1671FE841209C02AAC07 + 19C28FB4FE9D528D11CA2CBB + 089C167CFE841241C02AAC07 + 08FB77ADFE841716C02AAC07 + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 11 + 10 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 693}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 711}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + Gain.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + Gain.cpp + _historyCapacity + 0 + bookmark + 911C2A9D1491A5F600A430AF + history + + 915DCCBB1491A5B8008574E6 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1053, 508}} + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + PBXNavigatorGroup + Proportion + 508pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 513}, {1053, 198}} + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + XCDetailModule + Proportion + 198pt + + + Proportion + 1053pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 911C2A901491A5F600A430AF + 1CE0B1FE06471DED0097A5F4 + 911C2A911491A5F600A430AF + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Xcode3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 91857DA0148EF61800AAA11B + /Users/spiadmin/Documents/Gain/Gain.xcodeproj + + WindowString + 286 197 1261 752 0 0 1680 1028 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {743, 413}} + RubberWindowFrame + 112 208 743 695 0 0 1680 1028 + + Module + PBXNavigatorGroup + Proportion + 413pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 418}, {743, 236}} + RubberWindowFrame + 112 208 743 695 0 0 1680 1028 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 654pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 91857DA0148EF61800AAA11B + 911C2A921491A5F600A430AF + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 112 208 743 695 0 0 1680 1028 + WindowToolGUID + 91857DA0148EF61800AAA11B + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.pbxuser b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.pbxuser new file mode 100644 index 000000000..df947808e --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/spiadmin.pbxuser @@ -0,0 +1,143 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Gain */; + codeSenseManager = 91857D95148EF55400AAA11B /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 829, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 789, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 345089498; + PBXWorkspaceStateSaveDate = 345089498; + }; + perUserProjectItems = { + 911C2A9D1491A5F600A430AF /* PBXTextBookmark */ = 911C2A9D1491A5F600A430AF /* PBXTextBookmark */; + 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */ = 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */; + }; + sourceControlManager = 91857D94148EF55400AAA11B /* Source Control */; + userBuildSettings = { + }; + }; + 2407DEB6089929BA00EB68BF /* Gain.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 1768}}"; + sepNavSelRange = "{247, 0}"; + sepNavVisRange = "{0, 1657}"; + }; + }; + 245463B80991757100464AD3 /* Gain.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 975}}"; + sepNavSelRange = "{1552, 0}"; + sepNavVisRange = "{796, 1857}"; + sepNavWindowFrame = "{{15, 465}, {750, 558}}"; + }; + }; + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 488}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 798}"; + }; + }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {859, 19825}}"; + sepNavSelRange = "{10641, 0}"; + sepNavVisRange = "{10076, 1095}"; + }; + }; + 24D8286F09A914000093AEF8 /* GainProc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 482}}"; + sepNavSelRange = "{239, 0}"; + sepNavVisRange = "{0, 950}"; + }; + }; + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 493}}"; + sepNavSelRange = "{249, 0}"; + sepNavVisRange = "{0, 249}"; + }; + }; + 8D01CCC60486CAD60068D4B7 /* Gain */ = { + activeExec = 0; + }; + 911C2A9D1491A5F600A430AF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2407DEB6089929BA00EB68BF /* Gain.cpp */; + name = "Gain.cpp: 10"; + rLen = 0; + rLoc = 247; + rType = 0; + vrLen = 1657; + vrLoc = 0; + }; + 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2407DEB6089929BA00EB68BF /* Gain.cpp */; + name = "Gain.cpp: 10"; + rLen = 0; + rLoc = 247; + rType = 0; + vrLen = 1625; + vrLoc = 0; + }; + 91857D94148EF55400AAA11B /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 91857D95148EF55400AAA11B /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme new file mode 100644 index 000000000..8ee693f95 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..5bccbcb4f --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Gain.xcscheme + + orderHint + 8 + + + SuppressBuildableAutocreation + + 8D01CCC60486CAD60068D4B7 + + primary + + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..a7bdd62d4 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + «PROJECTNAME».xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D01CCC60486CAD60068D4B7 + + primary + + + + + diff --git a/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme new file mode 100644 index 000000000..0df2de4a3 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/Cabs.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/MacSignedVST/Cabs/mac/Info.plist b/plugins/MacSignedVST/Cabs/mac/Info.plist new file mode 100755 index 000000000..b09234308 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/mac/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Cabs + CFBundleIconFile + + CFBundleIdentifier + com.airwindows.Cabs + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + Dthr + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/plugins/MacSignedVST/Cabs/mac/PkgInfo b/plugins/MacSignedVST/Cabs/mac/PkgInfo new file mode 100755 index 000000000..19a9cf67e --- /dev/null +++ b/plugins/MacSignedVST/Cabs/mac/PkgInfo @@ -0,0 +1 @@ +BNDL???? \ No newline at end of file diff --git a/plugins/MacSignedVST/Cabs/mac/xcode_vst_prefix.h b/plugins/MacSignedVST/Cabs/mac/xcode_vst_prefix.h new file mode 100755 index 000000000..eaf4c0b4b --- /dev/null +++ b/plugins/MacSignedVST/Cabs/mac/xcode_vst_prefix.h @@ -0,0 +1,17 @@ +#define MAC 1 +#define MACX 1 + +#define USE_NAMESPACE 0 + +#define TARGET_API_MAC_CARBON 1 +#define USENAVSERVICES 1 + +#define __CF_USE_FRAMEWORK_INCLUDES__ + +#if __MWERKS__ +#define __NOEXTENSIONS__ +#endif + +#define QUARTZ 1 + +#include \ No newline at end of file diff --git a/plugins/MacSignedVST/Cabs/source/Cabs.cpp b/plugins/MacSignedVST/Cabs/source/Cabs.cpp new file mode 100755 index 000000000..dcb9a3c5f --- /dev/null +++ b/plugins/MacSignedVST/Cabs/source/Cabs.cpp @@ -0,0 +1,208 @@ +/* ======================================== + * Cabs - Cabs.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Cabs_H +#include "Cabs.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Cabs(audioMaster);} + +Cabs::Cabs(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.66; + C = 0.33; + D = 0.66; + E = 0.33; + F = 0.5; + + ataLast3SampleL = ataLast2SampleL = ataLast1SampleL = 0.0; //begin L + ataHalfwaySampleL = ataHalfDrySampleL = ataHalfDiffSampleL = 0.0; + ataAL = ataBL = ataCL = ataDrySampleL = ataDiffSampleL = ataPrevDiffSampleL = 0.0; + + for(int count = 0; count < 90; count++) {bL[count] = 0;} + lastSampleL = 0.0; + lastHalfSampleL = 0.0; + lastPostSampleL = 0.0; + lastPostHalfSampleL = 0.0; + postPostSampleL = 0.0; + for(int count = 0; count < 20; count++) {dL[count] = 0;} + controlL = 0; + iirHeadBumpAL = 0.0; + iirHeadBumpBL = 0.0; + iirHalfHeadBumpAL = 0.0; + iirHalfHeadBumpBL = 0.0; + for(int count = 0; count < 6; count++) lastRefL[count] = 0.0; //end L + + ataLast3SampleR = ataLast2SampleR = ataLast1SampleR = 0.0; //begin R + ataHalfwaySampleR = ataHalfDrySampleR = ataHalfDiffSampleR = 0.0; + ataAR = ataBR = ataCR = ataDrySampleR = ataDiffSampleR = ataPrevDiffSampleR = 0.0; + + for(int count = 0; count < 90; count++) {bR[count] = 0;} + lastSampleR = 0.0; + lastHalfSampleR = 0.0; + lastPostSampleR = 0.0; + lastPostHalfSampleR = 0.0; + postPostSampleR = 0.0; + for(int count = 0; count < 20; count++) {dR[count] = 0;} + controlR = 0; + iirHeadBumpAR = 0.0; + iirHeadBumpBR = 0.0; + iirHalfHeadBumpAR = 0.0; + iirHalfHeadBumpBR = 0.0; + for(int count = 0; count < 6; count++) lastRefR[count] = 0.0; //end R + + flip = false; + ataFlip = false; + gcount = 0; + cycle = 0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + //this is reset: values being initialized only once. Startup values, whatever they are. + + _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. + _canDo.insert("plugAsSend"); // plug-in can be used as a send effect. + _canDo.insert("x2in2out"); + setNumInputs(kNumInputs); + setNumOutputs(kNumOutputs); + setUniqueID(kUniqueId); + canProcessReplacing(); // supports output replacing + canDoubleReplacing(); // supports double precision processing + programsAreChunks(true); + vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name +} + +Cabs::~Cabs() {} +VstInt32 Cabs::getVendorVersion () {return 1000;} +void Cabs::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Cabs::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);} +//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than +//trying to do versioning and preventing people from using older versions. Maybe they like the old one! + +static float pinParameter(float data) +{ + if (data < 0.0f) return 0.0f; + if (data > 1.0f) return 1.0f; + return data; +} + +VstInt32 Cabs::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* Note: The way this is set up, it will break if you manage to save settings on an Intel + machine and load them on a PPC Mac. However, it's fine if you stick to the machine you + started with. */ + + *data = chunkData; + return kNumParameters * sizeof(float); +} + +VstInt32 Cabs::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* We're ignoring byteSize as we found it to be a filthy liar */ + + /* calculate any other fields you need here - you could copy in + code from setParameter() here. */ + return 0; +} + +void Cabs::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Cabs::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; break; + default: break; // unknown parameter, shouldn't happen! + } return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void Cabs::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "CabType", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Intense", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Rm Loud", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "CabSize", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "OffAxis", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Cabs::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: switch((VstInt32)( A * 5.999 )) //0 to almost edge of # of params + { case 0: vst_strncpy (text, "HPStack", kVstMaxParamStrLen); break; + case 1: vst_strncpy (text, "Vintage", kVstMaxParamStrLen); break; + case 2: vst_strncpy (text, "Boutiqe", kVstMaxParamStrLen); break; + case 3: vst_strncpy (text, "Large C", kVstMaxParamStrLen); break; + case 4: vst_strncpy (text, "Small C", kVstMaxParamStrLen); break; + case 5: vst_strncpy (text, "BassAmp", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } break; //E as example 'popup' parameter with four values */ + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Cabs::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Cabs::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Cabs::getEffectName(char* name) { + vst_strncpy(name, "Cabs", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Cabs::getPlugCategory() {return kPlugCategEffect;} + +bool Cabs::getProductString(char* text) { + vst_strncpy (text, "airwindows Cabs", kVstMaxProductStrLen); return true; +} + +bool Cabs::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/MacSignedVST/Cabs/source/Cabs.h b/plugins/MacSignedVST/Cabs/source/Cabs.h new file mode 100755 index 000000000..dd0bfcac3 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/source/Cabs.h @@ -0,0 +1,129 @@ +/* ======================================== + * Cabs - Cabs.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Cabs_H +#define __Cabs_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include +#include +#include + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'kabz'; //Change this to what the AU identity is! + +class Cabs : + public AudioEffectX +{ +public: + Cabs(audioMasterCallback audioMaster); + ~Cabs(); + virtual bool getEffectName(char* name); // The plug-in name + virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in + virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + virtual void getProgramName(char *name); // read the name from the host + virtual void setProgramName(char *name); // changes the name of the preset displayed in the host + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + virtual float getParameter(VstInt32 index); // get the parameter value at the specified index + virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value + virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) + virtual void getParameterName(VstInt32 index, char *text); // name of the parameter + virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + double ataLast3SampleL; //begin L + double ataLast2SampleL; + double ataLast1SampleL; + double ataHalfwaySampleL; + double ataHalfDrySampleL; + double ataHalfDiffSampleL; + double ataAL; + double ataBL; + double ataCL; + double ataDrySampleL; + double ataDiffSampleL; + double ataPrevDiffSampleL; + double bL[90]; + double lastSampleL; + double lastHalfSampleL; + double lastPostSampleL; + double lastPostHalfSampleL; + double postPostSampleL; + double dL[21]; + double controlL; + double iirHeadBumpAL; + double iirHeadBumpBL; + double iirHalfHeadBumpAL; + double iirHalfHeadBumpBL; + double lastRefL[7]; //end L + + double ataLast3SampleR; //begin R + double ataLast2SampleR; + double ataLast1SampleR; + double ataHalfwaySampleR; + double ataHalfDrySampleR; + double ataHalfDiffSampleR; + double ataAR; + double ataBR; + double ataCR; + double ataDrySampleR; + double ataDiffSampleR; + double ataPrevDiffSampleR; + double bR[90]; + double lastSampleR; + double lastHalfSampleR; + double lastPostSampleR; + double lastPostHalfSampleR; + double postPostSampleR; + double dR[21]; + double controlR; + double iirHeadBumpAR; + double iirHeadBumpBR; + double iirHalfHeadBumpAR; + double iirHalfHeadBumpBR; + double lastRefR[7]; //end R + + bool flip; + bool ataFlip; //end defining of antialiasing variables + int gcount; + int cycle; + + uint32_t fpdL; + uint32_t fpdR; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; +}; + +#endif diff --git a/plugins/MacSignedVST/Cabs/source/CabsProc.cpp b/plugins/MacSignedVST/Cabs/source/CabsProc.cpp new file mode 100755 index 000000000..76f875f56 --- /dev/null +++ b/plugins/MacSignedVST/Cabs/source/CabsProc.cpp @@ -0,0 +1,2786 @@ +/* ======================================== + * Cabs - Cabs.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Cabs_H +#include "Cabs.h" +#endif + +void Cabs::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + int cycleEnd = floor(overallscale); + if (cycleEnd < 1) cycleEnd = 1; + if (cycleEnd > 4) cycleEnd = 4; + //this is going to be 2 for 88.1 or 96k, 3 for silly people, 4 for 176 or 192k + if (cycle > cycleEnd-1) cycle = cycleEnd-1; //sanity check + + int speaker = (int)(floor( A * 5.999 )+1); + double colorIntensity = pow(B,4); + double correctboost = 1.0 + (colorIntensity*4); + double correctdrygain = 1.0 - colorIntensity; + double threshold = pow((1.0-C),5)+0.021; //room loud is slew + double rarefaction = cbrt(threshold); + double postThreshold = sqrt(rarefaction); + double postRarefaction = cbrt(postThreshold); + double postTrim = sqrt(postRarefaction); + double HeadBumpFreq = 0.0298+((1.0-D)/8.0); + double LowsPad = 0.12 + (HeadBumpFreq*12.0); + double dcblock = pow(HeadBumpFreq,2) / 8.0; + double heavy = pow(E,3); //wet of head bump + double output = pow(F,2); + double dynamicconv = 5.0; + dynamicconv *= pow(B,2); + dynamicconv *= pow(C,2); + //set constants for sag speed + int offsetA = 4+((int)(D*5.0)); + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + + cycle++; + if (cycle == cycleEnd) { //hit the end point and we do a chorus sample + //everything in here is undersampled, including the dry/wet + + double ataDrySampleL = inputSampleL; + double ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * 0.05)) / 2.0; + double ataHalfDrySampleL = ataHalfwaySampleL; + ataLast3SampleL = ataLast2SampleL; ataLast2SampleL = ataLast1SampleL; ataLast1SampleL = inputSampleL; //----------------- + double ataDrySampleR = inputSampleR; + double ataHalfwaySampleR = (inputSampleR + ataLast1SampleR + ((-ataLast2SampleR + ataLast3SampleR) * 0.05)) / 2.0; + double ataHalfDrySampleR = ataHalfwaySampleR; + ataLast3SampleR = ataLast2SampleR; ataLast2SampleR = ataLast1SampleR; ataLast1SampleR = inputSampleR; + //setting up oversampled special antialiasing + //pre-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double clamp = inputSampleL - lastSampleL; + if (clamp > threshold) inputSampleL = lastSampleL + threshold; + if (-clamp > rarefaction) inputSampleL = lastSampleL - rarefaction; + lastSampleL = inputSampleL; //---------------------------------------------- + clamp = inputSampleR - lastSampleR; + if (clamp > threshold) inputSampleR = lastSampleR + threshold; + if (-clamp > rarefaction) inputSampleR = lastSampleR - rarefaction; + lastSampleR = inputSampleR; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySampleL - lastHalfSampleL; + if (clamp > threshold) ataHalfwaySampleL = lastHalfSampleL + threshold; + if (-clamp > rarefaction) ataHalfwaySampleL = lastHalfSampleL - rarefaction; + lastHalfSampleL = ataHalfwaySampleL; //------------------------------------------- + clamp = ataHalfwaySampleR - lastHalfSampleR; + if (clamp > threshold) ataHalfwaySampleR = lastHalfSampleR + threshold; + if (-clamp > rarefaction) ataHalfwaySampleR = lastHalfSampleR - rarefaction; + lastHalfSampleR = ataHalfwaySampleR; + //end interpolated sample + + //begin center code handling conv stuff tied to 44.1K, or stuff in time domain like delays + ataHalfwaySampleL -= inputSampleL; + ataHalfwaySampleR -= inputSampleR; + //retain only difference with raw signal + + if (gcount < 0 || gcount > 10) gcount = 10; + + dL[gcount+10] = dL[gcount] = fabs(inputSampleL); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.0001; + if (controlL < 0) controlL = 0; + if (controlL > 13) controlL = 13; //------------------------- + dR[gcount+10] = dR[gcount] = fabs(inputSampleR); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.0001; + if (controlR < 0) controlR = 0; + if (controlR > 13) controlR = 13; + + gcount--; + + double applyconvL = (controlL / offsetA) * dynamicconv; + double applyconvR = (controlR / offsetA) * dynamicconv; + //now we have a 'sag' style average to apply to the conv + bL[82] = bL[81]; bL[81] = bL[80]; bL[80] = bL[79]; + bL[79] = bL[78]; bL[78] = bL[77]; bL[77] = bL[76]; bL[76] = bL[75]; bL[75] = bL[74]; bL[74] = bL[73]; bL[73] = bL[72]; bL[72] = bL[71]; + bL[71] = bL[70]; bL[70] = bL[69]; bL[69] = bL[68]; bL[68] = bL[67]; bL[67] = bL[66]; bL[66] = bL[65]; bL[65] = bL[64]; bL[64] = bL[63]; + bL[63] = bL[62]; bL[62] = bL[61]; bL[61] = bL[60]; bL[60] = bL[59]; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; + bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; + bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; + bL[39] = bL[38]; bL[38] = bL[37]; bL[37] = bL[36]; bL[36] = bL[35]; bL[35] = bL[34]; bL[34] = bL[33]; bL[33] = bL[32]; bL[32] = bL[31]; + bL[31] = bL[30]; bL[30] = bL[29]; bL[29] = bL[28]; bL[28] = bL[27]; bL[27] = bL[26]; bL[26] = bL[25]; bL[25] = bL[24]; bL[24] = bL[23]; + bL[23] = bL[22]; bL[22] = bL[21]; bL[21] = bL[20]; bL[20] = bL[19]; bL[19] = bL[18]; bL[18] = bL[17]; bL[17] = bL[16]; bL[16] = bL[15]; + bL[15] = bL[14]; bL[14] = bL[13]; bL[13] = bL[12]; bL[12] = bL[11]; bL[11] = bL[10]; bL[10] = bL[9]; bL[9] = bL[8]; bL[8] = bL[7]; + bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; bL[1] = bL[0]; bL[0] = inputSampleL; //------- + bR[82] = bR[81]; bR[81] = bR[80]; bR[80] = bR[79]; + bR[79] = bR[78]; bR[78] = bR[77]; bR[77] = bR[76]; bR[76] = bR[75]; bR[75] = bR[74]; bR[74] = bR[73]; bR[73] = bR[72]; bR[72] = bR[71]; + bR[71] = bR[70]; bR[70] = bR[69]; bR[69] = bR[68]; bR[68] = bR[67]; bR[67] = bR[66]; bR[66] = bR[65]; bR[65] = bR[64]; bR[64] = bR[63]; + bR[63] = bR[62]; bR[62] = bR[61]; bR[61] = bR[60]; bR[60] = bR[59]; bR[59] = bR[58]; bR[58] = bR[57]; bR[57] = bR[56]; bR[56] = bR[55]; + bR[55] = bR[54]; bR[54] = bR[53]; bR[53] = bR[52]; bR[52] = bR[51]; bR[51] = bR[50]; bR[50] = bR[49]; bR[49] = bR[48]; bR[48] = bR[47]; + bR[47] = bR[46]; bR[46] = bR[45]; bR[45] = bR[44]; bR[44] = bR[43]; bR[43] = bR[42]; bR[42] = bR[41]; bR[41] = bR[40]; bR[40] = bR[39]; + bR[39] = bR[38]; bR[38] = bR[37]; bR[37] = bR[36]; bR[36] = bR[35]; bR[35] = bR[34]; bR[34] = bR[33]; bR[33] = bR[32]; bR[32] = bR[31]; + bR[31] = bR[30]; bR[30] = bR[29]; bR[29] = bR[28]; bR[28] = bR[27]; bR[27] = bR[26]; bR[26] = bR[25]; bR[25] = bR[24]; bR[24] = bR[23]; + bR[23] = bR[22]; bR[22] = bR[21]; bR[21] = bR[20]; bR[20] = bR[19]; bR[19] = bR[18]; bR[18] = bR[17]; bR[17] = bR[16]; bR[16] = bR[15]; + bR[15] = bR[14]; bR[14] = bR[13]; bR[13] = bR[12]; bR[12] = bR[11]; bR[11] = bR[10]; bR[10] = bR[9]; bR[9] = bR[8]; bR[8] = bR[7]; + bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; bR[1] = bR[0]; bR[0] = inputSampleR; + //load conv + + double tempSampleL = 0.0; //--------- + double tempSampleR = 0.0; //set up for applying the cab sound + switch (speaker) + { + case 1: + //begin HighPowerStack conv L + tempSampleL += (bL[1] * (1.29550481610475132 + (0.19713872057074355*applyconvL))); + tempSampleL += (bL[2] * (1.42302569895462616 + (0.30599505521284787*applyconvL))); + tempSampleL += (bL[3] * (1.28728195804197565 + (0.23168333460446133*applyconvL))); + tempSampleL += (bL[4] * (0.88553784290822690 + (0.14263256172918892*applyconvL))); + tempSampleL += (bL[5] * (0.37129054918432319 + (0.00150040944205920*applyconvL))); + tempSampleL -= (bL[6] * (0.12150959412556320 + (0.32776273620569107*applyconvL))); + tempSampleL -= (bL[7] * (0.44900065463203775 + (0.74101214925298819*applyconvL))); + tempSampleL -= (bL[8] * (0.54058781908186482 + (1.07821707459008387*applyconvL))); + tempSampleL -= (bL[9] * (0.49361966401791391 + (1.23540109014850508*applyconvL))); + tempSampleL -= (bL[10] * (0.39819495093078133 + (1.11247213730917749*applyconvL))); + tempSampleL -= (bL[11] * (0.31379279985435521 + (0.80330360359638298*applyconvL))); + tempSampleL -= (bL[12] * (0.30744359242808555 + (0.42132528876858205*applyconvL))); + tempSampleL -= (bL[13] * (0.33943170284673974 + (0.09183418349389982*applyconvL))); + tempSampleL -= (bL[14] * (0.33838775119286391 - (0.06453051658561271*applyconvL))); + tempSampleL -= (bL[15] * (0.30682305697961665 - (0.09549380253249232*applyconvL))); + tempSampleL -= (bL[16] * (0.23408741339295336 - (0.08083404732361277*applyconvL))); + tempSampleL -= (bL[17] * (0.10411746814025019 + (0.00253651281245780*applyconvL))); + tempSampleL += (bL[18] * (0.00133623776084696 - (0.04447267870865820*applyconvL))); + tempSampleL += (bL[19] * (0.02461903992114161 + (0.07530671732655550*applyconvL))); + tempSampleL += (bL[20] * (0.02086715842475373 + (0.22795860236804899*applyconvL))); + tempSampleL += (bL[21] * (0.02761433637100917 + (0.26108320417844094*applyconvL))); + tempSampleL += (bL[22] * (0.04475285369162533 + (0.19160705011061663*applyconvL))); + tempSampleL += (bL[23] * (0.09447338372862381 + (0.03681550508743799*applyconvL))); + tempSampleL += (bL[24] * (0.13445890343722280 - (0.13713036462146147*applyconvL))); + tempSampleL += (bL[25] * (0.13872868945088121 - (0.22401242373298191*applyconvL))); + tempSampleL += (bL[26] * (0.14915650097434549 - (0.26718804981526367*applyconvL))); + tempSampleL += (bL[27] * (0.12766643217091783 - (0.27745664795660430*applyconvL))); + tempSampleL += (bL[28] * (0.03675849788393101 - (0.18338278173550679*applyconvL))); + tempSampleL -= (bL[29] * (0.06307306864232835 + (0.06089480869040766*applyconvL))); + tempSampleL -= (bL[30] * (0.14947389348962944 + (0.04642103054798480*applyconvL))); + tempSampleL -= (bL[31] * (0.25235266566401526 + (0.08423062596460507*applyconvL))); + tempSampleL -= (bL[32] * (0.33496344048679683 + (0.09808328256677995*applyconvL))); + tempSampleL -= (bL[33] * (0.36590030482175445 + (0.10622650888958179*applyconvL))); + tempSampleL -= (bL[34] * (0.35015197011464372 + (0.08982043516016047*applyconvL))); + tempSampleL -= (bL[35] * (0.26808437585665090 + (0.00735561860229533*applyconvL))); + tempSampleL -= (bL[36] * (0.11624318543291220 - (0.07142484314510467*applyconvL))); + tempSampleL += (bL[37] * (0.05617084165377551 + (0.11785854050350089*applyconvL))); + tempSampleL += (bL[38] * (0.20540028692589385 + (0.20479174663329586*applyconvL))); + tempSampleL += (bL[39] * (0.30455415003043818 + (0.29074864580096849*applyconvL))); + tempSampleL += (bL[40] * (0.33810750937829476 + (0.29182307921316802*applyconvL))); + tempSampleL += (bL[41] * (0.31936133365277430 + (0.26535537727394987*applyconvL))); + tempSampleL += (bL[42] * (0.27388548321981876 + (0.19735049990538350*applyconvL))); + tempSampleL += (bL[43] * (0.21454597517994098 + (0.06415909270247236*applyconvL))); + tempSampleL += (bL[44] * (0.15001045817707717 - (0.03831118543404573*applyconvL))); + tempSampleL += (bL[45] * (0.07283437284653138 - (0.09281952429543777*applyconvL))); + tempSampleL -= (bL[46] * (0.03917872184241358 + (0.14306291461398810*applyconvL))); + tempSampleL -= (bL[47] * (0.16695932032148642 + (0.19138995946950504*applyconvL))); + tempSampleL -= (bL[48] * (0.27055854466909462 + (0.22531296466343192*applyconvL))); + tempSampleL -= (bL[49] * (0.33256357307578271 + (0.23305840475692102*applyconvL))); + tempSampleL -= (bL[50] * (0.33459770116834442 + (0.24091822618917569*applyconvL))); + tempSampleL -= (bL[51] * (0.27156687236338090 + (0.24062938573512443*applyconvL))); + tempSampleL -= (bL[52] * (0.17197093288412094 + (0.19083085091993421*applyconvL))); + tempSampleL -= (bL[53] * (0.06738628195910543 + (0.10268609751019808*applyconvL))); + tempSampleL += (bL[54] * (0.00222429218204290 + (0.01439664435720548*applyconvL))); + tempSampleL += (bL[55] * (0.01346992803494091 + (0.15947137113534526*applyconvL))); + tempSampleL -= (bL[56] * (0.02038911881377448 - (0.26763170752416160*applyconvL))); + tempSampleL -= (bL[57] * (0.08233579178189687 - (0.29415931086406055*applyconvL))); + tempSampleL -= (bL[58] * (0.15447855089824883 - (0.26489186990840807*applyconvL))); + tempSampleL -= (bL[59] * (0.20518281113362655 - (0.16135382257522859*applyconvL))); + tempSampleL -= (bL[60] * (0.22244686050232007 + (0.00847180390247432*applyconvL))); + tempSampleL -= (bL[61] * (0.21849243134998034 + (0.14460595245753741*applyconvL))); + tempSampleL -= (bL[62] * (0.20256105734574054 + (0.18932793221831667*applyconvL))); + tempSampleL -= (bL[63] * (0.18604070054295399 + (0.17250665610927965*applyconvL))); + tempSampleL -= (bL[64] * (0.17222844322058231 + (0.12992472027850357*applyconvL))); + tempSampleL -= (bL[65] * (0.14447856616566443 + (0.09089219002147308*applyconvL))); + tempSampleL -= (bL[66] * (0.10385520794251019 + (0.08600465834570559*applyconvL))); + tempSampleL -= (bL[67] * (0.07124435678265063 + (0.09071532210549428*applyconvL))); + tempSampleL -= (bL[68] * (0.05216857461197572 + (0.06794061706070262*applyconvL))); + tempSampleL -= (bL[69] * (0.05235381920184123 + (0.02818101717909346*applyconvL))); + tempSampleL -= (bL[70] * (0.07569701245553526 - (0.00634228544764946*applyconvL))); + tempSampleL -= (bL[71] * (0.10320125382718826 - (0.02751486906644141*applyconvL))); + tempSampleL -= (bL[72] * (0.12122120969079088 - (0.05434007312178933*applyconvL))); + tempSampleL -= (bL[73] * (0.13438969117200902 - (0.09135218559713874*applyconvL))); + tempSampleL -= (bL[74] * (0.13534390437529981 - (0.10437672041458675*applyconvL))); + tempSampleL -= (bL[75] * (0.11424128854188388 - (0.08693450726462598*applyconvL))); + tempSampleL -= (bL[76] * (0.08166894518596159 - (0.06949989431475120*applyconvL))); + tempSampleL -= (bL[77] * (0.04293976378555305 - (0.05718625137421843*applyconvL))); + tempSampleL += (bL[78] * (0.00933076320644409 + (0.01728285211520138*applyconvL))); + tempSampleL += (bL[79] * (0.06450430362918153 - (0.02492994833691022*applyconvL))); + tempSampleL += (bL[80] * (0.10187400687649277 - (0.03578455940532403*applyconvL))); + tempSampleL += (bL[81] * (0.11039763294094571 - (0.03995523517573508*applyconvL))); + tempSampleL += (bL[82] * (0.08557960776024547 - (0.03482514309492527*applyconvL))); + tempSampleL += (bL[83] * (0.02730881850805332 - (0.00514750108411127*applyconvL))); + //begin HighPowerStack conv R + tempSampleR += (bR[1] * (1.29550481610475132 + (0.19713872057074355*applyconvR))); + tempSampleR += (bR[2] * (1.42302569895462616 + (0.30599505521284787*applyconvR))); + tempSampleR += (bR[3] * (1.28728195804197565 + (0.23168333460446133*applyconvR))); + tempSampleR += (bR[4] * (0.88553784290822690 + (0.14263256172918892*applyconvR))); + tempSampleR += (bR[5] * (0.37129054918432319 + (0.00150040944205920*applyconvR))); + tempSampleR -= (bR[6] * (0.12150959412556320 + (0.32776273620569107*applyconvR))); + tempSampleR -= (bR[7] * (0.44900065463203775 + (0.74101214925298819*applyconvR))); + tempSampleR -= (bR[8] * (0.54058781908186482 + (1.07821707459008387*applyconvR))); + tempSampleR -= (bR[9] * (0.49361966401791391 + (1.23540109014850508*applyconvR))); + tempSampleR -= (bR[10] * (0.39819495093078133 + (1.11247213730917749*applyconvR))); + tempSampleR -= (bR[11] * (0.31379279985435521 + (0.80330360359638298*applyconvR))); + tempSampleR -= (bR[12] * (0.30744359242808555 + (0.42132528876858205*applyconvR))); + tempSampleR -= (bR[13] * (0.33943170284673974 + (0.09183418349389982*applyconvR))); + tempSampleR -= (bR[14] * (0.33838775119286391 - (0.06453051658561271*applyconvR))); + tempSampleR -= (bR[15] * (0.30682305697961665 - (0.09549380253249232*applyconvR))); + tempSampleR -= (bR[16] * (0.23408741339295336 - (0.08083404732361277*applyconvR))); + tempSampleR -= (bR[17] * (0.10411746814025019 + (0.00253651281245780*applyconvR))); + tempSampleR += (bR[18] * (0.00133623776084696 - (0.04447267870865820*applyconvR))); + tempSampleR += (bR[19] * (0.02461903992114161 + (0.07530671732655550*applyconvR))); + tempSampleR += (bR[20] * (0.02086715842475373 + (0.22795860236804899*applyconvR))); + tempSampleR += (bR[21] * (0.02761433637100917 + (0.26108320417844094*applyconvR))); + tempSampleR += (bR[22] * (0.04475285369162533 + (0.19160705011061663*applyconvR))); + tempSampleR += (bR[23] * (0.09447338372862381 + (0.03681550508743799*applyconvR))); + tempSampleR += (bR[24] * (0.13445890343722280 - (0.13713036462146147*applyconvR))); + tempSampleR += (bR[25] * (0.13872868945088121 - (0.22401242373298191*applyconvR))); + tempSampleR += (bR[26] * (0.14915650097434549 - (0.26718804981526367*applyconvR))); + tempSampleR += (bR[27] * (0.12766643217091783 - (0.27745664795660430*applyconvR))); + tempSampleR += (bR[28] * (0.03675849788393101 - (0.18338278173550679*applyconvR))); + tempSampleR -= (bR[29] * (0.06307306864232835 + (0.06089480869040766*applyconvR))); + tempSampleR -= (bR[30] * (0.14947389348962944 + (0.04642103054798480*applyconvR))); + tempSampleR -= (bR[31] * (0.25235266566401526 + (0.08423062596460507*applyconvR))); + tempSampleR -= (bR[32] * (0.33496344048679683 + (0.09808328256677995*applyconvR))); + tempSampleR -= (bR[33] * (0.36590030482175445 + (0.10622650888958179*applyconvR))); + tempSampleR -= (bR[34] * (0.35015197011464372 + (0.08982043516016047*applyconvR))); + tempSampleR -= (bR[35] * (0.26808437585665090 + (0.00735561860229533*applyconvR))); + tempSampleR -= (bR[36] * (0.11624318543291220 - (0.07142484314510467*applyconvR))); + tempSampleR += (bR[37] * (0.05617084165377551 + (0.11785854050350089*applyconvR))); + tempSampleR += (bR[38] * (0.20540028692589385 + (0.20479174663329586*applyconvR))); + tempSampleR += (bR[39] * (0.30455415003043818 + (0.29074864580096849*applyconvR))); + tempSampleR += (bR[40] * (0.33810750937829476 + (0.29182307921316802*applyconvR))); + tempSampleR += (bR[41] * (0.31936133365277430 + (0.26535537727394987*applyconvR))); + tempSampleR += (bR[42] * (0.27388548321981876 + (0.19735049990538350*applyconvR))); + tempSampleR += (bR[43] * (0.21454597517994098 + (0.06415909270247236*applyconvR))); + tempSampleR += (bR[44] * (0.15001045817707717 - (0.03831118543404573*applyconvR))); + tempSampleR += (bR[45] * (0.07283437284653138 - (0.09281952429543777*applyconvR))); + tempSampleR -= (bR[46] * (0.03917872184241358 + (0.14306291461398810*applyconvR))); + tempSampleR -= (bR[47] * (0.16695932032148642 + (0.19138995946950504*applyconvR))); + tempSampleR -= (bR[48] * (0.27055854466909462 + (0.22531296466343192*applyconvR))); + tempSampleR -= (bR[49] * (0.33256357307578271 + (0.23305840475692102*applyconvR))); + tempSampleR -= (bR[50] * (0.33459770116834442 + (0.24091822618917569*applyconvR))); + tempSampleR -= (bR[51] * (0.27156687236338090 + (0.24062938573512443*applyconvR))); + tempSampleR -= (bR[52] * (0.17197093288412094 + (0.19083085091993421*applyconvR))); + tempSampleR -= (bR[53] * (0.06738628195910543 + (0.10268609751019808*applyconvR))); + tempSampleR += (bR[54] * (0.00222429218204290 + (0.01439664435720548*applyconvR))); + tempSampleR += (bR[55] * (0.01346992803494091 + (0.15947137113534526*applyconvR))); + tempSampleR -= (bR[56] * (0.02038911881377448 - (0.26763170752416160*applyconvR))); + tempSampleR -= (bR[57] * (0.08233579178189687 - (0.29415931086406055*applyconvR))); + tempSampleR -= (bR[58] * (0.15447855089824883 - (0.26489186990840807*applyconvR))); + tempSampleR -= (bR[59] * (0.20518281113362655 - (0.16135382257522859*applyconvR))); + tempSampleR -= (bR[60] * (0.22244686050232007 + (0.00847180390247432*applyconvR))); + tempSampleR -= (bR[61] * (0.21849243134998034 + (0.14460595245753741*applyconvR))); + tempSampleR -= (bR[62] * (0.20256105734574054 + (0.18932793221831667*applyconvR))); + tempSampleR -= (bR[63] * (0.18604070054295399 + (0.17250665610927965*applyconvR))); + tempSampleR -= (bR[64] * (0.17222844322058231 + (0.12992472027850357*applyconvR))); + tempSampleR -= (bR[65] * (0.14447856616566443 + (0.09089219002147308*applyconvR))); + tempSampleR -= (bR[66] * (0.10385520794251019 + (0.08600465834570559*applyconvR))); + tempSampleR -= (bR[67] * (0.07124435678265063 + (0.09071532210549428*applyconvR))); + tempSampleR -= (bR[68] * (0.05216857461197572 + (0.06794061706070262*applyconvR))); + tempSampleR -= (bR[69] * (0.05235381920184123 + (0.02818101717909346*applyconvR))); + tempSampleR -= (bR[70] * (0.07569701245553526 - (0.00634228544764946*applyconvR))); + tempSampleR -= (bR[71] * (0.10320125382718826 - (0.02751486906644141*applyconvR))); + tempSampleR -= (bR[72] * (0.12122120969079088 - (0.05434007312178933*applyconvR))); + tempSampleR -= (bR[73] * (0.13438969117200902 - (0.09135218559713874*applyconvR))); + tempSampleR -= (bR[74] * (0.13534390437529981 - (0.10437672041458675*applyconvR))); + tempSampleR -= (bR[75] * (0.11424128854188388 - (0.08693450726462598*applyconvR))); + tempSampleR -= (bR[76] * (0.08166894518596159 - (0.06949989431475120*applyconvR))); + tempSampleR -= (bR[77] * (0.04293976378555305 - (0.05718625137421843*applyconvR))); + tempSampleR += (bR[78] * (0.00933076320644409 + (0.01728285211520138*applyconvR))); + tempSampleR += (bR[79] * (0.06450430362918153 - (0.02492994833691022*applyconvR))); + tempSampleR += (bR[80] * (0.10187400687649277 - (0.03578455940532403*applyconvR))); + tempSampleR += (bR[81] * (0.11039763294094571 - (0.03995523517573508*applyconvR))); + tempSampleR += (bR[82] * (0.08557960776024547 - (0.03482514309492527*applyconvR))); + tempSampleR += (bR[83] * (0.02730881850805332 - (0.00514750108411127*applyconvR))); + //end HighPowerStack conv + break; + case 2: + //begin VintageStack conv L + tempSampleL += (bL[1] * (1.31698250313308396 - (0.08140616497621633*applyconvL))); + tempSampleL += (bL[2] * (1.47229016949915326 - (0.27680278993637253*applyconvL))); + tempSampleL += (bL[3] * (1.30410109086044956 - (0.35629113432046489*applyconvL))); + tempSampleL += (bL[4] * (0.81766210474551260 - (0.26808782337659753*applyconvL))); + tempSampleL += (bL[5] * (0.19868872545506663 - (0.11105517193919669*applyconvL))); + tempSampleL -= (bL[6] * (0.39115909132567039 - (0.12630622002682679*applyconvL))); + tempSampleL -= (bL[7] * (0.76881891559343574 - (0.40879849500403143*applyconvL))); + tempSampleL -= (bL[8] * (0.87146861782680340 - (0.59529560488000599*applyconvL))); + tempSampleL -= (bL[9] * (0.79504575932563670 - (0.60877047551611796*applyconvL))); + tempSampleL -= (bL[10] * (0.61653017622406314 - (0.47662851438557335*applyconvL))); + tempSampleL -= (bL[11] * (0.40718195794382067 - (0.24955839378539713*applyconvL))); + tempSampleL -= (bL[12] * (0.31794900040616203 - (0.04169792259600613*applyconvL))); + tempSampleL -= (bL[13] * (0.41075032540217843 + (0.00368483996076280*applyconvL))); + tempSampleL -= (bL[14] * (0.56901352922170667 - (0.11027360805893105*applyconvL))); + tempSampleL -= (bL[15] * (0.62443222391889264 - (0.22198075154245228*applyconvL))); + tempSampleL -= (bL[16] * (0.53462856723129204 - (0.22933544545324852*applyconvL))); + tempSampleL -= (bL[17] * (0.34441703361995046 - (0.12956809502269492*applyconvL))); + tempSampleL -= (bL[18] * (0.13947052337867882 + (0.00339775055962799*applyconvL))); + tempSampleL += (bL[19] * (0.03771252648928484 - (0.10863931549251718*applyconvL))); + tempSampleL += (bL[20] * (0.18280210770271693 - (0.17413646599296417*applyconvL))); + tempSampleL += (bL[21] * (0.24621986701761467 - (0.14547053270435095*applyconvL))); + tempSampleL += (bL[22] * (0.22347075142737360 - (0.02493869490104031*applyconvL))); + tempSampleL += (bL[23] * (0.14346348482123716 + (0.11284054747963246*applyconvL))); + tempSampleL += (bL[24] * (0.00834364862916028 + (0.24284684053733926*applyconvL))); + tempSampleL -= (bL[25] * (0.11559740296078347 - (0.32623054435304538*applyconvL))); + tempSampleL -= (bL[26] * (0.18067604561283060 - (0.32311481551122478*applyconvL))); + tempSampleL -= (bL[27] * (0.22927997789035612 - (0.26991539052832925*applyconvL))); + tempSampleL -= (bL[28] * (0.28487666578669446 - (0.22437227250279349*applyconvL))); + tempSampleL -= (bL[29] * (0.31992973037153838 - (0.15289876100963865*applyconvL))); + tempSampleL -= (bL[30] * (0.35174606303520733 - (0.05656293023086628*applyconvL))); + tempSampleL -= (bL[31] * (0.36894898011375254 + (0.04333925421463558*applyconvL))); + tempSampleL -= (bL[32] * (0.32567576055307507 + (0.14594589410921388*applyconvL))); + tempSampleL -= (bL[33] * (0.27440135050585784 + (0.15529667398122521*applyconvL))); + tempSampleL -= (bL[34] * (0.21998973785078091 + (0.05083553737157104*applyconvL))); + tempSampleL -= (bL[35] * (0.10323624876862457 - (0.04651829594199963*applyconvL))); + tempSampleL += (bL[36] * (0.02091603687851074 + (0.12000046818439322*applyconvL))); + tempSampleL += (bL[37] * (0.11344930914138468 + (0.17697142512225839*applyconvL))); + tempSampleL += (bL[38] * (0.22766779627643968 + (0.13645102964003858*applyconvL))); + tempSampleL += (bL[39] * (0.38378309953638229 - (0.01997653307333791*applyconvL))); + tempSampleL += (bL[40] * (0.52789400804568076 - (0.21409137428422448*applyconvL))); + tempSampleL += (bL[41] * (0.55444630296938280 - (0.32331980931576626*applyconvL))); + tempSampleL += (bL[42] * (0.42333237669264601 - (0.26855847463044280*applyconvL))); + tempSampleL += (bL[43] * (0.21942831522035078 - (0.12051365248820624*applyconvL))); + tempSampleL -= (bL[44] * (0.00584169427830633 - (0.03706970171280329*applyconvL))); + tempSampleL -= (bL[45] * (0.24279799124660351 - (0.17296440491477982*applyconvL))); + tempSampleL -= (bL[46] * (0.40173760787507085 - (0.21717989835163351*applyconvL))); + tempSampleL -= (bL[47] * (0.43930035724188155 - (0.16425928481378199*applyconvL))); + tempSampleL -= (bL[48] * (0.41067765934041811 - (0.10390115786636855*applyconvL))); + tempSampleL -= (bL[49] * (0.34409235547165967 - (0.07268159377411920*applyconvL))); + tempSampleL -= (bL[50] * (0.26542883122568151 - (0.05483457497365785*applyconvL))); + tempSampleL -= (bL[51] * (0.22024754776138800 - (0.06484897950087598*applyconvL))); + tempSampleL -= (bL[52] * (0.20394367993632415 - (0.08746309731952180*applyconvL))); + tempSampleL -= (bL[53] * (0.17565242431124092 - (0.07611309538078760*applyconvL))); + tempSampleL -= (bL[54] * (0.10116623231246825 - (0.00642818706295112*applyconvL))); + tempSampleL -= (bL[55] * (0.00782648272053632 + (0.08004141267685004*applyconvL))); + tempSampleL += (bL[56] * (0.05059046006747323 - (0.12436676387548490*applyconvL))); + tempSampleL += (bL[57] * (0.06241531553254467 - (0.11530779547021434*applyconvL))); + tempSampleL += (bL[58] * (0.04952694587101836 - (0.08340945324333944*applyconvL))); + tempSampleL += (bL[59] * (0.00843873294401687 - (0.03279659052562903*applyconvL))); + tempSampleL -= (bL[60] * (0.05161338949440241 - (0.03428181149163798*applyconvL))); + tempSampleL -= (bL[61] * (0.08165520146902012 - (0.08196746092283110*applyconvL))); + tempSampleL -= (bL[62] * (0.06639532849935320 - (0.09797462781896329*applyconvL))); + tempSampleL -= (bL[63] * (0.02953430910661621 - (0.09175612938515763*applyconvL))); + tempSampleL += (bL[64] * (0.00741058547442938 + (0.05442091048731967*applyconvL))); + tempSampleL += (bL[65] * (0.01832866125391727 + (0.00306243693643687*applyconvL))); + tempSampleL += (bL[66] * (0.00526964230373573 - (0.04364102661136410*applyconvL))); + tempSampleL -= (bL[67] * (0.00300984373848200 + (0.09742737841278880*applyconvL))); + tempSampleL -= (bL[68] * (0.00413616769576694 + (0.14380661694523073*applyconvL))); + tempSampleL -= (bL[69] * (0.00588769034931419 + (0.16012843578892538*applyconvL))); + tempSampleL -= (bL[70] * (0.00688588239450581 + (0.14074464279305798*applyconvL))); + tempSampleL -= (bL[71] * (0.02277307992926315 + (0.07914752191801366*applyconvL))); + tempSampleL -= (bL[72] * (0.04627166091180877 - (0.00192787268067208*applyconvL))); + tempSampleL -= (bL[73] * (0.05562045897455786 - (0.05932868727665747*applyconvL))); + tempSampleL -= (bL[74] * (0.05134243784922165 - (0.08245334798868090*applyconvL))); + tempSampleL -= (bL[75] * (0.04719409472239919 - (0.07498680629253825*applyconvL))); + tempSampleL -= (bL[76] * (0.05889738914266415 - (0.06116127018043697*applyconvL))); + tempSampleL -= (bL[77] * (0.09428363535111127 - (0.06535868867863834*applyconvL))); + tempSampleL -= (bL[78] * (0.15181756953225126 - (0.08982979655234427*applyconvL))); + tempSampleL -= (bL[79] * (0.20878969456036670 - (0.10761070891499538*applyconvL))); + tempSampleL -= (bL[80] * (0.22647885581813790 - (0.08462542510349125*applyconvL))); + tempSampleL -= (bL[81] * (0.19723482443646323 - (0.02665160920736287*applyconvL))); + tempSampleL -= (bL[82] * (0.16441643451155163 + (0.02314691954338197*applyconvL))); + tempSampleL -= (bL[83] * (0.15201914054931515 + (0.04424903493886839*applyconvL))); + tempSampleL -= (bL[84] * (0.15454370641307855 + (0.04223203797913008*applyconvL))); + //begin VintageStack conv R + tempSampleR += (bR[1] * (1.31698250313308396 - (0.08140616497621633*applyconvR))); + tempSampleR += (bR[2] * (1.47229016949915326 - (0.27680278993637253*applyconvR))); + tempSampleR += (bR[3] * (1.30410109086044956 - (0.35629113432046489*applyconvR))); + tempSampleR += (bR[4] * (0.81766210474551260 - (0.26808782337659753*applyconvR))); + tempSampleR += (bR[5] * (0.19868872545506663 - (0.11105517193919669*applyconvR))); + tempSampleR -= (bR[6] * (0.39115909132567039 - (0.12630622002682679*applyconvR))); + tempSampleR -= (bR[7] * (0.76881891559343574 - (0.40879849500403143*applyconvR))); + tempSampleR -= (bR[8] * (0.87146861782680340 - (0.59529560488000599*applyconvR))); + tempSampleR -= (bR[9] * (0.79504575932563670 - (0.60877047551611796*applyconvR))); + tempSampleR -= (bR[10] * (0.61653017622406314 - (0.47662851438557335*applyconvR))); + tempSampleR -= (bR[11] * (0.40718195794382067 - (0.24955839378539713*applyconvR))); + tempSampleR -= (bR[12] * (0.31794900040616203 - (0.04169792259600613*applyconvR))); + tempSampleR -= (bR[13] * (0.41075032540217843 + (0.00368483996076280*applyconvR))); + tempSampleR -= (bR[14] * (0.56901352922170667 - (0.11027360805893105*applyconvR))); + tempSampleR -= (bR[15] * (0.62443222391889264 - (0.22198075154245228*applyconvR))); + tempSampleR -= (bR[16] * (0.53462856723129204 - (0.22933544545324852*applyconvR))); + tempSampleR -= (bR[17] * (0.34441703361995046 - (0.12956809502269492*applyconvR))); + tempSampleR -= (bR[18] * (0.13947052337867882 + (0.00339775055962799*applyconvR))); + tempSampleR += (bR[19] * (0.03771252648928484 - (0.10863931549251718*applyconvR))); + tempSampleR += (bR[20] * (0.18280210770271693 - (0.17413646599296417*applyconvR))); + tempSampleR += (bR[21] * (0.24621986701761467 - (0.14547053270435095*applyconvR))); + tempSampleR += (bR[22] * (0.22347075142737360 - (0.02493869490104031*applyconvR))); + tempSampleR += (bR[23] * (0.14346348482123716 + (0.11284054747963246*applyconvR))); + tempSampleR += (bR[24] * (0.00834364862916028 + (0.24284684053733926*applyconvR))); + tempSampleR -= (bR[25] * (0.11559740296078347 - (0.32623054435304538*applyconvR))); + tempSampleR -= (bR[26] * (0.18067604561283060 - (0.32311481551122478*applyconvR))); + tempSampleR -= (bR[27] * (0.22927997789035612 - (0.26991539052832925*applyconvR))); + tempSampleR -= (bR[28] * (0.28487666578669446 - (0.22437227250279349*applyconvR))); + tempSampleR -= (bR[29] * (0.31992973037153838 - (0.15289876100963865*applyconvR))); + tempSampleR -= (bR[30] * (0.35174606303520733 - (0.05656293023086628*applyconvR))); + tempSampleR -= (bR[31] * (0.36894898011375254 + (0.04333925421463558*applyconvR))); + tempSampleR -= (bR[32] * (0.32567576055307507 + (0.14594589410921388*applyconvR))); + tempSampleR -= (bR[33] * (0.27440135050585784 + (0.15529667398122521*applyconvR))); + tempSampleR -= (bR[34] * (0.21998973785078091 + (0.05083553737157104*applyconvR))); + tempSampleR -= (bR[35] * (0.10323624876862457 - (0.04651829594199963*applyconvR))); + tempSampleR += (bR[36] * (0.02091603687851074 + (0.12000046818439322*applyconvR))); + tempSampleR += (bR[37] * (0.11344930914138468 + (0.17697142512225839*applyconvR))); + tempSampleR += (bR[38] * (0.22766779627643968 + (0.13645102964003858*applyconvR))); + tempSampleR += (bR[39] * (0.38378309953638229 - (0.01997653307333791*applyconvR))); + tempSampleR += (bR[40] * (0.52789400804568076 - (0.21409137428422448*applyconvR))); + tempSampleR += (bR[41] * (0.55444630296938280 - (0.32331980931576626*applyconvR))); + tempSampleR += (bR[42] * (0.42333237669264601 - (0.26855847463044280*applyconvR))); + tempSampleR += (bR[43] * (0.21942831522035078 - (0.12051365248820624*applyconvR))); + tempSampleR -= (bR[44] * (0.00584169427830633 - (0.03706970171280329*applyconvR))); + tempSampleR -= (bR[45] * (0.24279799124660351 - (0.17296440491477982*applyconvR))); + tempSampleR -= (bR[46] * (0.40173760787507085 - (0.21717989835163351*applyconvR))); + tempSampleR -= (bR[47] * (0.43930035724188155 - (0.16425928481378199*applyconvR))); + tempSampleR -= (bR[48] * (0.41067765934041811 - (0.10390115786636855*applyconvR))); + tempSampleR -= (bR[49] * (0.34409235547165967 - (0.07268159377411920*applyconvR))); + tempSampleR -= (bR[50] * (0.26542883122568151 - (0.05483457497365785*applyconvR))); + tempSampleR -= (bR[51] * (0.22024754776138800 - (0.06484897950087598*applyconvR))); + tempSampleR -= (bR[52] * (0.20394367993632415 - (0.08746309731952180*applyconvR))); + tempSampleR -= (bR[53] * (0.17565242431124092 - (0.07611309538078760*applyconvR))); + tempSampleR -= (bR[54] * (0.10116623231246825 - (0.00642818706295112*applyconvR))); + tempSampleR -= (bR[55] * (0.00782648272053632 + (0.08004141267685004*applyconvR))); + tempSampleR += (bR[56] * (0.05059046006747323 - (0.12436676387548490*applyconvR))); + tempSampleR += (bR[57] * (0.06241531553254467 - (0.11530779547021434*applyconvR))); + tempSampleR += (bR[58] * (0.04952694587101836 - (0.08340945324333944*applyconvR))); + tempSampleR += (bR[59] * (0.00843873294401687 - (0.03279659052562903*applyconvR))); + tempSampleR -= (bR[60] * (0.05161338949440241 - (0.03428181149163798*applyconvR))); + tempSampleR -= (bR[61] * (0.08165520146902012 - (0.08196746092283110*applyconvR))); + tempSampleR -= (bR[62] * (0.06639532849935320 - (0.09797462781896329*applyconvR))); + tempSampleR -= (bR[63] * (0.02953430910661621 - (0.09175612938515763*applyconvR))); + tempSampleR += (bR[64] * (0.00741058547442938 + (0.05442091048731967*applyconvR))); + tempSampleR += (bR[65] * (0.01832866125391727 + (0.00306243693643687*applyconvR))); + tempSampleR += (bR[66] * (0.00526964230373573 - (0.04364102661136410*applyconvR))); + tempSampleR -= (bR[67] * (0.00300984373848200 + (0.09742737841278880*applyconvR))); + tempSampleR -= (bR[68] * (0.00413616769576694 + (0.14380661694523073*applyconvR))); + tempSampleR -= (bR[69] * (0.00588769034931419 + (0.16012843578892538*applyconvR))); + tempSampleR -= (bR[70] * (0.00688588239450581 + (0.14074464279305798*applyconvR))); + tempSampleR -= (bR[71] * (0.02277307992926315 + (0.07914752191801366*applyconvR))); + tempSampleR -= (bR[72] * (0.04627166091180877 - (0.00192787268067208*applyconvR))); + tempSampleR -= (bR[73] * (0.05562045897455786 - (0.05932868727665747*applyconvR))); + tempSampleR -= (bR[74] * (0.05134243784922165 - (0.08245334798868090*applyconvR))); + tempSampleR -= (bR[75] * (0.04719409472239919 - (0.07498680629253825*applyconvR))); + tempSampleR -= (bR[76] * (0.05889738914266415 - (0.06116127018043697*applyconvR))); + tempSampleR -= (bR[77] * (0.09428363535111127 - (0.06535868867863834*applyconvR))); + tempSampleR -= (bR[78] * (0.15181756953225126 - (0.08982979655234427*applyconvR))); + tempSampleR -= (bR[79] * (0.20878969456036670 - (0.10761070891499538*applyconvR))); + tempSampleR -= (bR[80] * (0.22647885581813790 - (0.08462542510349125*applyconvR))); + tempSampleR -= (bR[81] * (0.19723482443646323 - (0.02665160920736287*applyconvR))); + tempSampleR -= (bR[82] * (0.16441643451155163 + (0.02314691954338197*applyconvR))); + tempSampleR -= (bR[83] * (0.15201914054931515 + (0.04424903493886839*applyconvR))); + tempSampleR -= (bR[84] * (0.15454370641307855 + (0.04223203797913008*applyconvR))); + //end VintageStack conv + break; + case 3: + //begin BoutiqueStack conv L + tempSampleL += (bL[1] * (1.30406584776167445 - (0.01410622186823351*applyconvL))); + tempSampleL += (bL[2] * (1.09350974154373559 + (0.34478044709202327*applyconvL))); + tempSampleL += (bL[3] * (0.52285510059938256 + (0.84225842837363574*applyconvL))); + tempSampleL -= (bL[4] * (0.00018126260714707 - (1.02446537989058117*applyconvL))); + tempSampleL -= (bL[5] * (0.34943699771860115 - (0.84094709567790016*applyconvL))); + tempSampleL -= (bL[6] * (0.53068048407937285 - (0.49231169327705593*applyconvL))); + tempSampleL -= (bL[7] * (0.48631669406792399 - (0.08965111766223610*applyconvL))); + tempSampleL -= (bL[8] * (0.28099201947014130 + (0.23921137841068607*applyconvL))); + tempSampleL -= (bL[9] * (0.10333290012666248 + (0.35058962687321482*applyconvL))); + tempSampleL -= (bL[10] * (0.06605032198166226 + (0.23447405567823365*applyconvL))); + tempSampleL -= (bL[11] * (0.10485808661261729 + (0.05025985449763527*applyconvL))); + tempSampleL -= (bL[12] * (0.13231190973014911 - (0.05484648240248013*applyconvL))); + tempSampleL -= (bL[13] * (0.12926184767180304 - (0.04054223744746116*applyconvL))); + tempSampleL -= (bL[14] * (0.13802696739839460 + (0.01876754906568237*applyconvL))); + tempSampleL -= (bL[15] * (0.16548980700926913 + (0.06772130758771169*applyconvL))); + tempSampleL -= (bL[16] * (0.14469310965751475 + (0.10590928840978781*applyconvL))); + tempSampleL -= (bL[17] * (0.07838457396093310 + (0.13120101199677947*applyconvL))); + tempSampleL -= (bL[18] * (0.05123031606187391 + (0.13883400806512292*applyconvL))); + tempSampleL -= (bL[19] * (0.08906103481939850 + (0.07840461228402337*applyconvL))); + tempSampleL -= (bL[20] * (0.13939265522625241 + (0.01194366471800457*applyconvL))); + tempSampleL -= (bL[21] * (0.14957600717294034 + (0.07687598594361914*applyconvL))); + tempSampleL -= (bL[22] * (0.14112708654047090 + (0.20118461131186977*applyconvL))); + tempSampleL -= (bL[23] * (0.14961020766492997 + (0.30005716443826147*applyconvL))); + tempSampleL -= (bL[24] * (0.16130382224652270 + (0.40459872030013055*applyconvL))); + tempSampleL -= (bL[25] * (0.15679868471080052 + (0.47292767226083465*applyconvL))); + tempSampleL -= (bL[26] * (0.16456530552807727 + (0.45182121471666481*applyconvL))); + tempSampleL -= (bL[27] * (0.16852385701909278 + (0.38272684270752266*applyconvL))); + tempSampleL -= (bL[28] * (0.13317562760966850 + (0.28829580273670768*applyconvL))); + tempSampleL -= (bL[29] * (0.09396196532150952 + (0.18886898332071317*applyconvL))); + tempSampleL -= (bL[30] * (0.10133496956734221 + (0.11158788414137354*applyconvL))); + tempSampleL -= (bL[31] * (0.16097596389376778 + (0.02621299102374547*applyconvL))); + tempSampleL -= (bL[32] * (0.21419006394821866 - (0.03585678078834797*applyconvL))); + tempSampleL -= (bL[33] * (0.21273234570555244 - (0.02574469802924526*applyconvL))); + tempSampleL -= (bL[34] * (0.16934948798707830 + (0.01354331184333835*applyconvL))); + tempSampleL -= (bL[35] * (0.11970436472852493 + (0.04242183865883427*applyconvL))); + tempSampleL -= (bL[36] * (0.09329023656747724 + (0.06890873292358397*applyconvL))); + tempSampleL -= (bL[37] * (0.10255328436608116 + (0.11482972519137427*applyconvL))); + tempSampleL -= (bL[38] * (0.13883223352796811 + (0.18016014431438840*applyconvL))); + tempSampleL -= (bL[39] * (0.16532844286979087 + (0.24521957638633446*applyconvL))); + tempSampleL -= (bL[40] * (0.16254607738965438 + (0.25669472097572482*applyconvL))); + tempSampleL -= (bL[41] * (0.15353207135544752 + (0.15048064682912729*applyconvL))); + tempSampleL -= (bL[42] * (0.13039046390746015 - (0.00200335414623601*applyconvL))); + tempSampleL -= (bL[43] * (0.06707245032180627 - (0.06498125592578702*applyconvL))); + tempSampleL += (bL[44] * (0.01427326441869788 + (0.01940451360783622*applyconvL))); + tempSampleL += (bL[45] * (0.06151238306578224 - (0.07335755969763329*applyconvL))); + tempSampleL += (bL[46] * (0.04685840498892526 - (0.14258849371688248*applyconvL))); + tempSampleL -= (bL[47] * (0.00950136304466093 + (0.14379354707665129*applyconvL))); + tempSampleL -= (bL[48] * (0.06245771575493557 + (0.07639718586346110*applyconvL))); + tempSampleL -= (bL[49] * (0.07159593175777741 - (0.00595536565276915*applyconvL))); + tempSampleL -= (bL[50] * (0.03167929390245019 - (0.03856769526301793*applyconvL))); + tempSampleL += (bL[51] * (0.01890898565110766 + (0.00760539424271147*applyconvL))); + tempSampleL += (bL[52] * (0.04926161137832240 - (0.06411014430053390*applyconvL))); + tempSampleL += (bL[53] * (0.05768814623421683 - (0.15068618173358578*applyconvL))); + tempSampleL += (bL[54] * (0.06144258297076708 - (0.21200636329120301*applyconvL))); + tempSampleL += (bL[55] * (0.06348341960185613 - (0.19620269813094307*applyconvL))); + tempSampleL += (bL[56] * (0.04877736350310589 - (0.11864999881200111*applyconvL))); + tempSampleL += (bL[57] * (0.01010950997574472 - (0.02630070679113791*applyconvL))); + tempSampleL -= (bL[58] * (0.02929178864801191 - (0.04439260202207482*applyconvL))); + tempSampleL -= (bL[59] * (0.03484517126321562 - (0.04508635396034735*applyconvL))); + tempSampleL -= (bL[60] * (0.00547176780437610 - (0.00205637806941426*applyconvL))); + tempSampleL += (bL[61] * (0.02278296865283977 - (0.00063732526427685*applyconvL))); + tempSampleL += (bL[62] * (0.02688982591366477 + (0.05333738901586284*applyconvL))); + tempSampleL += (bL[63] * (0.01942012754957055 + (0.10942832669749143*applyconvL))); + tempSampleL += (bL[64] * (0.01572585258756565 + (0.11189204189054594*applyconvL))); + tempSampleL += (bL[65] * (0.01490550715016034 + (0.04449822818925343*applyconvL))); + tempSampleL += (bL[66] * (0.01715683226376727 - (0.06944648050933899*applyconvL))); + tempSampleL += (bL[67] * (0.02822659878011318 - (0.17843652160132820*applyconvL))); + tempSampleL += (bL[68] * (0.03758307610456144 - (0.21986013433664692*applyconvL))); + tempSampleL += (bL[69] * (0.03275008021608433 - (0.15869878676112170*applyconvL))); + tempSampleL += (bL[70] * (0.01855749786752354 - (0.02337224995718105*applyconvL))); + tempSampleL += (bL[71] * (0.00217095395782931 + (0.10971764224593601*applyconvL))); + tempSampleL -= (bL[72] * (0.01851381451105007 - (0.17214910008793413*applyconvL))); + tempSampleL -= (bL[73] * (0.04722574936345419 - (0.14341588977845254*applyconvL))); + tempSampleL -= (bL[74] * (0.07151540514482006 - (0.04684695724814321*applyconvL))); + tempSampleL -= (bL[75] * (0.06827195484995092 + (0.07022207121861397*applyconvL))); + tempSampleL -= (bL[76] * (0.03290227240464227 + (0.16328400808152735*applyconvL))); + tempSampleL += (bL[77] * (0.01043861198275382 - (0.20184486126076279*applyconvL))); + tempSampleL += (bL[78] * (0.03236563559476477 - (0.17125821306380920*applyconvL))); + tempSampleL += (bL[79] * (0.02040121529932702 - (0.09103660189829657*applyconvL))); + tempSampleL -= (bL[80] * (0.00509649513318102 + (0.01170360991547489*applyconvL))); + tempSampleL -= (bL[81] * (0.01388353426600228 - (0.03588955538451771*applyconvL))); + tempSampleL -= (bL[82] * (0.00523671715033842 - (0.07068798057534148*applyconvL))); + tempSampleL += (bL[83] * (0.00665852487721137 + (0.11666210640054926*applyconvL))); + tempSampleL += (bL[84] * (0.01593540832939290 + (0.15844892856402149*applyconvL))); + tempSampleL += (bL[85] * (0.02080509201836796 + (0.17186274420065850*applyconvL))); + //begin BoutiqueStack conv R + tempSampleR += (bR[1] * (1.30406584776167445 - (0.01410622186823351*applyconvR))); + tempSampleR += (bR[2] * (1.09350974154373559 + (0.34478044709202327*applyconvR))); + tempSampleR += (bR[3] * (0.52285510059938256 + (0.84225842837363574*applyconvR))); + tempSampleR -= (bR[4] * (0.00018126260714707 - (1.02446537989058117*applyconvR))); + tempSampleR -= (bR[5] * (0.34943699771860115 - (0.84094709567790016*applyconvR))); + tempSampleR -= (bR[6] * (0.53068048407937285 - (0.49231169327705593*applyconvR))); + tempSampleR -= (bR[7] * (0.48631669406792399 - (0.08965111766223610*applyconvR))); + tempSampleR -= (bR[8] * (0.28099201947014130 + (0.23921137841068607*applyconvR))); + tempSampleR -= (bR[9] * (0.10333290012666248 + (0.35058962687321482*applyconvR))); + tempSampleR -= (bR[10] * (0.06605032198166226 + (0.23447405567823365*applyconvR))); + tempSampleR -= (bR[11] * (0.10485808661261729 + (0.05025985449763527*applyconvR))); + tempSampleR -= (bR[12] * (0.13231190973014911 - (0.05484648240248013*applyconvR))); + tempSampleR -= (bR[13] * (0.12926184767180304 - (0.04054223744746116*applyconvR))); + tempSampleR -= (bR[14] * (0.13802696739839460 + (0.01876754906568237*applyconvR))); + tempSampleR -= (bR[15] * (0.16548980700926913 + (0.06772130758771169*applyconvR))); + tempSampleR -= (bR[16] * (0.14469310965751475 + (0.10590928840978781*applyconvR))); + tempSampleR -= (bR[17] * (0.07838457396093310 + (0.13120101199677947*applyconvR))); + tempSampleR -= (bR[18] * (0.05123031606187391 + (0.13883400806512292*applyconvR))); + tempSampleR -= (bR[19] * (0.08906103481939850 + (0.07840461228402337*applyconvR))); + tempSampleR -= (bR[20] * (0.13939265522625241 + (0.01194366471800457*applyconvR))); + tempSampleR -= (bR[21] * (0.14957600717294034 + (0.07687598594361914*applyconvR))); + tempSampleR -= (bR[22] * (0.14112708654047090 + (0.20118461131186977*applyconvR))); + tempSampleR -= (bR[23] * (0.14961020766492997 + (0.30005716443826147*applyconvR))); + tempSampleR -= (bR[24] * (0.16130382224652270 + (0.40459872030013055*applyconvR))); + tempSampleR -= (bR[25] * (0.15679868471080052 + (0.47292767226083465*applyconvR))); + tempSampleR -= (bR[26] * (0.16456530552807727 + (0.45182121471666481*applyconvR))); + tempSampleR -= (bR[27] * (0.16852385701909278 + (0.38272684270752266*applyconvR))); + tempSampleR -= (bR[28] * (0.13317562760966850 + (0.28829580273670768*applyconvR))); + tempSampleR -= (bR[29] * (0.09396196532150952 + (0.18886898332071317*applyconvR))); + tempSampleR -= (bR[30] * (0.10133496956734221 + (0.11158788414137354*applyconvR))); + tempSampleR -= (bR[31] * (0.16097596389376778 + (0.02621299102374547*applyconvR))); + tempSampleR -= (bR[32] * (0.21419006394821866 - (0.03585678078834797*applyconvR))); + tempSampleR -= (bR[33] * (0.21273234570555244 - (0.02574469802924526*applyconvR))); + tempSampleR -= (bR[34] * (0.16934948798707830 + (0.01354331184333835*applyconvR))); + tempSampleR -= (bR[35] * (0.11970436472852493 + (0.04242183865883427*applyconvR))); + tempSampleR -= (bR[36] * (0.09329023656747724 + (0.06890873292358397*applyconvR))); + tempSampleR -= (bR[37] * (0.10255328436608116 + (0.11482972519137427*applyconvR))); + tempSampleR -= (bR[38] * (0.13883223352796811 + (0.18016014431438840*applyconvR))); + tempSampleR -= (bR[39] * (0.16532844286979087 + (0.24521957638633446*applyconvR))); + tempSampleR -= (bR[40] * (0.16254607738965438 + (0.25669472097572482*applyconvR))); + tempSampleR -= (bR[41] * (0.15353207135544752 + (0.15048064682912729*applyconvR))); + tempSampleR -= (bR[42] * (0.13039046390746015 - (0.00200335414623601*applyconvR))); + tempSampleR -= (bR[43] * (0.06707245032180627 - (0.06498125592578702*applyconvR))); + tempSampleR += (bR[44] * (0.01427326441869788 + (0.01940451360783622*applyconvR))); + tempSampleR += (bR[45] * (0.06151238306578224 - (0.07335755969763329*applyconvR))); + tempSampleR += (bR[46] * (0.04685840498892526 - (0.14258849371688248*applyconvR))); + tempSampleR -= (bR[47] * (0.00950136304466093 + (0.14379354707665129*applyconvR))); + tempSampleR -= (bR[48] * (0.06245771575493557 + (0.07639718586346110*applyconvR))); + tempSampleR -= (bR[49] * (0.07159593175777741 - (0.00595536565276915*applyconvR))); + tempSampleR -= (bR[50] * (0.03167929390245019 - (0.03856769526301793*applyconvR))); + tempSampleR += (bR[51] * (0.01890898565110766 + (0.00760539424271147*applyconvR))); + tempSampleR += (bR[52] * (0.04926161137832240 - (0.06411014430053390*applyconvR))); + tempSampleR += (bR[53] * (0.05768814623421683 - (0.15068618173358578*applyconvR))); + tempSampleR += (bR[54] * (0.06144258297076708 - (0.21200636329120301*applyconvR))); + tempSampleR += (bR[55] * (0.06348341960185613 - (0.19620269813094307*applyconvR))); + tempSampleR += (bR[56] * (0.04877736350310589 - (0.11864999881200111*applyconvR))); + tempSampleR += (bR[57] * (0.01010950997574472 - (0.02630070679113791*applyconvR))); + tempSampleR -= (bR[58] * (0.02929178864801191 - (0.04439260202207482*applyconvR))); + tempSampleR -= (bR[59] * (0.03484517126321562 - (0.04508635396034735*applyconvR))); + tempSampleR -= (bR[60] * (0.00547176780437610 - (0.00205637806941426*applyconvR))); + tempSampleR += (bR[61] * (0.02278296865283977 - (0.00063732526427685*applyconvR))); + tempSampleR += (bR[62] * (0.02688982591366477 + (0.05333738901586284*applyconvR))); + tempSampleR += (bR[63] * (0.01942012754957055 + (0.10942832669749143*applyconvR))); + tempSampleR += (bR[64] * (0.01572585258756565 + (0.11189204189054594*applyconvR))); + tempSampleR += (bR[65] * (0.01490550715016034 + (0.04449822818925343*applyconvR))); + tempSampleR += (bR[66] * (0.01715683226376727 - (0.06944648050933899*applyconvR))); + tempSampleR += (bR[67] * (0.02822659878011318 - (0.17843652160132820*applyconvR))); + tempSampleR += (bR[68] * (0.03758307610456144 - (0.21986013433664692*applyconvR))); + tempSampleR += (bR[69] * (0.03275008021608433 - (0.15869878676112170*applyconvR))); + tempSampleR += (bR[70] * (0.01855749786752354 - (0.02337224995718105*applyconvR))); + tempSampleR += (bR[71] * (0.00217095395782931 + (0.10971764224593601*applyconvR))); + tempSampleR -= (bR[72] * (0.01851381451105007 - (0.17214910008793413*applyconvR))); + tempSampleR -= (bR[73] * (0.04722574936345419 - (0.14341588977845254*applyconvR))); + tempSampleR -= (bR[74] * (0.07151540514482006 - (0.04684695724814321*applyconvR))); + tempSampleR -= (bR[75] * (0.06827195484995092 + (0.07022207121861397*applyconvR))); + tempSampleR -= (bR[76] * (0.03290227240464227 + (0.16328400808152735*applyconvR))); + tempSampleR += (bR[77] * (0.01043861198275382 - (0.20184486126076279*applyconvR))); + tempSampleR += (bR[78] * (0.03236563559476477 - (0.17125821306380920*applyconvR))); + tempSampleR += (bR[79] * (0.02040121529932702 - (0.09103660189829657*applyconvR))); + tempSampleR -= (bR[80] * (0.00509649513318102 + (0.01170360991547489*applyconvR))); + tempSampleR -= (bR[81] * (0.01388353426600228 - (0.03588955538451771*applyconvR))); + tempSampleR -= (bR[82] * (0.00523671715033842 - (0.07068798057534148*applyconvR))); + tempSampleR += (bR[83] * (0.00665852487721137 + (0.11666210640054926*applyconvR))); + tempSampleR += (bR[84] * (0.01593540832939290 + (0.15844892856402149*applyconvR))); + tempSampleR += (bR[85] * (0.02080509201836796 + (0.17186274420065850*applyconvR))); + //end BoutiqueStack conv + break; + case 4: + //begin LargeCombo conv L + tempSampleL += (bL[1] * (1.31819680801404560 + (0.00362521700518292*applyconvL))); + tempSampleL += (bL[2] * (1.37738284126127919 + (0.14134596126256205*applyconvL))); + tempSampleL += (bL[3] * (1.09957637225311622 + (0.33199581815501555*applyconvL))); + tempSampleL += (bL[4] * (0.62025358899656258 + (0.37476042042088142*applyconvL))); + tempSampleL += (bL[5] * (0.12926194402137478 + (0.24702655568406759*applyconvL))); + tempSampleL -= (bL[6] * (0.28927985011367602 - (0.13289168298307708*applyconvL))); + tempSampleL -= (bL[7] * (0.56518146339033448 - (0.11026641793526121*applyconvL))); + tempSampleL -= (bL[8] * (0.59843200696815069 - (0.10139909232154271*applyconvL))); + tempSampleL -= (bL[9] * (0.45219971861789204 - (0.13313355255903159*applyconvL))); + tempSampleL -= (bL[10] * (0.32520490032331351 - (0.29009061730364216*applyconvL))); + tempSampleL -= (bL[11] * (0.29773131872442909 - (0.45307495356996669*applyconvL))); + tempSampleL -= (bL[12] * (0.31738895975218867 - (0.43198591958928922*applyconvL))); + tempSampleL -= (bL[13] * (0.33336150604703757 - (0.24240412850274029*applyconvL))); + tempSampleL -= (bL[14] * (0.32461638442042151 - (0.02779297492397464*applyconvL))); + tempSampleL -= (bL[15] * (0.27812829473787770 + (0.15565718905032455*applyconvL))); + tempSampleL -= (bL[16] * (0.19413454458668097 + (0.32087693535188599*applyconvL))); + tempSampleL -= (bL[17] * (0.12378036344480114 + (0.37736575956794161*applyconvL))); + tempSampleL -= (bL[18] * (0.12550494837257106 + (0.25593811142722300*applyconvL))); + tempSampleL -= (bL[19] * (0.17725736033713696 + (0.07708896413593636*applyconvL))); + tempSampleL -= (bL[20] * (0.22023699647700670 - (0.01600371273599124*applyconvL))); + tempSampleL -= (bL[21] * (0.21987645486953747 + (0.00973336938352798*applyconvL))); + tempSampleL -= (bL[22] * (0.15014276479707978 + (0.11602269600138954*applyconvL))); + tempSampleL -= (bL[23] * (0.05176520203073560 + (0.20383164255692698*applyconvL))); + tempSampleL -= (bL[24] * (0.04276687165294867 + (0.17785002166834518*applyconvL))); + tempSampleL -= (bL[25] * (0.15951546388137597 + (0.06748854885822464*applyconvL))); + tempSampleL -= (bL[26] * (0.30211952144352616 - (0.03440494237025149*applyconvL))); + tempSampleL -= (bL[27] * (0.36462803375134506 - (0.05874284362202409*applyconvL))); + tempSampleL -= (bL[28] * (0.32283960219377539 + (0.01189623197958362*applyconvL))); + tempSampleL -= (bL[29] * (0.19245178663350720 + (0.11088858383712991*applyconvL))); + tempSampleL += (bL[30] * (0.00681589563349590 - (0.16314250963457660*applyconvL))); + tempSampleL += (bL[31] * (0.20927798345622584 - (0.16952981620487462*applyconvL))); + tempSampleL += (bL[32] * (0.25638846543430976 - (0.11462562122281153*applyconvL))); + tempSampleL += (bL[33] * (0.04584495673888605 + (0.04669671229804190*applyconvL))); + tempSampleL -= (bL[34] * (0.25221561978187662 - (0.19250758741703761*applyconvL))); + tempSampleL -= (bL[35] * (0.35662801992424953 - (0.12244680002787561*applyconvL))); + tempSampleL -= (bL[36] * (0.21498114329314663 + (0.12152120956991189*applyconvL))); + tempSampleL += (bL[37] * (0.00968605571673376 - (0.30597812512858558*applyconvL))); + tempSampleL += (bL[38] * (0.18029119870614621 - (0.31569386468576782*applyconvL))); + tempSampleL += (bL[39] * (0.22744437185251629 - (0.18028438460422197*applyconvL))); + tempSampleL += (bL[40] * (0.09725687638959078 + (0.05479918522830433*applyconvL))); + tempSampleL -= (bL[41] * (0.17970389267353537 - (0.29222750363124067*applyconvL))); + tempSampleL -= (bL[42] * (0.42371969704763018 - (0.34924957781842314*applyconvL))); + tempSampleL -= (bL[43] * (0.43313266755788055 - (0.11503731970288061*applyconvL))); + tempSampleL -= (bL[44] * (0.22178165627851801 + (0.25002925550036226*applyconvL))); + tempSampleL -= (bL[45] * (0.00410198176852576 + (0.43283281457037676*applyconvL))); + tempSampleL += (bL[46] * (0.09072426344812032 - (0.35318250460706446*applyconvL))); + tempSampleL += (bL[47] * (0.08405839183965140 - (0.16936391987143717*applyconvL))); + tempSampleL -= (bL[48] * (0.01110419756114383 - (0.01247164991313877*applyconvL))); + tempSampleL -= (bL[49] * (0.18593334646855278 - (0.14513260199423966*applyconvL))); + tempSampleL -= (bL[50] * (0.33665010871497486 - (0.14456206192169668*applyconvL))); + tempSampleL -= (bL[51] * (0.32644968491439380 + (0.01594380759082303*applyconvL))); + tempSampleL -= (bL[52] * (0.14855437679485431 + (0.23555511219002742*applyconvL))); + tempSampleL += (bL[53] * (0.05113019250820622 - (0.35556617126595202*applyconvL))); + tempSampleL += (bL[54] * (0.12915754942362243 - (0.28571671825750300*applyconvL))); + tempSampleL += (bL[55] * (0.07406865846069306 - (0.10543886479975995*applyconvL))); + tempSampleL -= (bL[56] * (0.03669573814193980 - (0.03194267657582078*applyconvL))); + tempSampleL -= (bL[57] * (0.13429103278009327 - (0.06145796486786051*applyconvL))); + tempSampleL -= (bL[58] * (0.17884021749974641 - (0.00156626902982124*applyconvL))); + tempSampleL -= (bL[59] * (0.16138212225178239 + (0.09402070836837134*applyconvL))); + tempSampleL -= (bL[60] * (0.10867028245257521 + (0.15407963447815898*applyconvL))); + tempSampleL -= (bL[61] * (0.06312416389213464 + (0.11241095544179526*applyconvL))); + tempSampleL -= (bL[62] * (0.05826376574081994 - (0.03635253545701986*applyconvL))); + tempSampleL -= (bL[63] * (0.07991631148258237 - (0.18041947557579863*applyconvL))); + tempSampleL -= (bL[64] * (0.07777397532506500 - (0.20817156738202205*applyconvL))); + tempSampleL -= (bL[65] * (0.03812528734394271 - (0.13679963125162486*applyconvL))); + tempSampleL += (bL[66] * (0.00204900323943951 + (0.04009000730101046*applyconvL))); + tempSampleL += (bL[67] * (0.01779599498119764 - (0.04218637577942354*applyconvL))); + tempSampleL += (bL[68] * (0.00950301949319113 - (0.07908911305044238*applyconvL))); + tempSampleL -= (bL[69] * (0.04283600714814891 + (0.02716262334097985*applyconvL))); + tempSampleL -= (bL[70] * (0.14478320837041933 - (0.08823515277628832*applyconvL))); + tempSampleL -= (bL[71] * (0.23250267035795688 - (0.15334197814956568*applyconvL))); + tempSampleL -= (bL[72] * (0.22369031446225857 - (0.08550989980799503*applyconvL))); + tempSampleL -= (bL[73] * (0.11142757883989868 + (0.08321482928259660*applyconvL))); + tempSampleL += (bL[74] * (0.02752318631713307 - (0.25252906099212968*applyconvL))); + tempSampleL += (bL[75] * (0.11940028414727490 - (0.34358127205009553*applyconvL))); + tempSampleL += (bL[76] * (0.12702057126698307 - (0.31808560130583663*applyconvL))); + tempSampleL += (bL[77] * (0.03639067777025356 - (0.17970282734717846*applyconvL))); + tempSampleL -= (bL[78] * (0.11389848143835518 + (0.00470616711331971*applyconvL))); + tempSampleL -= (bL[79] * (0.23024072979374310 - (0.09772245468884058*applyconvL))); + tempSampleL -= (bL[80] * (0.24389015061112601 - (0.09600959885615798*applyconvL))); + tempSampleL -= (bL[81] * (0.16680269075295703 - (0.05194978963662898*applyconvL))); + tempSampleL -= (bL[82] * (0.05108041495077725 - (0.01796071525570735*applyconvL))); + tempSampleL += (bL[83] * (0.06489835353859555 - (0.00808013770331126*applyconvL))); + tempSampleL += (bL[84] * (0.15481511440233464 - (0.02674063848284838*applyconvL))); + tempSampleL += (bL[85] * (0.18620867857907253 - (0.01786423699465214*applyconvL))); + tempSampleL += (bL[86] * (0.13879832139055756 + (0.01584446839973597*applyconvL))); + tempSampleL += (bL[87] * (0.04878235109120615 + (0.02962866516075816*applyconvL))); + //begin LargeCombo conv R + tempSampleR += (bR[1] * (1.31819680801404560 + (0.00362521700518292*applyconvR))); + tempSampleR += (bR[2] * (1.37738284126127919 + (0.14134596126256205*applyconvR))); + tempSampleR += (bR[3] * (1.09957637225311622 + (0.33199581815501555*applyconvR))); + tempSampleR += (bR[4] * (0.62025358899656258 + (0.37476042042088142*applyconvR))); + tempSampleR += (bR[5] * (0.12926194402137478 + (0.24702655568406759*applyconvR))); + tempSampleR -= (bR[6] * (0.28927985011367602 - (0.13289168298307708*applyconvR))); + tempSampleR -= (bR[7] * (0.56518146339033448 - (0.11026641793526121*applyconvR))); + tempSampleR -= (bR[8] * (0.59843200696815069 - (0.10139909232154271*applyconvR))); + tempSampleR -= (bR[9] * (0.45219971861789204 - (0.13313355255903159*applyconvR))); + tempSampleR -= (bR[10] * (0.32520490032331351 - (0.29009061730364216*applyconvR))); + tempSampleR -= (bR[11] * (0.29773131872442909 - (0.45307495356996669*applyconvR))); + tempSampleR -= (bR[12] * (0.31738895975218867 - (0.43198591958928922*applyconvR))); + tempSampleR -= (bR[13] * (0.33336150604703757 - (0.24240412850274029*applyconvR))); + tempSampleR -= (bR[14] * (0.32461638442042151 - (0.02779297492397464*applyconvR))); + tempSampleR -= (bR[15] * (0.27812829473787770 + (0.15565718905032455*applyconvR))); + tempSampleR -= (bR[16] * (0.19413454458668097 + (0.32087693535188599*applyconvR))); + tempSampleR -= (bR[17] * (0.12378036344480114 + (0.37736575956794161*applyconvR))); + tempSampleR -= (bR[18] * (0.12550494837257106 + (0.25593811142722300*applyconvR))); + tempSampleR -= (bR[19] * (0.17725736033713696 + (0.07708896413593636*applyconvR))); + tempSampleR -= (bR[20] * (0.22023699647700670 - (0.01600371273599124*applyconvR))); + tempSampleR -= (bR[21] * (0.21987645486953747 + (0.00973336938352798*applyconvR))); + tempSampleR -= (bR[22] * (0.15014276479707978 + (0.11602269600138954*applyconvR))); + tempSampleR -= (bR[23] * (0.05176520203073560 + (0.20383164255692698*applyconvR))); + tempSampleR -= (bR[24] * (0.04276687165294867 + (0.17785002166834518*applyconvR))); + tempSampleR -= (bR[25] * (0.15951546388137597 + (0.06748854885822464*applyconvR))); + tempSampleR -= (bR[26] * (0.30211952144352616 - (0.03440494237025149*applyconvR))); + tempSampleR -= (bR[27] * (0.36462803375134506 - (0.05874284362202409*applyconvR))); + tempSampleR -= (bR[28] * (0.32283960219377539 + (0.01189623197958362*applyconvR))); + tempSampleR -= (bR[29] * (0.19245178663350720 + (0.11088858383712991*applyconvR))); + tempSampleR += (bR[30] * (0.00681589563349590 - (0.16314250963457660*applyconvR))); + tempSampleR += (bR[31] * (0.20927798345622584 - (0.16952981620487462*applyconvR))); + tempSampleR += (bR[32] * (0.25638846543430976 - (0.11462562122281153*applyconvR))); + tempSampleR += (bR[33] * (0.04584495673888605 + (0.04669671229804190*applyconvR))); + tempSampleR -= (bR[34] * (0.25221561978187662 - (0.19250758741703761*applyconvR))); + tempSampleR -= (bR[35] * (0.35662801992424953 - (0.12244680002787561*applyconvR))); + tempSampleR -= (bR[36] * (0.21498114329314663 + (0.12152120956991189*applyconvR))); + tempSampleR += (bR[37] * (0.00968605571673376 - (0.30597812512858558*applyconvR))); + tempSampleR += (bR[38] * (0.18029119870614621 - (0.31569386468576782*applyconvR))); + tempSampleR += (bR[39] * (0.22744437185251629 - (0.18028438460422197*applyconvR))); + tempSampleR += (bR[40] * (0.09725687638959078 + (0.05479918522830433*applyconvR))); + tempSampleR -= (bR[41] * (0.17970389267353537 - (0.29222750363124067*applyconvR))); + tempSampleR -= (bR[42] * (0.42371969704763018 - (0.34924957781842314*applyconvR))); + tempSampleR -= (bR[43] * (0.43313266755788055 - (0.11503731970288061*applyconvR))); + tempSampleR -= (bR[44] * (0.22178165627851801 + (0.25002925550036226*applyconvR))); + tempSampleR -= (bR[45] * (0.00410198176852576 + (0.43283281457037676*applyconvR))); + tempSampleR += (bR[46] * (0.09072426344812032 - (0.35318250460706446*applyconvR))); + tempSampleR += (bR[47] * (0.08405839183965140 - (0.16936391987143717*applyconvR))); + tempSampleR -= (bR[48] * (0.01110419756114383 - (0.01247164991313877*applyconvR))); + tempSampleR -= (bR[49] * (0.18593334646855278 - (0.14513260199423966*applyconvR))); + tempSampleR -= (bR[50] * (0.33665010871497486 - (0.14456206192169668*applyconvR))); + tempSampleR -= (bR[51] * (0.32644968491439380 + (0.01594380759082303*applyconvR))); + tempSampleR -= (bR[52] * (0.14855437679485431 + (0.23555511219002742*applyconvR))); + tempSampleR += (bR[53] * (0.05113019250820622 - (0.35556617126595202*applyconvR))); + tempSampleR += (bR[54] * (0.12915754942362243 - (0.28571671825750300*applyconvR))); + tempSampleR += (bR[55] * (0.07406865846069306 - (0.10543886479975995*applyconvR))); + tempSampleR -= (bR[56] * (0.03669573814193980 - (0.03194267657582078*applyconvR))); + tempSampleR -= (bR[57] * (0.13429103278009327 - (0.06145796486786051*applyconvR))); + tempSampleR -= (bR[58] * (0.17884021749974641 - (0.00156626902982124*applyconvR))); + tempSampleR -= (bR[59] * (0.16138212225178239 + (0.09402070836837134*applyconvR))); + tempSampleR -= (bR[60] * (0.10867028245257521 + (0.15407963447815898*applyconvR))); + tempSampleR -= (bR[61] * (0.06312416389213464 + (0.11241095544179526*applyconvR))); + tempSampleR -= (bR[62] * (0.05826376574081994 - (0.03635253545701986*applyconvR))); + tempSampleR -= (bR[63] * (0.07991631148258237 - (0.18041947557579863*applyconvR))); + tempSampleR -= (bR[64] * (0.07777397532506500 - (0.20817156738202205*applyconvR))); + tempSampleR -= (bR[65] * (0.03812528734394271 - (0.13679963125162486*applyconvR))); + tempSampleR += (bR[66] * (0.00204900323943951 + (0.04009000730101046*applyconvR))); + tempSampleR += (bR[67] * (0.01779599498119764 - (0.04218637577942354*applyconvR))); + tempSampleR += (bR[68] * (0.00950301949319113 - (0.07908911305044238*applyconvR))); + tempSampleR -= (bR[69] * (0.04283600714814891 + (0.02716262334097985*applyconvR))); + tempSampleR -= (bR[70] * (0.14478320837041933 - (0.08823515277628832*applyconvR))); + tempSampleR -= (bR[71] * (0.23250267035795688 - (0.15334197814956568*applyconvR))); + tempSampleR -= (bR[72] * (0.22369031446225857 - (0.08550989980799503*applyconvR))); + tempSampleR -= (bR[73] * (0.11142757883989868 + (0.08321482928259660*applyconvR))); + tempSampleR += (bR[74] * (0.02752318631713307 - (0.25252906099212968*applyconvR))); + tempSampleR += (bR[75] * (0.11940028414727490 - (0.34358127205009553*applyconvR))); + tempSampleR += (bR[76] * (0.12702057126698307 - (0.31808560130583663*applyconvR))); + tempSampleR += (bR[77] * (0.03639067777025356 - (0.17970282734717846*applyconvR))); + tempSampleR -= (bR[78] * (0.11389848143835518 + (0.00470616711331971*applyconvR))); + tempSampleR -= (bR[79] * (0.23024072979374310 - (0.09772245468884058*applyconvR))); + tempSampleR -= (bR[80] * (0.24389015061112601 - (0.09600959885615798*applyconvR))); + tempSampleR -= (bR[81] * (0.16680269075295703 - (0.05194978963662898*applyconvR))); + tempSampleR -= (bR[82] * (0.05108041495077725 - (0.01796071525570735*applyconvR))); + tempSampleR += (bR[83] * (0.06489835353859555 - (0.00808013770331126*applyconvR))); + tempSampleR += (bR[84] * (0.15481511440233464 - (0.02674063848284838*applyconvR))); + tempSampleR += (bR[85] * (0.18620867857907253 - (0.01786423699465214*applyconvR))); + tempSampleR += (bR[86] * (0.13879832139055756 + (0.01584446839973597*applyconvR))); + tempSampleR += (bR[87] * (0.04878235109120615 + (0.02962866516075816*applyconvR))); + //end LargeCombo conv + break; + case 5: + //begin SmallCombo conv L + tempSampleL += (bL[1] * (1.42133070619855229 - (0.18270903813104500*applyconvL))); + tempSampleL += (bL[2] * (1.47209686171873821 - (0.27954009590498585*applyconvL))); + tempSampleL += (bL[3] * (1.34648011331265294 - (0.47178343556301960*applyconvL))); + tempSampleL += (bL[4] * (0.82133804036124580 - (0.41060189990353935*applyconvL))); + tempSampleL += (bL[5] * (0.21628057120466901 - (0.26062442734317454*applyconvL))); + tempSampleL -= (bL[6] * (0.30306716082877883 + (0.10067648425439185*applyconvL))); + tempSampleL -= (bL[7] * (0.69484313178531876 - (0.09655574841702286*applyconvL))); + tempSampleL -= (bL[8] * (0.88320822356980833 - (0.26501644327144314*applyconvL))); + tempSampleL -= (bL[9] * (0.81326147029423723 - (0.31115926837054075*applyconvL))); + tempSampleL -= (bL[10] * (0.56728759049069222 - (0.23304233545561287*applyconvL))); + tempSampleL -= (bL[11] * (0.33340326645198737 - (0.12361361388240180*applyconvL))); + tempSampleL -= (bL[12] * (0.20280263733605616 - (0.03531960962500105*applyconvL))); + tempSampleL -= (bL[13] * (0.15864533788751345 + (0.00355160825317868*applyconvL))); + tempSampleL -= (bL[14] * (0.12544767480555119 + (0.01979010423176500*applyconvL))); + tempSampleL -= (bL[15] * (0.06666788902658917 + (0.00188830739903378*applyconvL))); + tempSampleL += (bL[16] * (0.02977793355081072 + (0.02304216615605394*applyconvL))); + tempSampleL += (bL[17] * (0.12821526330916558 + (0.02636238376777800*applyconvL))); + tempSampleL += (bL[18] * (0.19933812710210136 - (0.02932657234709721*applyconvL))); + tempSampleL += (bL[19] * (0.18346460191225772 - (0.12859581955080629*applyconvL))); + tempSampleL -= (bL[20] * (0.00088697526755385 + (0.15855257539277415*applyconvL))); + tempSampleL -= (bL[21] * (0.28904286712096761 + (0.06226286786982616*applyconvL))); + tempSampleL -= (bL[22] * (0.49133546282552537 - (0.06512851581813534*applyconvL))); + tempSampleL -= (bL[23] * (0.52908013030763046 - (0.13606992188523465*applyconvL))); + tempSampleL -= (bL[24] * (0.45897241332311706 - (0.15527194946346906*applyconvL))); + tempSampleL -= (bL[25] * (0.35535938629924352 - (0.13634771941703441*applyconvL))); + tempSampleL -= (bL[26] * (0.26185269405237693 - (0.08736651482771546*applyconvL))); + tempSampleL -= (bL[27] * (0.19997351944186473 - (0.01714565029656306*applyconvL))); + tempSampleL -= (bL[28] * (0.18894054145105646 + (0.04557612705740050*applyconvL))); + tempSampleL -= (bL[29] * (0.24043993691153928 + (0.05267500387081067*applyconvL))); + tempSampleL -= (bL[30] * (0.29191852873822671 + (0.01922151122971644*applyconvL))); + tempSampleL -= (bL[31] * (0.29399783430587761 - (0.02238952856106585*applyconvL))); + tempSampleL -= (bL[32] * (0.26662219155294159 - (0.07760819463416335*applyconvL))); + tempSampleL -= (bL[33] * (0.20881206667122221 - (0.11930017354479640*applyconvL))); + tempSampleL -= (bL[34] * (0.12916658879944876 - (0.11798638949823513*applyconvL))); + tempSampleL -= (bL[35] * (0.07678815166012012 - (0.06826864734598684*applyconvL))); + tempSampleL -= (bL[36] * (0.08568505484529348 - (0.00510459741104792*applyconvL))); + tempSampleL -= (bL[37] * (0.13613615872486634 + (0.02288223583971244*applyconvL))); + tempSampleL -= (bL[38] * (0.17426657494209266 + (0.02723737220296440*applyconvL))); + tempSampleL -= (bL[39] * (0.17343619261009030 + (0.01412920547179825*applyconvL))); + tempSampleL -= (bL[40] * (0.14548368977428555 - (0.02640418940455951*applyconvL))); + tempSampleL -= (bL[41] * (0.10485295885802372 - (0.06334665781931498*applyconvL))); + tempSampleL -= (bL[42] * (0.06632268974717079 - (0.05960343688612868*applyconvL))); + tempSampleL -= (bL[43] * (0.06915692039882040 - (0.03541337869596061*applyconvL))); + tempSampleL -= (bL[44] * (0.11889611687783583 - (0.02250608307287119*applyconvL))); + tempSampleL -= (bL[45] * (0.14598456370320673 + (0.00280345943128246*applyconvL))); + tempSampleL -= (bL[46] * (0.12312084125613143 + (0.04947283933434576*applyconvL))); + tempSampleL -= (bL[47] * (0.11379940289994711 + (0.06590080966570636*applyconvL))); + tempSampleL -= (bL[48] * (0.12963290754003182 + (0.02597647654256477*applyconvL))); + tempSampleL -= (bL[49] * (0.12723837402978638 - (0.04942071966927938*applyconvL))); + tempSampleL -= (bL[50] * (0.09185015882996231 - (0.10420810015956679*applyconvL))); + tempSampleL -= (bL[51] * (0.04011592913036545 - (0.10234174227772008*applyconvL))); + tempSampleL += (bL[52] * (0.00992597785057113 + (0.05674042373836896*applyconvL))); + tempSampleL += (bL[53] * (0.04921452178306781 - (0.00222698867111080*applyconvL))); + tempSampleL += (bL[54] * (0.06096504883783566 - (0.04040426549982253*applyconvL))); + tempSampleL += (bL[55] * (0.04113530718724200 - (0.04190143593049960*applyconvL))); + tempSampleL += (bL[56] * (0.01292699017654650 - (0.01121994018532499*applyconvL))); + tempSampleL -= (bL[57] * (0.00437123132431870 - (0.02482497612289103*applyconvL))); + tempSampleL -= (bL[58] * (0.02090571264211918 - (0.03732746039260295*applyconvL))); + tempSampleL -= (bL[59] * (0.04749751678612051 - (0.02960060937328099*applyconvL))); + tempSampleL -= (bL[60] * (0.07675095194206227 - (0.02241927084099648*applyconvL))); + tempSampleL -= (bL[61] * (0.08879414028581609 - (0.01144281133042115*applyconvL))); + tempSampleL -= (bL[62] * (0.07378854974999530 + (0.02518742701599147*applyconvL))); + tempSampleL -= (bL[63] * (0.04677309194488959 + (0.08984657372223502*applyconvL))); + tempSampleL -= (bL[64] * (0.02911874044176449 + (0.14202665940555093*applyconvL))); + tempSampleL -= (bL[65] * (0.02103564720234969 + (0.14640411976171003*applyconvL))); + tempSampleL -= (bL[66] * (0.01940626429101940 + (0.10867274382865903*applyconvL))); + tempSampleL -= (bL[67] * (0.03965401793931531 + (0.04775225375522835*applyconvL))); + tempSampleL -= (bL[68] * (0.08102486457314527 - (0.03204447425666343*applyconvL))); + tempSampleL -= (bL[69] * (0.11794849372825778 - (0.12755667382696789*applyconvL))); + tempSampleL -= (bL[70] * (0.11946469076758266 - (0.20151394599125422*applyconvL))); + tempSampleL -= (bL[71] * (0.07404630324668053 - (0.21300634351769704*applyconvL))); + tempSampleL -= (bL[72] * (0.00477584437144086 - (0.16864707684978708*applyconvL))); + tempSampleL += (bL[73] * (0.05924822014377220 + (0.09394651445109450*applyconvL))); + tempSampleL += (bL[74] * (0.10060989907457370 + (0.00419196431884887*applyconvL))); + tempSampleL += (bL[75] * (0.10817907203844988 - (0.07459664480796091*applyconvL))); + tempSampleL += (bL[76] * (0.08701102204768002 - (0.11129477437630560*applyconvL))); + tempSampleL += (bL[77] * (0.05673785623180162 - (0.10638640242375266*applyconvL))); + tempSampleL += (bL[78] * (0.02944190197442081 - (0.08499792583420167*applyconvL))); + tempSampleL += (bL[79] * (0.01570145445652971 - (0.06190456843465320*applyconvL))); + tempSampleL += (bL[80] * (0.02770233032476748 - (0.04573713136865480*applyconvL))); + tempSampleL += (bL[81] * (0.05417160459175360 - (0.03965651064634598*applyconvL))); + tempSampleL += (bL[82] * (0.06080831637644498 - (0.02909500789113911*applyconvL))); + //begin SmallCombo conv R + tempSampleR += (bR[1] * (1.42133070619855229 - (0.18270903813104500*applyconvR))); + tempSampleR += (bR[2] * (1.47209686171873821 - (0.27954009590498585*applyconvR))); + tempSampleR += (bR[3] * (1.34648011331265294 - (0.47178343556301960*applyconvR))); + tempSampleR += (bR[4] * (0.82133804036124580 - (0.41060189990353935*applyconvR))); + tempSampleR += (bR[5] * (0.21628057120466901 - (0.26062442734317454*applyconvR))); + tempSampleR -= (bR[6] * (0.30306716082877883 + (0.10067648425439185*applyconvR))); + tempSampleR -= (bR[7] * (0.69484313178531876 - (0.09655574841702286*applyconvR))); + tempSampleR -= (bR[8] * (0.88320822356980833 - (0.26501644327144314*applyconvR))); + tempSampleR -= (bR[9] * (0.81326147029423723 - (0.31115926837054075*applyconvR))); + tempSampleR -= (bR[10] * (0.56728759049069222 - (0.23304233545561287*applyconvR))); + tempSampleR -= (bR[11] * (0.33340326645198737 - (0.12361361388240180*applyconvR))); + tempSampleR -= (bR[12] * (0.20280263733605616 - (0.03531960962500105*applyconvR))); + tempSampleR -= (bR[13] * (0.15864533788751345 + (0.00355160825317868*applyconvR))); + tempSampleR -= (bR[14] * (0.12544767480555119 + (0.01979010423176500*applyconvR))); + tempSampleR -= (bR[15] * (0.06666788902658917 + (0.00188830739903378*applyconvR))); + tempSampleR += (bR[16] * (0.02977793355081072 + (0.02304216615605394*applyconvR))); + tempSampleR += (bR[17] * (0.12821526330916558 + (0.02636238376777800*applyconvR))); + tempSampleR += (bR[18] * (0.19933812710210136 - (0.02932657234709721*applyconvR))); + tempSampleR += (bR[19] * (0.18346460191225772 - (0.12859581955080629*applyconvR))); + tempSampleR -= (bR[20] * (0.00088697526755385 + (0.15855257539277415*applyconvR))); + tempSampleR -= (bR[21] * (0.28904286712096761 + (0.06226286786982616*applyconvR))); + tempSampleR -= (bR[22] * (0.49133546282552537 - (0.06512851581813534*applyconvR))); + tempSampleR -= (bR[23] * (0.52908013030763046 - (0.13606992188523465*applyconvR))); + tempSampleR -= (bR[24] * (0.45897241332311706 - (0.15527194946346906*applyconvR))); + tempSampleR -= (bR[25] * (0.35535938629924352 - (0.13634771941703441*applyconvR))); + tempSampleR -= (bR[26] * (0.26185269405237693 - (0.08736651482771546*applyconvR))); + tempSampleR -= (bR[27] * (0.19997351944186473 - (0.01714565029656306*applyconvR))); + tempSampleR -= (bR[28] * (0.18894054145105646 + (0.04557612705740050*applyconvR))); + tempSampleR -= (bR[29] * (0.24043993691153928 + (0.05267500387081067*applyconvR))); + tempSampleR -= (bR[30] * (0.29191852873822671 + (0.01922151122971644*applyconvR))); + tempSampleR -= (bR[31] * (0.29399783430587761 - (0.02238952856106585*applyconvR))); + tempSampleR -= (bR[32] * (0.26662219155294159 - (0.07760819463416335*applyconvR))); + tempSampleR -= (bR[33] * (0.20881206667122221 - (0.11930017354479640*applyconvR))); + tempSampleR -= (bR[34] * (0.12916658879944876 - (0.11798638949823513*applyconvR))); + tempSampleR -= (bR[35] * (0.07678815166012012 - (0.06826864734598684*applyconvR))); + tempSampleR -= (bR[36] * (0.08568505484529348 - (0.00510459741104792*applyconvR))); + tempSampleR -= (bR[37] * (0.13613615872486634 + (0.02288223583971244*applyconvR))); + tempSampleR -= (bR[38] * (0.17426657494209266 + (0.02723737220296440*applyconvR))); + tempSampleR -= (bR[39] * (0.17343619261009030 + (0.01412920547179825*applyconvR))); + tempSampleR -= (bR[40] * (0.14548368977428555 - (0.02640418940455951*applyconvR))); + tempSampleR -= (bR[41] * (0.10485295885802372 - (0.06334665781931498*applyconvR))); + tempSampleR -= (bR[42] * (0.06632268974717079 - (0.05960343688612868*applyconvR))); + tempSampleR -= (bR[43] * (0.06915692039882040 - (0.03541337869596061*applyconvR))); + tempSampleR -= (bR[44] * (0.11889611687783583 - (0.02250608307287119*applyconvR))); + tempSampleR -= (bR[45] * (0.14598456370320673 + (0.00280345943128246*applyconvR))); + tempSampleR -= (bR[46] * (0.12312084125613143 + (0.04947283933434576*applyconvR))); + tempSampleR -= (bR[47] * (0.11379940289994711 + (0.06590080966570636*applyconvR))); + tempSampleR -= (bR[48] * (0.12963290754003182 + (0.02597647654256477*applyconvR))); + tempSampleR -= (bR[49] * (0.12723837402978638 - (0.04942071966927938*applyconvR))); + tempSampleR -= (bR[50] * (0.09185015882996231 - (0.10420810015956679*applyconvR))); + tempSampleR -= (bR[51] * (0.04011592913036545 - (0.10234174227772008*applyconvR))); + tempSampleR += (bR[52] * (0.00992597785057113 + (0.05674042373836896*applyconvR))); + tempSampleR += (bR[53] * (0.04921452178306781 - (0.00222698867111080*applyconvR))); + tempSampleR += (bR[54] * (0.06096504883783566 - (0.04040426549982253*applyconvR))); + tempSampleR += (bR[55] * (0.04113530718724200 - (0.04190143593049960*applyconvR))); + tempSampleR += (bR[56] * (0.01292699017654650 - (0.01121994018532499*applyconvR))); + tempSampleR -= (bR[57] * (0.00437123132431870 - (0.02482497612289103*applyconvR))); + tempSampleR -= (bR[58] * (0.02090571264211918 - (0.03732746039260295*applyconvR))); + tempSampleR -= (bR[59] * (0.04749751678612051 - (0.02960060937328099*applyconvR))); + tempSampleR -= (bR[60] * (0.07675095194206227 - (0.02241927084099648*applyconvR))); + tempSampleR -= (bR[61] * (0.08879414028581609 - (0.01144281133042115*applyconvR))); + tempSampleR -= (bR[62] * (0.07378854974999530 + (0.02518742701599147*applyconvR))); + tempSampleR -= (bR[63] * (0.04677309194488959 + (0.08984657372223502*applyconvR))); + tempSampleR -= (bR[64] * (0.02911874044176449 + (0.14202665940555093*applyconvR))); + tempSampleR -= (bR[65] * (0.02103564720234969 + (0.14640411976171003*applyconvR))); + tempSampleR -= (bR[66] * (0.01940626429101940 + (0.10867274382865903*applyconvR))); + tempSampleR -= (bR[67] * (0.03965401793931531 + (0.04775225375522835*applyconvR))); + tempSampleR -= (bR[68] * (0.08102486457314527 - (0.03204447425666343*applyconvR))); + tempSampleR -= (bR[69] * (0.11794849372825778 - (0.12755667382696789*applyconvR))); + tempSampleR -= (bR[70] * (0.11946469076758266 - (0.20151394599125422*applyconvR))); + tempSampleR -= (bR[71] * (0.07404630324668053 - (0.21300634351769704*applyconvR))); + tempSampleR -= (bR[72] * (0.00477584437144086 - (0.16864707684978708*applyconvR))); + tempSampleR += (bR[73] * (0.05924822014377220 + (0.09394651445109450*applyconvR))); + tempSampleR += (bR[74] * (0.10060989907457370 + (0.00419196431884887*applyconvR))); + tempSampleR += (bR[75] * (0.10817907203844988 - (0.07459664480796091*applyconvR))); + tempSampleR += (bR[76] * (0.08701102204768002 - (0.11129477437630560*applyconvR))); + tempSampleR += (bR[77] * (0.05673785623180162 - (0.10638640242375266*applyconvR))); + tempSampleR += (bR[78] * (0.02944190197442081 - (0.08499792583420167*applyconvR))); + tempSampleR += (bR[79] * (0.01570145445652971 - (0.06190456843465320*applyconvR))); + tempSampleR += (bR[80] * (0.02770233032476748 - (0.04573713136865480*applyconvR))); + tempSampleR += (bR[81] * (0.05417160459175360 - (0.03965651064634598*applyconvR))); + tempSampleR += (bR[82] * (0.06080831637644498 - (0.02909500789113911*applyconvR))); + //end SmallCombo conv + break; + case 6: + //begin Bass conv L + tempSampleL += (bL[1] * (1.35472031405494242 + (0.00220914099195157*applyconvL))); + tempSampleL += (bL[2] * (1.63534207755253003 - (0.11406232654509685*applyconvL))); + tempSampleL += (bL[3] * (1.82334575691525869 - (0.42647194712964054*applyconvL))); + tempSampleL += (bL[4] * (1.86156386235405868 - (0.76744187887586590*applyconvL))); + tempSampleL += (bL[5] * (1.67332739338852599 - (0.95161997324293013*applyconvL))); + tempSampleL += (bL[6] * (1.25054130794899021 - (0.98410433514572859*applyconvL))); + tempSampleL += (bL[7] * (0.70049121047281737 - (0.87375612110718992*applyconvL))); + tempSampleL += (bL[8] * (0.15291791448081560 - (0.61195266024519046*applyconvL))); + tempSampleL -= (bL[9] * (0.37301992914152693 + (0.16755422915252094*applyconvL))); + tempSampleL -= (bL[10] * (0.76568539228498433 - (0.28554435228965386*applyconvL))); + tempSampleL -= (bL[11] * (0.95726568749937369 - (0.61659719162806048*applyconvL))); + tempSampleL -= (bL[12] * (1.01273552193911032 - (0.81827288407943954*applyconvL))); + tempSampleL -= (bL[13] * (0.93920108117234447 - (0.80077111864205874*applyconvL))); + tempSampleL -= (bL[14] * (0.79831898832953974 - (0.65814750339694406*applyconvL))); + tempSampleL -= (bL[15] * (0.64200088100452313 - (0.46135833001232618*applyconvL))); + tempSampleL -= (bL[16] * (0.48807302802822128 - (0.15506178974799034*applyconvL))); + tempSampleL -= (bL[17] * (0.36545171501947982 + (0.16126103769376721*applyconvL))); + tempSampleL -= (bL[18] * (0.31469581455759105 + (0.32250870039053953*applyconvL))); + tempSampleL -= (bL[19] * (0.36893534817945800 + (0.25409418897237473*applyconvL))); + tempSampleL -= (bL[20] * (0.41092557722975687 + (0.13114730488878301*applyconvL))); + tempSampleL -= (bL[21] * (0.38584044480710594 + (0.06825323739722661*applyconvL))); + tempSampleL -= (bL[22] * (0.33378434007178670 + (0.04144255489164217*applyconvL))); + tempSampleL -= (bL[23] * (0.26144203061699706 + (0.06031313105098152*applyconvL))); + tempSampleL -= (bL[24] * (0.25818342000920502 + (0.03642289242586355*applyconvL))); + tempSampleL -= (bL[25] * (0.28096018498822661 + (0.00976973667327174*applyconvL))); + tempSampleL -= (bL[26] * (0.25845682019095384 + (0.02749015358080831*applyconvL))); + tempSampleL -= (bL[27] * (0.26655607865953096 - (0.00329839675455690*applyconvL))); + tempSampleL -= (bL[28] * (0.30590085026938518 - (0.07375043215328811*applyconvL))); + tempSampleL -= (bL[29] * (0.32875683916470899 - (0.12454134857516502*applyconvL))); + tempSampleL -= (bL[30] * (0.38166643180506560 - (0.19973911428609989*applyconvL))); + tempSampleL -= (bL[31] * (0.49068186937289598 - (0.34785166842136384*applyconvL))); + tempSampleL -= (bL[32] * (0.60274753867622777 - (0.48685038872711034*applyconvL))); + tempSampleL -= (bL[33] * (0.65944678627090636 - (0.49844657885975518*applyconvL))); + tempSampleL -= (bL[34] * (0.64488955808717285 - (0.40514406499806987*applyconvL))); + tempSampleL -= (bL[35] * (0.55818730353434354 - (0.28029870614987346*applyconvL))); + tempSampleL -= (bL[36] * (0.43110859113387556 - (0.15373504582939335*applyconvL))); + tempSampleL -= (bL[37] * (0.37726894966096269 - (0.11570983506028532*applyconvL))); + tempSampleL -= (bL[38] * (0.39953242355200935 - (0.17879231130484088*applyconvL))); + tempSampleL -= (bL[39] * (0.36726676379100875 - (0.22013553023983223*applyconvL))); + tempSampleL -= (bL[40] * (0.27187029469227386 - (0.18461171768478427*applyconvL))); + tempSampleL -= (bL[41] * (0.21109334552321635 - (0.14497481318083569*applyconvL))); + tempSampleL -= (bL[42] * (0.19808797405293213 - (0.14916579928186940*applyconvL))); + tempSampleL -= (bL[43] * (0.16287926785495671 - (0.15146098461120627*applyconvL))); + tempSampleL -= (bL[44] * (0.11086621477163359 - (0.13182973443924018*applyconvL))); + tempSampleL -= (bL[45] * (0.07531043236890560 - (0.08062172796472888*applyconvL))); + tempSampleL -= (bL[46] * (0.01747364473230771 + (0.02201865873632456*applyconvL))); + tempSampleL += (bL[47] * (0.03080279125662693 - (0.08721756240972101*applyconvL))); + tempSampleL += (bL[48] * (0.02354148659185142 - (0.06376361763053796*applyconvL))); + tempSampleL -= (bL[49] * (0.02835772372098715 + (0.00589978513642627*applyconvL))); + tempSampleL -= (bL[50] * (0.08983370744565244 - (0.02350960427706536*applyconvL))); + tempSampleL -= (bL[51] * (0.14148947620055380 - (0.03329826628693369*applyconvL))); + tempSampleL -= (bL[52] * (0.17576502674572581 - (0.06507546651241880*applyconvL))); + tempSampleL -= (bL[53] * (0.17168865666573860 - (0.07734801128437317*applyconvL))); + tempSampleL -= (bL[54] * (0.14107027738292105 - (0.03136459344220402*applyconvL))); + tempSampleL -= (bL[55] * (0.12287163395380074 + (0.01933408169185258*applyconvL))); + tempSampleL -= (bL[56] * (0.12276622398112971 + (0.01983508766241737*applyconvL))); + tempSampleL -= (bL[57] * (0.12349721440213673 - (0.01111031415304768*applyconvL))); + tempSampleL -= (bL[58] * (0.08649454142716655 + (0.02252815645513927*applyconvL))); + tempSampleL -= (bL[59] * (0.00953083685474757 + (0.13778878548343007*applyconvL))); + tempSampleL += (bL[60] * (0.06045983158868478 - (0.23966318224935096*applyconvL))); + tempSampleL += (bL[61] * (0.09053229817093242 - (0.27190119941572544*applyconvL))); + tempSampleL += (bL[62] * (0.08112662178843048 - (0.22456862606452327*applyconvL))); + tempSampleL += (bL[63] * (0.07503525686243730 - (0.14330154410548213*applyconvL))); + tempSampleL += (bL[64] * (0.07372595404399729 - (0.06185193766408734*applyconvL))); + tempSampleL += (bL[65] * (0.06073789200080433 + (0.01261857435786178*applyconvL))); + tempSampleL += (bL[66] * (0.04616712695742254 + (0.05851771967084609*applyconvL))); + tempSampleL += (bL[67] * (0.01036235510345900 + (0.08286534414423796*applyconvL))); + tempSampleL -= (bL[68] * (0.03708389413229191 - (0.06695282381039531*applyconvL))); + tempSampleL -= (bL[69] * (0.07092204876981217 - (0.01915829199112784*applyconvL))); + tempSampleL -= (bL[70] * (0.09443579589460312 + (0.01210082455316246*applyconvL))); + tempSampleL -= (bL[71] * (0.07824038577769601 + (0.06121988546065113*applyconvL))); + tempSampleL -= (bL[72] * (0.00854730633079399 + (0.14468518752295506*applyconvL))); + tempSampleL += (bL[73] * (0.06845589924191028 - (0.18902431382592944*applyconvL))); + tempSampleL += (bL[74] * (0.10351569998375465 - (0.13204443060279647*applyconvL))); + tempSampleL += (bL[75] * (0.10513368758532179 - (0.02993199294485649*applyconvL))); + tempSampleL += (bL[76] * (0.08896978950235003 + (0.04074499273825906*applyconvL))); + tempSampleL += (bL[77] * (0.03697537734050980 + (0.09217751130846838*applyconvL))); + tempSampleL -= (bL[78] * (0.04014322441280276 - (0.14062297149365666*applyconvL))); + tempSampleL -= (bL[79] * (0.10505934581398618 - (0.16988861157275814*applyconvL))); + tempSampleL -= (bL[80] * (0.13937661651676272 - (0.15083294570551492*applyconvL))); + tempSampleL -= (bL[81] * (0.13183458845108439 - (0.06657454442471208*applyconvL))); + //begin Bass conv R + tempSampleR += (bR[1] * (1.35472031405494242 + (0.00220914099195157*applyconvR))); + tempSampleR += (bR[2] * (1.63534207755253003 - (0.11406232654509685*applyconvR))); + tempSampleR += (bR[3] * (1.82334575691525869 - (0.42647194712964054*applyconvR))); + tempSampleR += (bR[4] * (1.86156386235405868 - (0.76744187887586590*applyconvR))); + tempSampleR += (bR[5] * (1.67332739338852599 - (0.95161997324293013*applyconvR))); + tempSampleR += (bR[6] * (1.25054130794899021 - (0.98410433514572859*applyconvR))); + tempSampleR += (bR[7] * (0.70049121047281737 - (0.87375612110718992*applyconvR))); + tempSampleR += (bR[8] * (0.15291791448081560 - (0.61195266024519046*applyconvR))); + tempSampleR -= (bR[9] * (0.37301992914152693 + (0.16755422915252094*applyconvR))); + tempSampleR -= (bR[10] * (0.76568539228498433 - (0.28554435228965386*applyconvR))); + tempSampleR -= (bR[11] * (0.95726568749937369 - (0.61659719162806048*applyconvR))); + tempSampleR -= (bR[12] * (1.01273552193911032 - (0.81827288407943954*applyconvR))); + tempSampleR -= (bR[13] * (0.93920108117234447 - (0.80077111864205874*applyconvR))); + tempSampleR -= (bR[14] * (0.79831898832953974 - (0.65814750339694406*applyconvR))); + tempSampleR -= (bR[15] * (0.64200088100452313 - (0.46135833001232618*applyconvR))); + tempSampleR -= (bR[16] * (0.48807302802822128 - (0.15506178974799034*applyconvR))); + tempSampleR -= (bR[17] * (0.36545171501947982 + (0.16126103769376721*applyconvR))); + tempSampleR -= (bR[18] * (0.31469581455759105 + (0.32250870039053953*applyconvR))); + tempSampleR -= (bR[19] * (0.36893534817945800 + (0.25409418897237473*applyconvR))); + tempSampleR -= (bR[20] * (0.41092557722975687 + (0.13114730488878301*applyconvR))); + tempSampleR -= (bR[21] * (0.38584044480710594 + (0.06825323739722661*applyconvR))); + tempSampleR -= (bR[22] * (0.33378434007178670 + (0.04144255489164217*applyconvR))); + tempSampleR -= (bR[23] * (0.26144203061699706 + (0.06031313105098152*applyconvR))); + tempSampleR -= (bR[24] * (0.25818342000920502 + (0.03642289242586355*applyconvR))); + tempSampleR -= (bR[25] * (0.28096018498822661 + (0.00976973667327174*applyconvR))); + tempSampleR -= (bR[26] * (0.25845682019095384 + (0.02749015358080831*applyconvR))); + tempSampleR -= (bR[27] * (0.26655607865953096 - (0.00329839675455690*applyconvR))); + tempSampleR -= (bR[28] * (0.30590085026938518 - (0.07375043215328811*applyconvR))); + tempSampleR -= (bR[29] * (0.32875683916470899 - (0.12454134857516502*applyconvR))); + tempSampleR -= (bR[30] * (0.38166643180506560 - (0.19973911428609989*applyconvR))); + tempSampleR -= (bR[31] * (0.49068186937289598 - (0.34785166842136384*applyconvR))); + tempSampleR -= (bR[32] * (0.60274753867622777 - (0.48685038872711034*applyconvR))); + tempSampleR -= (bR[33] * (0.65944678627090636 - (0.49844657885975518*applyconvR))); + tempSampleR -= (bR[34] * (0.64488955808717285 - (0.40514406499806987*applyconvR))); + tempSampleR -= (bR[35] * (0.55818730353434354 - (0.28029870614987346*applyconvR))); + tempSampleR -= (bR[36] * (0.43110859113387556 - (0.15373504582939335*applyconvR))); + tempSampleR -= (bR[37] * (0.37726894966096269 - (0.11570983506028532*applyconvR))); + tempSampleR -= (bR[38] * (0.39953242355200935 - (0.17879231130484088*applyconvR))); + tempSampleR -= (bR[39] * (0.36726676379100875 - (0.22013553023983223*applyconvR))); + tempSampleR -= (bR[40] * (0.27187029469227386 - (0.18461171768478427*applyconvR))); + tempSampleR -= (bR[41] * (0.21109334552321635 - (0.14497481318083569*applyconvR))); + tempSampleR -= (bR[42] * (0.19808797405293213 - (0.14916579928186940*applyconvR))); + tempSampleR -= (bR[43] * (0.16287926785495671 - (0.15146098461120627*applyconvR))); + tempSampleR -= (bR[44] * (0.11086621477163359 - (0.13182973443924018*applyconvR))); + tempSampleR -= (bR[45] * (0.07531043236890560 - (0.08062172796472888*applyconvR))); + tempSampleR -= (bR[46] * (0.01747364473230771 + (0.02201865873632456*applyconvR))); + tempSampleR += (bR[47] * (0.03080279125662693 - (0.08721756240972101*applyconvR))); + tempSampleR += (bR[48] * (0.02354148659185142 - (0.06376361763053796*applyconvR))); + tempSampleR -= (bR[49] * (0.02835772372098715 + (0.00589978513642627*applyconvR))); + tempSampleR -= (bR[50] * (0.08983370744565244 - (0.02350960427706536*applyconvR))); + tempSampleR -= (bR[51] * (0.14148947620055380 - (0.03329826628693369*applyconvR))); + tempSampleR -= (bR[52] * (0.17576502674572581 - (0.06507546651241880*applyconvR))); + tempSampleR -= (bR[53] * (0.17168865666573860 - (0.07734801128437317*applyconvR))); + tempSampleR -= (bR[54] * (0.14107027738292105 - (0.03136459344220402*applyconvR))); + tempSampleR -= (bR[55] * (0.12287163395380074 + (0.01933408169185258*applyconvR))); + tempSampleR -= (bR[56] * (0.12276622398112971 + (0.01983508766241737*applyconvR))); + tempSampleR -= (bR[57] * (0.12349721440213673 - (0.01111031415304768*applyconvR))); + tempSampleR -= (bR[58] * (0.08649454142716655 + (0.02252815645513927*applyconvR))); + tempSampleR -= (bR[59] * (0.00953083685474757 + (0.13778878548343007*applyconvR))); + tempSampleR += (bR[60] * (0.06045983158868478 - (0.23966318224935096*applyconvR))); + tempSampleR += (bR[61] * (0.09053229817093242 - (0.27190119941572544*applyconvR))); + tempSampleR += (bR[62] * (0.08112662178843048 - (0.22456862606452327*applyconvR))); + tempSampleR += (bR[63] * (0.07503525686243730 - (0.14330154410548213*applyconvR))); + tempSampleR += (bR[64] * (0.07372595404399729 - (0.06185193766408734*applyconvR))); + tempSampleR += (bR[65] * (0.06073789200080433 + (0.01261857435786178*applyconvR))); + tempSampleR += (bR[66] * (0.04616712695742254 + (0.05851771967084609*applyconvR))); + tempSampleR += (bR[67] * (0.01036235510345900 + (0.08286534414423796*applyconvR))); + tempSampleR -= (bR[68] * (0.03708389413229191 - (0.06695282381039531*applyconvR))); + tempSampleR -= (bR[69] * (0.07092204876981217 - (0.01915829199112784*applyconvR))); + tempSampleR -= (bR[70] * (0.09443579589460312 + (0.01210082455316246*applyconvR))); + tempSampleR -= (bR[71] * (0.07824038577769601 + (0.06121988546065113*applyconvR))); + tempSampleR -= (bR[72] * (0.00854730633079399 + (0.14468518752295506*applyconvR))); + tempSampleR += (bR[73] * (0.06845589924191028 - (0.18902431382592944*applyconvR))); + tempSampleR += (bR[74] * (0.10351569998375465 - (0.13204443060279647*applyconvR))); + tempSampleR += (bR[75] * (0.10513368758532179 - (0.02993199294485649*applyconvR))); + tempSampleR += (bR[76] * (0.08896978950235003 + (0.04074499273825906*applyconvR))); + tempSampleR += (bR[77] * (0.03697537734050980 + (0.09217751130846838*applyconvR))); + tempSampleR -= (bR[78] * (0.04014322441280276 - (0.14062297149365666*applyconvR))); + tempSampleR -= (bR[79] * (0.10505934581398618 - (0.16988861157275814*applyconvR))); + tempSampleR -= (bR[80] * (0.13937661651676272 - (0.15083294570551492*applyconvR))); + tempSampleR -= (bR[81] * (0.13183458845108439 - (0.06657454442471208*applyconvR))); + //end Bass conv + break; + } + inputSampleL *= correctdrygain; + inputSampleL += (tempSampleL*colorIntensity); + inputSampleL /= correctboost; + ataHalfwaySampleL += inputSampleL; //-------------------- + inputSampleR *= correctdrygain; + inputSampleR += (tempSampleR*colorIntensity); + inputSampleR /= correctboost; + ataHalfwaySampleR += inputSampleR; + //restore interpolated signal including time domain stuff now + //end center code for handling timedomain/conv stuff + + //second wave of Cabs style slew clamping + clamp = inputSampleL - lastPostSampleL; + if (clamp > threshold) inputSampleL = lastPostSampleL + threshold; + if (-clamp > rarefaction) inputSampleL = lastPostSampleL - rarefaction; + lastPostSampleL = inputSampleL; //------------------------------------- + clamp = inputSampleR - lastPostSampleR; + if (clamp > threshold) inputSampleR = lastPostSampleR + threshold; + if (-clamp > rarefaction) inputSampleR = lastPostSampleR - rarefaction; + lastPostSampleR = inputSampleR; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySampleL - lastPostHalfSampleL; + if (clamp > threshold) ataHalfwaySampleL = lastPostHalfSampleL + threshold; + if (-clamp > rarefaction) ataHalfwaySampleL = lastPostHalfSampleL - rarefaction; + lastPostHalfSampleL = ataHalfwaySampleL; //---------------------------------- + clamp = ataHalfwaySampleR - lastPostHalfSampleR; + if (clamp > threshold) ataHalfwaySampleR = lastPostHalfSampleR + threshold; + if (-clamp > rarefaction) ataHalfwaySampleR = lastPostHalfSampleR - rarefaction; + lastPostHalfSampleR = ataHalfwaySampleR; + //end interpolated sample + + //post-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double HeadBumpL; + double HeadBumpR; + if (flip) + { + iirHeadBumpAL += (inputSampleL * HeadBumpFreq); + iirHeadBumpAL -= (iirHeadBumpAL * iirHeadBumpAL * iirHeadBumpAL * HeadBumpFreq); + if (iirHeadBumpAL > 0) iirHeadBumpAL -= dcblock; + if (iirHeadBumpAL < 0) iirHeadBumpAL += dcblock; + if (fabs(iirHeadBumpAL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHeadBumpAL; //----------------------------------------------- + iirHeadBumpAR += (inputSampleR * HeadBumpFreq); + iirHeadBumpAR -= (iirHeadBumpAR * iirHeadBumpAR * iirHeadBumpAR * HeadBumpFreq); + if (iirHeadBumpAR > 0) iirHeadBumpAR -= dcblock; + if (iirHeadBumpAR < 0) iirHeadBumpAR += dcblock; + if (fabs(iirHeadBumpAR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHeadBumpAR; + } + else + { + iirHeadBumpBL += (inputSampleL * HeadBumpFreq); + iirHeadBumpBL -= (iirHeadBumpBL * iirHeadBumpBL * iirHeadBumpBL * HeadBumpFreq); + if (iirHeadBumpBL > 0) iirHeadBumpBL -= dcblock; + if (iirHeadBumpBL < 0) iirHeadBumpBL += dcblock; + if (fabs(iirHeadBumpBL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHeadBumpBL; //--------------------------------------------------- + iirHeadBumpBR += (inputSampleR * HeadBumpFreq); + iirHeadBumpBR -= (iirHeadBumpBR * iirHeadBumpBR * iirHeadBumpBR * HeadBumpFreq); + if (iirHeadBumpBR > 0) iirHeadBumpBR -= dcblock; + if (iirHeadBumpBR < 0) iirHeadBumpBR += dcblock; + if (fabs(iirHeadBumpBR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHeadBumpBR; + } + HeadBumpL /= LowsPad; + inputSampleL = (inputSampleL * (1.0-heavy)) + (HeadBumpL * heavy); //--------------------- + HeadBumpR /= LowsPad; + inputSampleR = (inputSampleR * (1.0-heavy)) + (HeadBumpR * heavy); + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + if (flip) + { + iirHalfHeadBumpAL += (ataHalfwaySampleL * HeadBumpFreq); + iirHalfHeadBumpAL -= (iirHalfHeadBumpAL * iirHalfHeadBumpAL * iirHalfHeadBumpAL * HeadBumpFreq); + if (iirHalfHeadBumpAL > 0) iirHalfHeadBumpAL -= dcblock; + if (iirHalfHeadBumpAL < 0) iirHalfHeadBumpAL += dcblock; + if (fabs(iirHalfHeadBumpAL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHalfHeadBumpAL; //------------------------------------------------------ + iirHalfHeadBumpAR += (ataHalfwaySampleR * HeadBumpFreq); + iirHalfHeadBumpAR -= (iirHalfHeadBumpAR * iirHalfHeadBumpAR * iirHalfHeadBumpAR * HeadBumpFreq); + if (iirHalfHeadBumpAR > 0) iirHalfHeadBumpAR -= dcblock; + if (iirHalfHeadBumpAR < 0) iirHalfHeadBumpAR += dcblock; + if (fabs(iirHalfHeadBumpAR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHalfHeadBumpAR; + } + else + { + iirHalfHeadBumpBL += (ataHalfwaySampleL * HeadBumpFreq); + iirHalfHeadBumpBL -= (iirHalfHeadBumpBL * iirHalfHeadBumpBL * iirHalfHeadBumpBL * HeadBumpFreq); + if (iirHalfHeadBumpBL > 0) iirHalfHeadBumpBL -= dcblock; + if (iirHalfHeadBumpBL < 0) iirHalfHeadBumpBL += dcblock; + if (fabs(iirHalfHeadBumpBL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHalfHeadBumpBL; //--------------------------------------------------- + iirHalfHeadBumpBR += (ataHalfwaySampleR * HeadBumpFreq); + iirHalfHeadBumpBR -= (iirHalfHeadBumpBR * iirHalfHeadBumpBR * iirHalfHeadBumpBR * HeadBumpFreq); + if (iirHalfHeadBumpBR > 0) iirHalfHeadBumpBR -= dcblock; + if (iirHalfHeadBumpBR < 0) iirHalfHeadBumpBR += dcblock; + if (fabs(iirHalfHeadBumpBR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHalfHeadBumpBR; + } + HeadBumpL /= LowsPad; + ataHalfwaySampleL = (ataHalfwaySampleL * (1.0-heavy)) + (HeadBumpL * heavy); //-------------------- + HeadBumpR /= LowsPad; + ataHalfwaySampleR = (ataHalfwaySampleR * (1.0-heavy)) + (HeadBumpR * heavy); + //end interpolated sample + + //begin antialiasing section for halfway sample + ataCL = ataHalfwaySampleL - ataHalfDrySampleL; + if (flip) {ataAL *= 0.94; ataBL *= 0.94; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL;} + else {ataBL *= 0.94; ataAL *= 0.94; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL;} + ataHalfDiffSampleL = (ataCL * 0.94); //--------------------------------- + ataCR = ataHalfwaySampleR - ataHalfDrySampleR; + if (flip) {ataAR *= 0.94; ataBR *= 0.94; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR;} + else {ataBR *= 0.94; ataAR *= 0.94; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR;} + ataHalfDiffSampleR = (ataCR * 0.94); + //end antialiasing section for halfway sample + + //begin antialiasing section for raw sample + ataCL = inputSampleL - ataDrySampleL; + if (flip) {ataAL *= 0.94; ataBL *= 0.94; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL;} + else {ataBL *= 0.94; ataAL *= 0.94; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL;} + ataDiffSampleL = (ataCL * 0.94); //----------------------------- + ataCR = inputSampleR - ataDrySampleR; + if (flip) {ataAR *= 0.94; ataBR *= 0.94; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR;} + else {ataBR *= 0.94; ataAR *= 0.94; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR;} + ataDiffSampleR = (ataCR * 0.94); + //end antialiasing section for input sample + flip = !flip; + + inputSampleL = ataDrySampleL; inputSampleL += ((ataDiffSampleL + ataHalfDiffSampleL + ataPrevDiffSampleL) / 1.0); + ataPrevDiffSampleL = ataDiffSampleL / 2.0; //---------------------------- + inputSampleR = ataDrySampleR; inputSampleR += ((ataDiffSampleR + ataHalfDiffSampleR + ataPrevDiffSampleR) / 1.0); + ataPrevDiffSampleR = ataDiffSampleR / 2.0; + //apply processing as difference to non-oversampled raw input + + clamp = inputSampleL - postPostSampleL; + if (clamp > postThreshold) inputSampleL = postPostSampleL + postThreshold; + if (-clamp > postRarefaction) inputSampleL = postPostSampleL - postRarefaction; + postPostSampleL = inputSampleL; + inputSampleL /= postTrim; + inputSampleL *= output; //------------------------------ + clamp = inputSampleR - postPostSampleR; + if (clamp > postThreshold) inputSampleR = postPostSampleR + postThreshold; + if (-clamp > postRarefaction) inputSampleR = postPostSampleR - postRarefaction; + postPostSampleR = inputSampleR; + inputSampleR /= postTrim; + inputSampleR *= output; + + if (cycleEnd == 4) { + lastRefL[0] = lastRefL[4]; //start from previous last + lastRefL[2] = (lastRefL[0] + inputSampleL)/2; //half + lastRefL[1] = (lastRefL[0] + lastRefL[2])/2; //one quarter + lastRefL[3] = (lastRefL[2] + inputSampleL)/2; //three quarters + lastRefL[4] = inputSampleL; //full + lastRefR[0] = lastRefR[4]; //start from previous last + lastRefR[2] = (lastRefR[0] + inputSampleR)/2; //half + lastRefR[1] = (lastRefR[0] + lastRefR[2])/2; //one quarter + lastRefR[3] = (lastRefR[2] + inputSampleR)/2; //three quarters + lastRefR[4] = inputSampleR; //full + } + if (cycleEnd == 3) { + lastRefL[0] = lastRefL[3]; //start from previous last + lastRefL[2] = (lastRefL[0]+lastRefL[0]+inputSampleL)/3; //third + lastRefL[1] = (lastRefL[0]+inputSampleL+inputSampleL)/3; //two thirds + lastRefL[3] = inputSampleL; //full + lastRefR[0] = lastRefR[3]; //start from previous last + lastRefR[2] = (lastRefR[0]+lastRefR[0]+inputSampleR)/3; //third + lastRefR[1] = (lastRefR[0]+inputSampleR+inputSampleR)/3; //two thirds + lastRefR[3] = inputSampleR; //full + } + if (cycleEnd == 2) { + lastRefL[0] = lastRefL[2]; //start from previous last + lastRefL[1] = (lastRefL[0] + inputSampleL)/2; //half + lastRefL[2] = inputSampleL; //full + lastRefR[0] = lastRefR[2]; //start from previous last + lastRefR[1] = (lastRefR[0] + inputSampleR)/2; //half + lastRefR[2] = inputSampleR; //full + } + if (cycleEnd == 1) { + lastRefL[0] = inputSampleL; + lastRefR[0] = inputSampleR; + } + cycle = 0; //reset + inputSampleL = lastRefL[cycle]; + inputSampleR = lastRefR[cycle]; + } else { + inputSampleL = lastRefL[cycle]; + inputSampleR = lastRefR[cycle]; + //we are going through our references now + } + + //begin 32 bit stereo floating point dither + int expon; frexpf((float)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + frexpf((float)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither + + *out1 = inputSampleL; + *out2 = inputSampleR; + + in1++; + in2++; + out1++; + out2++; + } +} + +void Cabs::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + int cycleEnd = floor(overallscale); + if (cycleEnd < 1) cycleEnd = 1; + if (cycleEnd > 4) cycleEnd = 4; + //this is going to be 2 for 88.1 or 96k, 3 for silly people, 4 for 176 or 192k + if (cycle > cycleEnd-1) cycle = cycleEnd-1; //sanity check + + int speaker = (int)A; + double colorIntensity = pow(B,4); + double correctboost = 1.0 + (colorIntensity*4); + double correctdrygain = 1.0 - colorIntensity; + double threshold = pow((1.0-C),5)+0.021; //room loud is slew + double rarefaction = cbrt(threshold); + double postThreshold = sqrt(rarefaction); + double postRarefaction = cbrt(postThreshold); + double postTrim = sqrt(postRarefaction); + double HeadBumpFreq = 0.0298+((1.0-D)/8.0); + double LowsPad = 0.12 + (HeadBumpFreq*12.0); + double dcblock = pow(HeadBumpFreq,2) / 8.0; + double heavy = pow(E,3); //wet of head bump + double output = pow(F,2); + double dynamicconv = 5.0; + dynamicconv *= pow(B,2); + dynamicconv *= pow(C,2); + //set constants for sag speed + int offsetA = 4+((int)(D*5.0)); + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + + cycle++; + if (cycle == cycleEnd) { //hit the end point and we do a chorus sample + //everything in here is undersampled, including the dry/wet + + double ataDrySampleL = inputSampleL; + double ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * 0.05)) / 2.0; + double ataHalfDrySampleL = ataHalfwaySampleL; + ataLast3SampleL = ataLast2SampleL; ataLast2SampleL = ataLast1SampleL; ataLast1SampleL = inputSampleL; //----------------- + double ataDrySampleR = inputSampleR; + double ataHalfwaySampleR = (inputSampleR + ataLast1SampleR + ((-ataLast2SampleR + ataLast3SampleR) * 0.05)) / 2.0; + double ataHalfDrySampleR = ataHalfwaySampleR; + ataLast3SampleR = ataLast2SampleR; ataLast2SampleR = ataLast1SampleR; ataLast1SampleR = inputSampleR; + //setting up oversampled special antialiasing + //pre-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double clamp = inputSampleL - lastSampleL; + if (clamp > threshold) inputSampleL = lastSampleL + threshold; + if (-clamp > rarefaction) inputSampleL = lastSampleL - rarefaction; + lastSampleL = inputSampleL; //---------------------------------------------- + clamp = inputSampleR - lastSampleR; + if (clamp > threshold) inputSampleR = lastSampleR + threshold; + if (-clamp > rarefaction) inputSampleR = lastSampleR - rarefaction; + lastSampleR = inputSampleR; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySampleL - lastHalfSampleL; + if (clamp > threshold) ataHalfwaySampleL = lastHalfSampleL + threshold; + if (-clamp > rarefaction) ataHalfwaySampleL = lastHalfSampleL - rarefaction; + lastHalfSampleL = ataHalfwaySampleL; //------------------------------------------- + clamp = ataHalfwaySampleR - lastHalfSampleR; + if (clamp > threshold) ataHalfwaySampleR = lastHalfSampleR + threshold; + if (-clamp > rarefaction) ataHalfwaySampleR = lastHalfSampleR - rarefaction; + lastHalfSampleR = ataHalfwaySampleR; + //end interpolated sample + + //begin center code handling conv stuff tied to 44.1K, or stuff in time domain like delays + ataHalfwaySampleL -= inputSampleL; + ataHalfwaySampleR -= inputSampleR; + //retain only difference with raw signal + + if (gcount < 0 || gcount > 10) gcount = 10; + + dL[gcount+10] = dL[gcount] = fabs(inputSampleL); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.0001; + if (controlL < 0) controlL = 0; + if (controlL > 13) controlL = 13; //------------------------- + dR[gcount+10] = dR[gcount] = fabs(inputSampleR); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.0001; + if (controlR < 0) controlR = 0; + if (controlR > 13) controlR = 13; + + gcount--; + + double applyconvL = (controlL / offsetA) * dynamicconv; + double applyconvR = (controlR / offsetA) * dynamicconv; + //now we have a 'sag' style average to apply to the conv + bL[82] = bL[81]; bL[81] = bL[80]; bL[80] = bL[79]; + bL[79] = bL[78]; bL[78] = bL[77]; bL[77] = bL[76]; bL[76] = bL[75]; bL[75] = bL[74]; bL[74] = bL[73]; bL[73] = bL[72]; bL[72] = bL[71]; + bL[71] = bL[70]; bL[70] = bL[69]; bL[69] = bL[68]; bL[68] = bL[67]; bL[67] = bL[66]; bL[66] = bL[65]; bL[65] = bL[64]; bL[64] = bL[63]; + bL[63] = bL[62]; bL[62] = bL[61]; bL[61] = bL[60]; bL[60] = bL[59]; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; + bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; + bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; + bL[39] = bL[38]; bL[38] = bL[37]; bL[37] = bL[36]; bL[36] = bL[35]; bL[35] = bL[34]; bL[34] = bL[33]; bL[33] = bL[32]; bL[32] = bL[31]; + bL[31] = bL[30]; bL[30] = bL[29]; bL[29] = bL[28]; bL[28] = bL[27]; bL[27] = bL[26]; bL[26] = bL[25]; bL[25] = bL[24]; bL[24] = bL[23]; + bL[23] = bL[22]; bL[22] = bL[21]; bL[21] = bL[20]; bL[20] = bL[19]; bL[19] = bL[18]; bL[18] = bL[17]; bL[17] = bL[16]; bL[16] = bL[15]; + bL[15] = bL[14]; bL[14] = bL[13]; bL[13] = bL[12]; bL[12] = bL[11]; bL[11] = bL[10]; bL[10] = bL[9]; bL[9] = bL[8]; bL[8] = bL[7]; + bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; bL[1] = bL[0]; bL[0] = inputSampleL; //------- + bR[82] = bR[81]; bR[81] = bR[80]; bR[80] = bR[79]; + bR[79] = bR[78]; bR[78] = bR[77]; bR[77] = bR[76]; bR[76] = bR[75]; bR[75] = bR[74]; bR[74] = bR[73]; bR[73] = bR[72]; bR[72] = bR[71]; + bR[71] = bR[70]; bR[70] = bR[69]; bR[69] = bR[68]; bR[68] = bR[67]; bR[67] = bR[66]; bR[66] = bR[65]; bR[65] = bR[64]; bR[64] = bR[63]; + bR[63] = bR[62]; bR[62] = bR[61]; bR[61] = bR[60]; bR[60] = bR[59]; bR[59] = bR[58]; bR[58] = bR[57]; bR[57] = bR[56]; bR[56] = bR[55]; + bR[55] = bR[54]; bR[54] = bR[53]; bR[53] = bR[52]; bR[52] = bR[51]; bR[51] = bR[50]; bR[50] = bR[49]; bR[49] = bR[48]; bR[48] = bR[47]; + bR[47] = bR[46]; bR[46] = bR[45]; bR[45] = bR[44]; bR[44] = bR[43]; bR[43] = bR[42]; bR[42] = bR[41]; bR[41] = bR[40]; bR[40] = bR[39]; + bR[39] = bR[38]; bR[38] = bR[37]; bR[37] = bR[36]; bR[36] = bR[35]; bR[35] = bR[34]; bR[34] = bR[33]; bR[33] = bR[32]; bR[32] = bR[31]; + bR[31] = bR[30]; bR[30] = bR[29]; bR[29] = bR[28]; bR[28] = bR[27]; bR[27] = bR[26]; bR[26] = bR[25]; bR[25] = bR[24]; bR[24] = bR[23]; + bR[23] = bR[22]; bR[22] = bR[21]; bR[21] = bR[20]; bR[20] = bR[19]; bR[19] = bR[18]; bR[18] = bR[17]; bR[17] = bR[16]; bR[16] = bR[15]; + bR[15] = bR[14]; bR[14] = bR[13]; bR[13] = bR[12]; bR[12] = bR[11]; bR[11] = bR[10]; bR[10] = bR[9]; bR[9] = bR[8]; bR[8] = bR[7]; + bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; bR[1] = bR[0]; bR[0] = inputSampleR; + //load conv + + double tempSampleL = 0.0; //--------- + double tempSampleR = 0.0; //set up for applying the cab sound + switch (speaker) + { + case 1: + //begin HighPowerStack conv L + tempSampleL += (bL[1] * (1.29550481610475132 + (0.19713872057074355*applyconvL))); + tempSampleL += (bL[2] * (1.42302569895462616 + (0.30599505521284787*applyconvL))); + tempSampleL += (bL[3] * (1.28728195804197565 + (0.23168333460446133*applyconvL))); + tempSampleL += (bL[4] * (0.88553784290822690 + (0.14263256172918892*applyconvL))); + tempSampleL += (bL[5] * (0.37129054918432319 + (0.00150040944205920*applyconvL))); + tempSampleL -= (bL[6] * (0.12150959412556320 + (0.32776273620569107*applyconvL))); + tempSampleL -= (bL[7] * (0.44900065463203775 + (0.74101214925298819*applyconvL))); + tempSampleL -= (bL[8] * (0.54058781908186482 + (1.07821707459008387*applyconvL))); + tempSampleL -= (bL[9] * (0.49361966401791391 + (1.23540109014850508*applyconvL))); + tempSampleL -= (bL[10] * (0.39819495093078133 + (1.11247213730917749*applyconvL))); + tempSampleL -= (bL[11] * (0.31379279985435521 + (0.80330360359638298*applyconvL))); + tempSampleL -= (bL[12] * (0.30744359242808555 + (0.42132528876858205*applyconvL))); + tempSampleL -= (bL[13] * (0.33943170284673974 + (0.09183418349389982*applyconvL))); + tempSampleL -= (bL[14] * (0.33838775119286391 - (0.06453051658561271*applyconvL))); + tempSampleL -= (bL[15] * (0.30682305697961665 - (0.09549380253249232*applyconvL))); + tempSampleL -= (bL[16] * (0.23408741339295336 - (0.08083404732361277*applyconvL))); + tempSampleL -= (bL[17] * (0.10411746814025019 + (0.00253651281245780*applyconvL))); + tempSampleL += (bL[18] * (0.00133623776084696 - (0.04447267870865820*applyconvL))); + tempSampleL += (bL[19] * (0.02461903992114161 + (0.07530671732655550*applyconvL))); + tempSampleL += (bL[20] * (0.02086715842475373 + (0.22795860236804899*applyconvL))); + tempSampleL += (bL[21] * (0.02761433637100917 + (0.26108320417844094*applyconvL))); + tempSampleL += (bL[22] * (0.04475285369162533 + (0.19160705011061663*applyconvL))); + tempSampleL += (bL[23] * (0.09447338372862381 + (0.03681550508743799*applyconvL))); + tempSampleL += (bL[24] * (0.13445890343722280 - (0.13713036462146147*applyconvL))); + tempSampleL += (bL[25] * (0.13872868945088121 - (0.22401242373298191*applyconvL))); + tempSampleL += (bL[26] * (0.14915650097434549 - (0.26718804981526367*applyconvL))); + tempSampleL += (bL[27] * (0.12766643217091783 - (0.27745664795660430*applyconvL))); + tempSampleL += (bL[28] * (0.03675849788393101 - (0.18338278173550679*applyconvL))); + tempSampleL -= (bL[29] * (0.06307306864232835 + (0.06089480869040766*applyconvL))); + tempSampleL -= (bL[30] * (0.14947389348962944 + (0.04642103054798480*applyconvL))); + tempSampleL -= (bL[31] * (0.25235266566401526 + (0.08423062596460507*applyconvL))); + tempSampleL -= (bL[32] * (0.33496344048679683 + (0.09808328256677995*applyconvL))); + tempSampleL -= (bL[33] * (0.36590030482175445 + (0.10622650888958179*applyconvL))); + tempSampleL -= (bL[34] * (0.35015197011464372 + (0.08982043516016047*applyconvL))); + tempSampleL -= (bL[35] * (0.26808437585665090 + (0.00735561860229533*applyconvL))); + tempSampleL -= (bL[36] * (0.11624318543291220 - (0.07142484314510467*applyconvL))); + tempSampleL += (bL[37] * (0.05617084165377551 + (0.11785854050350089*applyconvL))); + tempSampleL += (bL[38] * (0.20540028692589385 + (0.20479174663329586*applyconvL))); + tempSampleL += (bL[39] * (0.30455415003043818 + (0.29074864580096849*applyconvL))); + tempSampleL += (bL[40] * (0.33810750937829476 + (0.29182307921316802*applyconvL))); + tempSampleL += (bL[41] * (0.31936133365277430 + (0.26535537727394987*applyconvL))); + tempSampleL += (bL[42] * (0.27388548321981876 + (0.19735049990538350*applyconvL))); + tempSampleL += (bL[43] * (0.21454597517994098 + (0.06415909270247236*applyconvL))); + tempSampleL += (bL[44] * (0.15001045817707717 - (0.03831118543404573*applyconvL))); + tempSampleL += (bL[45] * (0.07283437284653138 - (0.09281952429543777*applyconvL))); + tempSampleL -= (bL[46] * (0.03917872184241358 + (0.14306291461398810*applyconvL))); + tempSampleL -= (bL[47] * (0.16695932032148642 + (0.19138995946950504*applyconvL))); + tempSampleL -= (bL[48] * (0.27055854466909462 + (0.22531296466343192*applyconvL))); + tempSampleL -= (bL[49] * (0.33256357307578271 + (0.23305840475692102*applyconvL))); + tempSampleL -= (bL[50] * (0.33459770116834442 + (0.24091822618917569*applyconvL))); + tempSampleL -= (bL[51] * (0.27156687236338090 + (0.24062938573512443*applyconvL))); + tempSampleL -= (bL[52] * (0.17197093288412094 + (0.19083085091993421*applyconvL))); + tempSampleL -= (bL[53] * (0.06738628195910543 + (0.10268609751019808*applyconvL))); + tempSampleL += (bL[54] * (0.00222429218204290 + (0.01439664435720548*applyconvL))); + tempSampleL += (bL[55] * (0.01346992803494091 + (0.15947137113534526*applyconvL))); + tempSampleL -= (bL[56] * (0.02038911881377448 - (0.26763170752416160*applyconvL))); + tempSampleL -= (bL[57] * (0.08233579178189687 - (0.29415931086406055*applyconvL))); + tempSampleL -= (bL[58] * (0.15447855089824883 - (0.26489186990840807*applyconvL))); + tempSampleL -= (bL[59] * (0.20518281113362655 - (0.16135382257522859*applyconvL))); + tempSampleL -= (bL[60] * (0.22244686050232007 + (0.00847180390247432*applyconvL))); + tempSampleL -= (bL[61] * (0.21849243134998034 + (0.14460595245753741*applyconvL))); + tempSampleL -= (bL[62] * (0.20256105734574054 + (0.18932793221831667*applyconvL))); + tempSampleL -= (bL[63] * (0.18604070054295399 + (0.17250665610927965*applyconvL))); + tempSampleL -= (bL[64] * (0.17222844322058231 + (0.12992472027850357*applyconvL))); + tempSampleL -= (bL[65] * (0.14447856616566443 + (0.09089219002147308*applyconvL))); + tempSampleL -= (bL[66] * (0.10385520794251019 + (0.08600465834570559*applyconvL))); + tempSampleL -= (bL[67] * (0.07124435678265063 + (0.09071532210549428*applyconvL))); + tempSampleL -= (bL[68] * (0.05216857461197572 + (0.06794061706070262*applyconvL))); + tempSampleL -= (bL[69] * (0.05235381920184123 + (0.02818101717909346*applyconvL))); + tempSampleL -= (bL[70] * (0.07569701245553526 - (0.00634228544764946*applyconvL))); + tempSampleL -= (bL[71] * (0.10320125382718826 - (0.02751486906644141*applyconvL))); + tempSampleL -= (bL[72] * (0.12122120969079088 - (0.05434007312178933*applyconvL))); + tempSampleL -= (bL[73] * (0.13438969117200902 - (0.09135218559713874*applyconvL))); + tempSampleL -= (bL[74] * (0.13534390437529981 - (0.10437672041458675*applyconvL))); + tempSampleL -= (bL[75] * (0.11424128854188388 - (0.08693450726462598*applyconvL))); + tempSampleL -= (bL[76] * (0.08166894518596159 - (0.06949989431475120*applyconvL))); + tempSampleL -= (bL[77] * (0.04293976378555305 - (0.05718625137421843*applyconvL))); + tempSampleL += (bL[78] * (0.00933076320644409 + (0.01728285211520138*applyconvL))); + tempSampleL += (bL[79] * (0.06450430362918153 - (0.02492994833691022*applyconvL))); + tempSampleL += (bL[80] * (0.10187400687649277 - (0.03578455940532403*applyconvL))); + tempSampleL += (bL[81] * (0.11039763294094571 - (0.03995523517573508*applyconvL))); + tempSampleL += (bL[82] * (0.08557960776024547 - (0.03482514309492527*applyconvL))); + tempSampleL += (bL[83] * (0.02730881850805332 - (0.00514750108411127*applyconvL))); + //begin HighPowerStack conv R + tempSampleR += (bR[1] * (1.29550481610475132 + (0.19713872057074355*applyconvR))); + tempSampleR += (bR[2] * (1.42302569895462616 + (0.30599505521284787*applyconvR))); + tempSampleR += (bR[3] * (1.28728195804197565 + (0.23168333460446133*applyconvR))); + tempSampleR += (bR[4] * (0.88553784290822690 + (0.14263256172918892*applyconvR))); + tempSampleR += (bR[5] * (0.37129054918432319 + (0.00150040944205920*applyconvR))); + tempSampleR -= (bR[6] * (0.12150959412556320 + (0.32776273620569107*applyconvR))); + tempSampleR -= (bR[7] * (0.44900065463203775 + (0.74101214925298819*applyconvR))); + tempSampleR -= (bR[8] * (0.54058781908186482 + (1.07821707459008387*applyconvR))); + tempSampleR -= (bR[9] * (0.49361966401791391 + (1.23540109014850508*applyconvR))); + tempSampleR -= (bR[10] * (0.39819495093078133 + (1.11247213730917749*applyconvR))); + tempSampleR -= (bR[11] * (0.31379279985435521 + (0.80330360359638298*applyconvR))); + tempSampleR -= (bR[12] * (0.30744359242808555 + (0.42132528876858205*applyconvR))); + tempSampleR -= (bR[13] * (0.33943170284673974 + (0.09183418349389982*applyconvR))); + tempSampleR -= (bR[14] * (0.33838775119286391 - (0.06453051658561271*applyconvR))); + tempSampleR -= (bR[15] * (0.30682305697961665 - (0.09549380253249232*applyconvR))); + tempSampleR -= (bR[16] * (0.23408741339295336 - (0.08083404732361277*applyconvR))); + tempSampleR -= (bR[17] * (0.10411746814025019 + (0.00253651281245780*applyconvR))); + tempSampleR += (bR[18] * (0.00133623776084696 - (0.04447267870865820*applyconvR))); + tempSampleR += (bR[19] * (0.02461903992114161 + (0.07530671732655550*applyconvR))); + tempSampleR += (bR[20] * (0.02086715842475373 + (0.22795860236804899*applyconvR))); + tempSampleR += (bR[21] * (0.02761433637100917 + (0.26108320417844094*applyconvR))); + tempSampleR += (bR[22] * (0.04475285369162533 + (0.19160705011061663*applyconvR))); + tempSampleR += (bR[23] * (0.09447338372862381 + (0.03681550508743799*applyconvR))); + tempSampleR += (bR[24] * (0.13445890343722280 - (0.13713036462146147*applyconvR))); + tempSampleR += (bR[25] * (0.13872868945088121 - (0.22401242373298191*applyconvR))); + tempSampleR += (bR[26] * (0.14915650097434549 - (0.26718804981526367*applyconvR))); + tempSampleR += (bR[27] * (0.12766643217091783 - (0.27745664795660430*applyconvR))); + tempSampleR += (bR[28] * (0.03675849788393101 - (0.18338278173550679*applyconvR))); + tempSampleR -= (bR[29] * (0.06307306864232835 + (0.06089480869040766*applyconvR))); + tempSampleR -= (bR[30] * (0.14947389348962944 + (0.04642103054798480*applyconvR))); + tempSampleR -= (bR[31] * (0.25235266566401526 + (0.08423062596460507*applyconvR))); + tempSampleR -= (bR[32] * (0.33496344048679683 + (0.09808328256677995*applyconvR))); + tempSampleR -= (bR[33] * (0.36590030482175445 + (0.10622650888958179*applyconvR))); + tempSampleR -= (bR[34] * (0.35015197011464372 + (0.08982043516016047*applyconvR))); + tempSampleR -= (bR[35] * (0.26808437585665090 + (0.00735561860229533*applyconvR))); + tempSampleR -= (bR[36] * (0.11624318543291220 - (0.07142484314510467*applyconvR))); + tempSampleR += (bR[37] * (0.05617084165377551 + (0.11785854050350089*applyconvR))); + tempSampleR += (bR[38] * (0.20540028692589385 + (0.20479174663329586*applyconvR))); + tempSampleR += (bR[39] * (0.30455415003043818 + (0.29074864580096849*applyconvR))); + tempSampleR += (bR[40] * (0.33810750937829476 + (0.29182307921316802*applyconvR))); + tempSampleR += (bR[41] * (0.31936133365277430 + (0.26535537727394987*applyconvR))); + tempSampleR += (bR[42] * (0.27388548321981876 + (0.19735049990538350*applyconvR))); + tempSampleR += (bR[43] * (0.21454597517994098 + (0.06415909270247236*applyconvR))); + tempSampleR += (bR[44] * (0.15001045817707717 - (0.03831118543404573*applyconvR))); + tempSampleR += (bR[45] * (0.07283437284653138 - (0.09281952429543777*applyconvR))); + tempSampleR -= (bR[46] * (0.03917872184241358 + (0.14306291461398810*applyconvR))); + tempSampleR -= (bR[47] * (0.16695932032148642 + (0.19138995946950504*applyconvR))); + tempSampleR -= (bR[48] * (0.27055854466909462 + (0.22531296466343192*applyconvR))); + tempSampleR -= (bR[49] * (0.33256357307578271 + (0.23305840475692102*applyconvR))); + tempSampleR -= (bR[50] * (0.33459770116834442 + (0.24091822618917569*applyconvR))); + tempSampleR -= (bR[51] * (0.27156687236338090 + (0.24062938573512443*applyconvR))); + tempSampleR -= (bR[52] * (0.17197093288412094 + (0.19083085091993421*applyconvR))); + tempSampleR -= (bR[53] * (0.06738628195910543 + (0.10268609751019808*applyconvR))); + tempSampleR += (bR[54] * (0.00222429218204290 + (0.01439664435720548*applyconvR))); + tempSampleR += (bR[55] * (0.01346992803494091 + (0.15947137113534526*applyconvR))); + tempSampleR -= (bR[56] * (0.02038911881377448 - (0.26763170752416160*applyconvR))); + tempSampleR -= (bR[57] * (0.08233579178189687 - (0.29415931086406055*applyconvR))); + tempSampleR -= (bR[58] * (0.15447855089824883 - (0.26489186990840807*applyconvR))); + tempSampleR -= (bR[59] * (0.20518281113362655 - (0.16135382257522859*applyconvR))); + tempSampleR -= (bR[60] * (0.22244686050232007 + (0.00847180390247432*applyconvR))); + tempSampleR -= (bR[61] * (0.21849243134998034 + (0.14460595245753741*applyconvR))); + tempSampleR -= (bR[62] * (0.20256105734574054 + (0.18932793221831667*applyconvR))); + tempSampleR -= (bR[63] * (0.18604070054295399 + (0.17250665610927965*applyconvR))); + tempSampleR -= (bR[64] * (0.17222844322058231 + (0.12992472027850357*applyconvR))); + tempSampleR -= (bR[65] * (0.14447856616566443 + (0.09089219002147308*applyconvR))); + tempSampleR -= (bR[66] * (0.10385520794251019 + (0.08600465834570559*applyconvR))); + tempSampleR -= (bR[67] * (0.07124435678265063 + (0.09071532210549428*applyconvR))); + tempSampleR -= (bR[68] * (0.05216857461197572 + (0.06794061706070262*applyconvR))); + tempSampleR -= (bR[69] * (0.05235381920184123 + (0.02818101717909346*applyconvR))); + tempSampleR -= (bR[70] * (0.07569701245553526 - (0.00634228544764946*applyconvR))); + tempSampleR -= (bR[71] * (0.10320125382718826 - (0.02751486906644141*applyconvR))); + tempSampleR -= (bR[72] * (0.12122120969079088 - (0.05434007312178933*applyconvR))); + tempSampleR -= (bR[73] * (0.13438969117200902 - (0.09135218559713874*applyconvR))); + tempSampleR -= (bR[74] * (0.13534390437529981 - (0.10437672041458675*applyconvR))); + tempSampleR -= (bR[75] * (0.11424128854188388 - (0.08693450726462598*applyconvR))); + tempSampleR -= (bR[76] * (0.08166894518596159 - (0.06949989431475120*applyconvR))); + tempSampleR -= (bR[77] * (0.04293976378555305 - (0.05718625137421843*applyconvR))); + tempSampleR += (bR[78] * (0.00933076320644409 + (0.01728285211520138*applyconvR))); + tempSampleR += (bR[79] * (0.06450430362918153 - (0.02492994833691022*applyconvR))); + tempSampleR += (bR[80] * (0.10187400687649277 - (0.03578455940532403*applyconvR))); + tempSampleR += (bR[81] * (0.11039763294094571 - (0.03995523517573508*applyconvR))); + tempSampleR += (bR[82] * (0.08557960776024547 - (0.03482514309492527*applyconvR))); + tempSampleR += (bR[83] * (0.02730881850805332 - (0.00514750108411127*applyconvR))); + //end HighPowerStack conv + break; + case 2: + //begin VintageStack conv L + tempSampleL += (bL[1] * (1.31698250313308396 - (0.08140616497621633*applyconvL))); + tempSampleL += (bL[2] * (1.47229016949915326 - (0.27680278993637253*applyconvL))); + tempSampleL += (bL[3] * (1.30410109086044956 - (0.35629113432046489*applyconvL))); + tempSampleL += (bL[4] * (0.81766210474551260 - (0.26808782337659753*applyconvL))); + tempSampleL += (bL[5] * (0.19868872545506663 - (0.11105517193919669*applyconvL))); + tempSampleL -= (bL[6] * (0.39115909132567039 - (0.12630622002682679*applyconvL))); + tempSampleL -= (bL[7] * (0.76881891559343574 - (0.40879849500403143*applyconvL))); + tempSampleL -= (bL[8] * (0.87146861782680340 - (0.59529560488000599*applyconvL))); + tempSampleL -= (bL[9] * (0.79504575932563670 - (0.60877047551611796*applyconvL))); + tempSampleL -= (bL[10] * (0.61653017622406314 - (0.47662851438557335*applyconvL))); + tempSampleL -= (bL[11] * (0.40718195794382067 - (0.24955839378539713*applyconvL))); + tempSampleL -= (bL[12] * (0.31794900040616203 - (0.04169792259600613*applyconvL))); + tempSampleL -= (bL[13] * (0.41075032540217843 + (0.00368483996076280*applyconvL))); + tempSampleL -= (bL[14] * (0.56901352922170667 - (0.11027360805893105*applyconvL))); + tempSampleL -= (bL[15] * (0.62443222391889264 - (0.22198075154245228*applyconvL))); + tempSampleL -= (bL[16] * (0.53462856723129204 - (0.22933544545324852*applyconvL))); + tempSampleL -= (bL[17] * (0.34441703361995046 - (0.12956809502269492*applyconvL))); + tempSampleL -= (bL[18] * (0.13947052337867882 + (0.00339775055962799*applyconvL))); + tempSampleL += (bL[19] * (0.03771252648928484 - (0.10863931549251718*applyconvL))); + tempSampleL += (bL[20] * (0.18280210770271693 - (0.17413646599296417*applyconvL))); + tempSampleL += (bL[21] * (0.24621986701761467 - (0.14547053270435095*applyconvL))); + tempSampleL += (bL[22] * (0.22347075142737360 - (0.02493869490104031*applyconvL))); + tempSampleL += (bL[23] * (0.14346348482123716 + (0.11284054747963246*applyconvL))); + tempSampleL += (bL[24] * (0.00834364862916028 + (0.24284684053733926*applyconvL))); + tempSampleL -= (bL[25] * (0.11559740296078347 - (0.32623054435304538*applyconvL))); + tempSampleL -= (bL[26] * (0.18067604561283060 - (0.32311481551122478*applyconvL))); + tempSampleL -= (bL[27] * (0.22927997789035612 - (0.26991539052832925*applyconvL))); + tempSampleL -= (bL[28] * (0.28487666578669446 - (0.22437227250279349*applyconvL))); + tempSampleL -= (bL[29] * (0.31992973037153838 - (0.15289876100963865*applyconvL))); + tempSampleL -= (bL[30] * (0.35174606303520733 - (0.05656293023086628*applyconvL))); + tempSampleL -= (bL[31] * (0.36894898011375254 + (0.04333925421463558*applyconvL))); + tempSampleL -= (bL[32] * (0.32567576055307507 + (0.14594589410921388*applyconvL))); + tempSampleL -= (bL[33] * (0.27440135050585784 + (0.15529667398122521*applyconvL))); + tempSampleL -= (bL[34] * (0.21998973785078091 + (0.05083553737157104*applyconvL))); + tempSampleL -= (bL[35] * (0.10323624876862457 - (0.04651829594199963*applyconvL))); + tempSampleL += (bL[36] * (0.02091603687851074 + (0.12000046818439322*applyconvL))); + tempSampleL += (bL[37] * (0.11344930914138468 + (0.17697142512225839*applyconvL))); + tempSampleL += (bL[38] * (0.22766779627643968 + (0.13645102964003858*applyconvL))); + tempSampleL += (bL[39] * (0.38378309953638229 - (0.01997653307333791*applyconvL))); + tempSampleL += (bL[40] * (0.52789400804568076 - (0.21409137428422448*applyconvL))); + tempSampleL += (bL[41] * (0.55444630296938280 - (0.32331980931576626*applyconvL))); + tempSampleL += (bL[42] * (0.42333237669264601 - (0.26855847463044280*applyconvL))); + tempSampleL += (bL[43] * (0.21942831522035078 - (0.12051365248820624*applyconvL))); + tempSampleL -= (bL[44] * (0.00584169427830633 - (0.03706970171280329*applyconvL))); + tempSampleL -= (bL[45] * (0.24279799124660351 - (0.17296440491477982*applyconvL))); + tempSampleL -= (bL[46] * (0.40173760787507085 - (0.21717989835163351*applyconvL))); + tempSampleL -= (bL[47] * (0.43930035724188155 - (0.16425928481378199*applyconvL))); + tempSampleL -= (bL[48] * (0.41067765934041811 - (0.10390115786636855*applyconvL))); + tempSampleL -= (bL[49] * (0.34409235547165967 - (0.07268159377411920*applyconvL))); + tempSampleL -= (bL[50] * (0.26542883122568151 - (0.05483457497365785*applyconvL))); + tempSampleL -= (bL[51] * (0.22024754776138800 - (0.06484897950087598*applyconvL))); + tempSampleL -= (bL[52] * (0.20394367993632415 - (0.08746309731952180*applyconvL))); + tempSampleL -= (bL[53] * (0.17565242431124092 - (0.07611309538078760*applyconvL))); + tempSampleL -= (bL[54] * (0.10116623231246825 - (0.00642818706295112*applyconvL))); + tempSampleL -= (bL[55] * (0.00782648272053632 + (0.08004141267685004*applyconvL))); + tempSampleL += (bL[56] * (0.05059046006747323 - (0.12436676387548490*applyconvL))); + tempSampleL += (bL[57] * (0.06241531553254467 - (0.11530779547021434*applyconvL))); + tempSampleL += (bL[58] * (0.04952694587101836 - (0.08340945324333944*applyconvL))); + tempSampleL += (bL[59] * (0.00843873294401687 - (0.03279659052562903*applyconvL))); + tempSampleL -= (bL[60] * (0.05161338949440241 - (0.03428181149163798*applyconvL))); + tempSampleL -= (bL[61] * (0.08165520146902012 - (0.08196746092283110*applyconvL))); + tempSampleL -= (bL[62] * (0.06639532849935320 - (0.09797462781896329*applyconvL))); + tempSampleL -= (bL[63] * (0.02953430910661621 - (0.09175612938515763*applyconvL))); + tempSampleL += (bL[64] * (0.00741058547442938 + (0.05442091048731967*applyconvL))); + tempSampleL += (bL[65] * (0.01832866125391727 + (0.00306243693643687*applyconvL))); + tempSampleL += (bL[66] * (0.00526964230373573 - (0.04364102661136410*applyconvL))); + tempSampleL -= (bL[67] * (0.00300984373848200 + (0.09742737841278880*applyconvL))); + tempSampleL -= (bL[68] * (0.00413616769576694 + (0.14380661694523073*applyconvL))); + tempSampleL -= (bL[69] * (0.00588769034931419 + (0.16012843578892538*applyconvL))); + tempSampleL -= (bL[70] * (0.00688588239450581 + (0.14074464279305798*applyconvL))); + tempSampleL -= (bL[71] * (0.02277307992926315 + (0.07914752191801366*applyconvL))); + tempSampleL -= (bL[72] * (0.04627166091180877 - (0.00192787268067208*applyconvL))); + tempSampleL -= (bL[73] * (0.05562045897455786 - (0.05932868727665747*applyconvL))); + tempSampleL -= (bL[74] * (0.05134243784922165 - (0.08245334798868090*applyconvL))); + tempSampleL -= (bL[75] * (0.04719409472239919 - (0.07498680629253825*applyconvL))); + tempSampleL -= (bL[76] * (0.05889738914266415 - (0.06116127018043697*applyconvL))); + tempSampleL -= (bL[77] * (0.09428363535111127 - (0.06535868867863834*applyconvL))); + tempSampleL -= (bL[78] * (0.15181756953225126 - (0.08982979655234427*applyconvL))); + tempSampleL -= (bL[79] * (0.20878969456036670 - (0.10761070891499538*applyconvL))); + tempSampleL -= (bL[80] * (0.22647885581813790 - (0.08462542510349125*applyconvL))); + tempSampleL -= (bL[81] * (0.19723482443646323 - (0.02665160920736287*applyconvL))); + tempSampleL -= (bL[82] * (0.16441643451155163 + (0.02314691954338197*applyconvL))); + tempSampleL -= (bL[83] * (0.15201914054931515 + (0.04424903493886839*applyconvL))); + tempSampleL -= (bL[84] * (0.15454370641307855 + (0.04223203797913008*applyconvL))); + //begin VintageStack conv R + tempSampleR += (bR[1] * (1.31698250313308396 - (0.08140616497621633*applyconvR))); + tempSampleR += (bR[2] * (1.47229016949915326 - (0.27680278993637253*applyconvR))); + tempSampleR += (bR[3] * (1.30410109086044956 - (0.35629113432046489*applyconvR))); + tempSampleR += (bR[4] * (0.81766210474551260 - (0.26808782337659753*applyconvR))); + tempSampleR += (bR[5] * (0.19868872545506663 - (0.11105517193919669*applyconvR))); + tempSampleR -= (bR[6] * (0.39115909132567039 - (0.12630622002682679*applyconvR))); + tempSampleR -= (bR[7] * (0.76881891559343574 - (0.40879849500403143*applyconvR))); + tempSampleR -= (bR[8] * (0.87146861782680340 - (0.59529560488000599*applyconvR))); + tempSampleR -= (bR[9] * (0.79504575932563670 - (0.60877047551611796*applyconvR))); + tempSampleR -= (bR[10] * (0.61653017622406314 - (0.47662851438557335*applyconvR))); + tempSampleR -= (bR[11] * (0.40718195794382067 - (0.24955839378539713*applyconvR))); + tempSampleR -= (bR[12] * (0.31794900040616203 - (0.04169792259600613*applyconvR))); + tempSampleR -= (bR[13] * (0.41075032540217843 + (0.00368483996076280*applyconvR))); + tempSampleR -= (bR[14] * (0.56901352922170667 - (0.11027360805893105*applyconvR))); + tempSampleR -= (bR[15] * (0.62443222391889264 - (0.22198075154245228*applyconvR))); + tempSampleR -= (bR[16] * (0.53462856723129204 - (0.22933544545324852*applyconvR))); + tempSampleR -= (bR[17] * (0.34441703361995046 - (0.12956809502269492*applyconvR))); + tempSampleR -= (bR[18] * (0.13947052337867882 + (0.00339775055962799*applyconvR))); + tempSampleR += (bR[19] * (0.03771252648928484 - (0.10863931549251718*applyconvR))); + tempSampleR += (bR[20] * (0.18280210770271693 - (0.17413646599296417*applyconvR))); + tempSampleR += (bR[21] * (0.24621986701761467 - (0.14547053270435095*applyconvR))); + tempSampleR += (bR[22] * (0.22347075142737360 - (0.02493869490104031*applyconvR))); + tempSampleR += (bR[23] * (0.14346348482123716 + (0.11284054747963246*applyconvR))); + tempSampleR += (bR[24] * (0.00834364862916028 + (0.24284684053733926*applyconvR))); + tempSampleR -= (bR[25] * (0.11559740296078347 - (0.32623054435304538*applyconvR))); + tempSampleR -= (bR[26] * (0.18067604561283060 - (0.32311481551122478*applyconvR))); + tempSampleR -= (bR[27] * (0.22927997789035612 - (0.26991539052832925*applyconvR))); + tempSampleR -= (bR[28] * (0.28487666578669446 - (0.22437227250279349*applyconvR))); + tempSampleR -= (bR[29] * (0.31992973037153838 - (0.15289876100963865*applyconvR))); + tempSampleR -= (bR[30] * (0.35174606303520733 - (0.05656293023086628*applyconvR))); + tempSampleR -= (bR[31] * (0.36894898011375254 + (0.04333925421463558*applyconvR))); + tempSampleR -= (bR[32] * (0.32567576055307507 + (0.14594589410921388*applyconvR))); + tempSampleR -= (bR[33] * (0.27440135050585784 + (0.15529667398122521*applyconvR))); + tempSampleR -= (bR[34] * (0.21998973785078091 + (0.05083553737157104*applyconvR))); + tempSampleR -= (bR[35] * (0.10323624876862457 - (0.04651829594199963*applyconvR))); + tempSampleR += (bR[36] * (0.02091603687851074 + (0.12000046818439322*applyconvR))); + tempSampleR += (bR[37] * (0.11344930914138468 + (0.17697142512225839*applyconvR))); + tempSampleR += (bR[38] * (0.22766779627643968 + (0.13645102964003858*applyconvR))); + tempSampleR += (bR[39] * (0.38378309953638229 - (0.01997653307333791*applyconvR))); + tempSampleR += (bR[40] * (0.52789400804568076 - (0.21409137428422448*applyconvR))); + tempSampleR += (bR[41] * (0.55444630296938280 - (0.32331980931576626*applyconvR))); + tempSampleR += (bR[42] * (0.42333237669264601 - (0.26855847463044280*applyconvR))); + tempSampleR += (bR[43] * (0.21942831522035078 - (0.12051365248820624*applyconvR))); + tempSampleR -= (bR[44] * (0.00584169427830633 - (0.03706970171280329*applyconvR))); + tempSampleR -= (bR[45] * (0.24279799124660351 - (0.17296440491477982*applyconvR))); + tempSampleR -= (bR[46] * (0.40173760787507085 - (0.21717989835163351*applyconvR))); + tempSampleR -= (bR[47] * (0.43930035724188155 - (0.16425928481378199*applyconvR))); + tempSampleR -= (bR[48] * (0.41067765934041811 - (0.10390115786636855*applyconvR))); + tempSampleR -= (bR[49] * (0.34409235547165967 - (0.07268159377411920*applyconvR))); + tempSampleR -= (bR[50] * (0.26542883122568151 - (0.05483457497365785*applyconvR))); + tempSampleR -= (bR[51] * (0.22024754776138800 - (0.06484897950087598*applyconvR))); + tempSampleR -= (bR[52] * (0.20394367993632415 - (0.08746309731952180*applyconvR))); + tempSampleR -= (bR[53] * (0.17565242431124092 - (0.07611309538078760*applyconvR))); + tempSampleR -= (bR[54] * (0.10116623231246825 - (0.00642818706295112*applyconvR))); + tempSampleR -= (bR[55] * (0.00782648272053632 + (0.08004141267685004*applyconvR))); + tempSampleR += (bR[56] * (0.05059046006747323 - (0.12436676387548490*applyconvR))); + tempSampleR += (bR[57] * (0.06241531553254467 - (0.11530779547021434*applyconvR))); + tempSampleR += (bR[58] * (0.04952694587101836 - (0.08340945324333944*applyconvR))); + tempSampleR += (bR[59] * (0.00843873294401687 - (0.03279659052562903*applyconvR))); + tempSampleR -= (bR[60] * (0.05161338949440241 - (0.03428181149163798*applyconvR))); + tempSampleR -= (bR[61] * (0.08165520146902012 - (0.08196746092283110*applyconvR))); + tempSampleR -= (bR[62] * (0.06639532849935320 - (0.09797462781896329*applyconvR))); + tempSampleR -= (bR[63] * (0.02953430910661621 - (0.09175612938515763*applyconvR))); + tempSampleR += (bR[64] * (0.00741058547442938 + (0.05442091048731967*applyconvR))); + tempSampleR += (bR[65] * (0.01832866125391727 + (0.00306243693643687*applyconvR))); + tempSampleR += (bR[66] * (0.00526964230373573 - (0.04364102661136410*applyconvR))); + tempSampleR -= (bR[67] * (0.00300984373848200 + (0.09742737841278880*applyconvR))); + tempSampleR -= (bR[68] * (0.00413616769576694 + (0.14380661694523073*applyconvR))); + tempSampleR -= (bR[69] * (0.00588769034931419 + (0.16012843578892538*applyconvR))); + tempSampleR -= (bR[70] * (0.00688588239450581 + (0.14074464279305798*applyconvR))); + tempSampleR -= (bR[71] * (0.02277307992926315 + (0.07914752191801366*applyconvR))); + tempSampleR -= (bR[72] * (0.04627166091180877 - (0.00192787268067208*applyconvR))); + tempSampleR -= (bR[73] * (0.05562045897455786 - (0.05932868727665747*applyconvR))); + tempSampleR -= (bR[74] * (0.05134243784922165 - (0.08245334798868090*applyconvR))); + tempSampleR -= (bR[75] * (0.04719409472239919 - (0.07498680629253825*applyconvR))); + tempSampleR -= (bR[76] * (0.05889738914266415 - (0.06116127018043697*applyconvR))); + tempSampleR -= (bR[77] * (0.09428363535111127 - (0.06535868867863834*applyconvR))); + tempSampleR -= (bR[78] * (0.15181756953225126 - (0.08982979655234427*applyconvR))); + tempSampleR -= (bR[79] * (0.20878969456036670 - (0.10761070891499538*applyconvR))); + tempSampleR -= (bR[80] * (0.22647885581813790 - (0.08462542510349125*applyconvR))); + tempSampleR -= (bR[81] * (0.19723482443646323 - (0.02665160920736287*applyconvR))); + tempSampleR -= (bR[82] * (0.16441643451155163 + (0.02314691954338197*applyconvR))); + tempSampleR -= (bR[83] * (0.15201914054931515 + (0.04424903493886839*applyconvR))); + tempSampleR -= (bR[84] * (0.15454370641307855 + (0.04223203797913008*applyconvR))); + //end VintageStack conv + break; + case 3: + //begin BoutiqueStack conv L + tempSampleL += (bL[1] * (1.30406584776167445 - (0.01410622186823351*applyconvL))); + tempSampleL += (bL[2] * (1.09350974154373559 + (0.34478044709202327*applyconvL))); + tempSampleL += (bL[3] * (0.52285510059938256 + (0.84225842837363574*applyconvL))); + tempSampleL -= (bL[4] * (0.00018126260714707 - (1.02446537989058117*applyconvL))); + tempSampleL -= (bL[5] * (0.34943699771860115 - (0.84094709567790016*applyconvL))); + tempSampleL -= (bL[6] * (0.53068048407937285 - (0.49231169327705593*applyconvL))); + tempSampleL -= (bL[7] * (0.48631669406792399 - (0.08965111766223610*applyconvL))); + tempSampleL -= (bL[8] * (0.28099201947014130 + (0.23921137841068607*applyconvL))); + tempSampleL -= (bL[9] * (0.10333290012666248 + (0.35058962687321482*applyconvL))); + tempSampleL -= (bL[10] * (0.06605032198166226 + (0.23447405567823365*applyconvL))); + tempSampleL -= (bL[11] * (0.10485808661261729 + (0.05025985449763527*applyconvL))); + tempSampleL -= (bL[12] * (0.13231190973014911 - (0.05484648240248013*applyconvL))); + tempSampleL -= (bL[13] * (0.12926184767180304 - (0.04054223744746116*applyconvL))); + tempSampleL -= (bL[14] * (0.13802696739839460 + (0.01876754906568237*applyconvL))); + tempSampleL -= (bL[15] * (0.16548980700926913 + (0.06772130758771169*applyconvL))); + tempSampleL -= (bL[16] * (0.14469310965751475 + (0.10590928840978781*applyconvL))); + tempSampleL -= (bL[17] * (0.07838457396093310 + (0.13120101199677947*applyconvL))); + tempSampleL -= (bL[18] * (0.05123031606187391 + (0.13883400806512292*applyconvL))); + tempSampleL -= (bL[19] * (0.08906103481939850 + (0.07840461228402337*applyconvL))); + tempSampleL -= (bL[20] * (0.13939265522625241 + (0.01194366471800457*applyconvL))); + tempSampleL -= (bL[21] * (0.14957600717294034 + (0.07687598594361914*applyconvL))); + tempSampleL -= (bL[22] * (0.14112708654047090 + (0.20118461131186977*applyconvL))); + tempSampleL -= (bL[23] * (0.14961020766492997 + (0.30005716443826147*applyconvL))); + tempSampleL -= (bL[24] * (0.16130382224652270 + (0.40459872030013055*applyconvL))); + tempSampleL -= (bL[25] * (0.15679868471080052 + (0.47292767226083465*applyconvL))); + tempSampleL -= (bL[26] * (0.16456530552807727 + (0.45182121471666481*applyconvL))); + tempSampleL -= (bL[27] * (0.16852385701909278 + (0.38272684270752266*applyconvL))); + tempSampleL -= (bL[28] * (0.13317562760966850 + (0.28829580273670768*applyconvL))); + tempSampleL -= (bL[29] * (0.09396196532150952 + (0.18886898332071317*applyconvL))); + tempSampleL -= (bL[30] * (0.10133496956734221 + (0.11158788414137354*applyconvL))); + tempSampleL -= (bL[31] * (0.16097596389376778 + (0.02621299102374547*applyconvL))); + tempSampleL -= (bL[32] * (0.21419006394821866 - (0.03585678078834797*applyconvL))); + tempSampleL -= (bL[33] * (0.21273234570555244 - (0.02574469802924526*applyconvL))); + tempSampleL -= (bL[34] * (0.16934948798707830 + (0.01354331184333835*applyconvL))); + tempSampleL -= (bL[35] * (0.11970436472852493 + (0.04242183865883427*applyconvL))); + tempSampleL -= (bL[36] * (0.09329023656747724 + (0.06890873292358397*applyconvL))); + tempSampleL -= (bL[37] * (0.10255328436608116 + (0.11482972519137427*applyconvL))); + tempSampleL -= (bL[38] * (0.13883223352796811 + (0.18016014431438840*applyconvL))); + tempSampleL -= (bL[39] * (0.16532844286979087 + (0.24521957638633446*applyconvL))); + tempSampleL -= (bL[40] * (0.16254607738965438 + (0.25669472097572482*applyconvL))); + tempSampleL -= (bL[41] * (0.15353207135544752 + (0.15048064682912729*applyconvL))); + tempSampleL -= (bL[42] * (0.13039046390746015 - (0.00200335414623601*applyconvL))); + tempSampleL -= (bL[43] * (0.06707245032180627 - (0.06498125592578702*applyconvL))); + tempSampleL += (bL[44] * (0.01427326441869788 + (0.01940451360783622*applyconvL))); + tempSampleL += (bL[45] * (0.06151238306578224 - (0.07335755969763329*applyconvL))); + tempSampleL += (bL[46] * (0.04685840498892526 - (0.14258849371688248*applyconvL))); + tempSampleL -= (bL[47] * (0.00950136304466093 + (0.14379354707665129*applyconvL))); + tempSampleL -= (bL[48] * (0.06245771575493557 + (0.07639718586346110*applyconvL))); + tempSampleL -= (bL[49] * (0.07159593175777741 - (0.00595536565276915*applyconvL))); + tempSampleL -= (bL[50] * (0.03167929390245019 - (0.03856769526301793*applyconvL))); + tempSampleL += (bL[51] * (0.01890898565110766 + (0.00760539424271147*applyconvL))); + tempSampleL += (bL[52] * (0.04926161137832240 - (0.06411014430053390*applyconvL))); + tempSampleL += (bL[53] * (0.05768814623421683 - (0.15068618173358578*applyconvL))); + tempSampleL += (bL[54] * (0.06144258297076708 - (0.21200636329120301*applyconvL))); + tempSampleL += (bL[55] * (0.06348341960185613 - (0.19620269813094307*applyconvL))); + tempSampleL += (bL[56] * (0.04877736350310589 - (0.11864999881200111*applyconvL))); + tempSampleL += (bL[57] * (0.01010950997574472 - (0.02630070679113791*applyconvL))); + tempSampleL -= (bL[58] * (0.02929178864801191 - (0.04439260202207482*applyconvL))); + tempSampleL -= (bL[59] * (0.03484517126321562 - (0.04508635396034735*applyconvL))); + tempSampleL -= (bL[60] * (0.00547176780437610 - (0.00205637806941426*applyconvL))); + tempSampleL += (bL[61] * (0.02278296865283977 - (0.00063732526427685*applyconvL))); + tempSampleL += (bL[62] * (0.02688982591366477 + (0.05333738901586284*applyconvL))); + tempSampleL += (bL[63] * (0.01942012754957055 + (0.10942832669749143*applyconvL))); + tempSampleL += (bL[64] * (0.01572585258756565 + (0.11189204189054594*applyconvL))); + tempSampleL += (bL[65] * (0.01490550715016034 + (0.04449822818925343*applyconvL))); + tempSampleL += (bL[66] * (0.01715683226376727 - (0.06944648050933899*applyconvL))); + tempSampleL += (bL[67] * (0.02822659878011318 - (0.17843652160132820*applyconvL))); + tempSampleL += (bL[68] * (0.03758307610456144 - (0.21986013433664692*applyconvL))); + tempSampleL += (bL[69] * (0.03275008021608433 - (0.15869878676112170*applyconvL))); + tempSampleL += (bL[70] * (0.01855749786752354 - (0.02337224995718105*applyconvL))); + tempSampleL += (bL[71] * (0.00217095395782931 + (0.10971764224593601*applyconvL))); + tempSampleL -= (bL[72] * (0.01851381451105007 - (0.17214910008793413*applyconvL))); + tempSampleL -= (bL[73] * (0.04722574936345419 - (0.14341588977845254*applyconvL))); + tempSampleL -= (bL[74] * (0.07151540514482006 - (0.04684695724814321*applyconvL))); + tempSampleL -= (bL[75] * (0.06827195484995092 + (0.07022207121861397*applyconvL))); + tempSampleL -= (bL[76] * (0.03290227240464227 + (0.16328400808152735*applyconvL))); + tempSampleL += (bL[77] * (0.01043861198275382 - (0.20184486126076279*applyconvL))); + tempSampleL += (bL[78] * (0.03236563559476477 - (0.17125821306380920*applyconvL))); + tempSampleL += (bL[79] * (0.02040121529932702 - (0.09103660189829657*applyconvL))); + tempSampleL -= (bL[80] * (0.00509649513318102 + (0.01170360991547489*applyconvL))); + tempSampleL -= (bL[81] * (0.01388353426600228 - (0.03588955538451771*applyconvL))); + tempSampleL -= (bL[82] * (0.00523671715033842 - (0.07068798057534148*applyconvL))); + tempSampleL += (bL[83] * (0.00665852487721137 + (0.11666210640054926*applyconvL))); + tempSampleL += (bL[84] * (0.01593540832939290 + (0.15844892856402149*applyconvL))); + tempSampleL += (bL[85] * (0.02080509201836796 + (0.17186274420065850*applyconvL))); + //begin BoutiqueStack conv R + tempSampleR += (bR[1] * (1.30406584776167445 - (0.01410622186823351*applyconvR))); + tempSampleR += (bR[2] * (1.09350974154373559 + (0.34478044709202327*applyconvR))); + tempSampleR += (bR[3] * (0.52285510059938256 + (0.84225842837363574*applyconvR))); + tempSampleR -= (bR[4] * (0.00018126260714707 - (1.02446537989058117*applyconvR))); + tempSampleR -= (bR[5] * (0.34943699771860115 - (0.84094709567790016*applyconvR))); + tempSampleR -= (bR[6] * (0.53068048407937285 - (0.49231169327705593*applyconvR))); + tempSampleR -= (bR[7] * (0.48631669406792399 - (0.08965111766223610*applyconvR))); + tempSampleR -= (bR[8] * (0.28099201947014130 + (0.23921137841068607*applyconvR))); + tempSampleR -= (bR[9] * (0.10333290012666248 + (0.35058962687321482*applyconvR))); + tempSampleR -= (bR[10] * (0.06605032198166226 + (0.23447405567823365*applyconvR))); + tempSampleR -= (bR[11] * (0.10485808661261729 + (0.05025985449763527*applyconvR))); + tempSampleR -= (bR[12] * (0.13231190973014911 - (0.05484648240248013*applyconvR))); + tempSampleR -= (bR[13] * (0.12926184767180304 - (0.04054223744746116*applyconvR))); + tempSampleR -= (bR[14] * (0.13802696739839460 + (0.01876754906568237*applyconvR))); + tempSampleR -= (bR[15] * (0.16548980700926913 + (0.06772130758771169*applyconvR))); + tempSampleR -= (bR[16] * (0.14469310965751475 + (0.10590928840978781*applyconvR))); + tempSampleR -= (bR[17] * (0.07838457396093310 + (0.13120101199677947*applyconvR))); + tempSampleR -= (bR[18] * (0.05123031606187391 + (0.13883400806512292*applyconvR))); + tempSampleR -= (bR[19] * (0.08906103481939850 + (0.07840461228402337*applyconvR))); + tempSampleR -= (bR[20] * (0.13939265522625241 + (0.01194366471800457*applyconvR))); + tempSampleR -= (bR[21] * (0.14957600717294034 + (0.07687598594361914*applyconvR))); + tempSampleR -= (bR[22] * (0.14112708654047090 + (0.20118461131186977*applyconvR))); + tempSampleR -= (bR[23] * (0.14961020766492997 + (0.30005716443826147*applyconvR))); + tempSampleR -= (bR[24] * (0.16130382224652270 + (0.40459872030013055*applyconvR))); + tempSampleR -= (bR[25] * (0.15679868471080052 + (0.47292767226083465*applyconvR))); + tempSampleR -= (bR[26] * (0.16456530552807727 + (0.45182121471666481*applyconvR))); + tempSampleR -= (bR[27] * (0.16852385701909278 + (0.38272684270752266*applyconvR))); + tempSampleR -= (bR[28] * (0.13317562760966850 + (0.28829580273670768*applyconvR))); + tempSampleR -= (bR[29] * (0.09396196532150952 + (0.18886898332071317*applyconvR))); + tempSampleR -= (bR[30] * (0.10133496956734221 + (0.11158788414137354*applyconvR))); + tempSampleR -= (bR[31] * (0.16097596389376778 + (0.02621299102374547*applyconvR))); + tempSampleR -= (bR[32] * (0.21419006394821866 - (0.03585678078834797*applyconvR))); + tempSampleR -= (bR[33] * (0.21273234570555244 - (0.02574469802924526*applyconvR))); + tempSampleR -= (bR[34] * (0.16934948798707830 + (0.01354331184333835*applyconvR))); + tempSampleR -= (bR[35] * (0.11970436472852493 + (0.04242183865883427*applyconvR))); + tempSampleR -= (bR[36] * (0.09329023656747724 + (0.06890873292358397*applyconvR))); + tempSampleR -= (bR[37] * (0.10255328436608116 + (0.11482972519137427*applyconvR))); + tempSampleR -= (bR[38] * (0.13883223352796811 + (0.18016014431438840*applyconvR))); + tempSampleR -= (bR[39] * (0.16532844286979087 + (0.24521957638633446*applyconvR))); + tempSampleR -= (bR[40] * (0.16254607738965438 + (0.25669472097572482*applyconvR))); + tempSampleR -= (bR[41] * (0.15353207135544752 + (0.15048064682912729*applyconvR))); + tempSampleR -= (bR[42] * (0.13039046390746015 - (0.00200335414623601*applyconvR))); + tempSampleR -= (bR[43] * (0.06707245032180627 - (0.06498125592578702*applyconvR))); + tempSampleR += (bR[44] * (0.01427326441869788 + (0.01940451360783622*applyconvR))); + tempSampleR += (bR[45] * (0.06151238306578224 - (0.07335755969763329*applyconvR))); + tempSampleR += (bR[46] * (0.04685840498892526 - (0.14258849371688248*applyconvR))); + tempSampleR -= (bR[47] * (0.00950136304466093 + (0.14379354707665129*applyconvR))); + tempSampleR -= (bR[48] * (0.06245771575493557 + (0.07639718586346110*applyconvR))); + tempSampleR -= (bR[49] * (0.07159593175777741 - (0.00595536565276915*applyconvR))); + tempSampleR -= (bR[50] * (0.03167929390245019 - (0.03856769526301793*applyconvR))); + tempSampleR += (bR[51] * (0.01890898565110766 + (0.00760539424271147*applyconvR))); + tempSampleR += (bR[52] * (0.04926161137832240 - (0.06411014430053390*applyconvR))); + tempSampleR += (bR[53] * (0.05768814623421683 - (0.15068618173358578*applyconvR))); + tempSampleR += (bR[54] * (0.06144258297076708 - (0.21200636329120301*applyconvR))); + tempSampleR += (bR[55] * (0.06348341960185613 - (0.19620269813094307*applyconvR))); + tempSampleR += (bR[56] * (0.04877736350310589 - (0.11864999881200111*applyconvR))); + tempSampleR += (bR[57] * (0.01010950997574472 - (0.02630070679113791*applyconvR))); + tempSampleR -= (bR[58] * (0.02929178864801191 - (0.04439260202207482*applyconvR))); + tempSampleR -= (bR[59] * (0.03484517126321562 - (0.04508635396034735*applyconvR))); + tempSampleR -= (bR[60] * (0.00547176780437610 - (0.00205637806941426*applyconvR))); + tempSampleR += (bR[61] * (0.02278296865283977 - (0.00063732526427685*applyconvR))); + tempSampleR += (bR[62] * (0.02688982591366477 + (0.05333738901586284*applyconvR))); + tempSampleR += (bR[63] * (0.01942012754957055 + (0.10942832669749143*applyconvR))); + tempSampleR += (bR[64] * (0.01572585258756565 + (0.11189204189054594*applyconvR))); + tempSampleR += (bR[65] * (0.01490550715016034 + (0.04449822818925343*applyconvR))); + tempSampleR += (bR[66] * (0.01715683226376727 - (0.06944648050933899*applyconvR))); + tempSampleR += (bR[67] * (0.02822659878011318 - (0.17843652160132820*applyconvR))); + tempSampleR += (bR[68] * (0.03758307610456144 - (0.21986013433664692*applyconvR))); + tempSampleR += (bR[69] * (0.03275008021608433 - (0.15869878676112170*applyconvR))); + tempSampleR += (bR[70] * (0.01855749786752354 - (0.02337224995718105*applyconvR))); + tempSampleR += (bR[71] * (0.00217095395782931 + (0.10971764224593601*applyconvR))); + tempSampleR -= (bR[72] * (0.01851381451105007 - (0.17214910008793413*applyconvR))); + tempSampleR -= (bR[73] * (0.04722574936345419 - (0.14341588977845254*applyconvR))); + tempSampleR -= (bR[74] * (0.07151540514482006 - (0.04684695724814321*applyconvR))); + tempSampleR -= (bR[75] * (0.06827195484995092 + (0.07022207121861397*applyconvR))); + tempSampleR -= (bR[76] * (0.03290227240464227 + (0.16328400808152735*applyconvR))); + tempSampleR += (bR[77] * (0.01043861198275382 - (0.20184486126076279*applyconvR))); + tempSampleR += (bR[78] * (0.03236563559476477 - (0.17125821306380920*applyconvR))); + tempSampleR += (bR[79] * (0.02040121529932702 - (0.09103660189829657*applyconvR))); + tempSampleR -= (bR[80] * (0.00509649513318102 + (0.01170360991547489*applyconvR))); + tempSampleR -= (bR[81] * (0.01388353426600228 - (0.03588955538451771*applyconvR))); + tempSampleR -= (bR[82] * (0.00523671715033842 - (0.07068798057534148*applyconvR))); + tempSampleR += (bR[83] * (0.00665852487721137 + (0.11666210640054926*applyconvR))); + tempSampleR += (bR[84] * (0.01593540832939290 + (0.15844892856402149*applyconvR))); + tempSampleR += (bR[85] * (0.02080509201836796 + (0.17186274420065850*applyconvR))); + //end BoutiqueStack conv + break; + case 4: + //begin LargeCombo conv L + tempSampleL += (bL[1] * (1.31819680801404560 + (0.00362521700518292*applyconvL))); + tempSampleL += (bL[2] * (1.37738284126127919 + (0.14134596126256205*applyconvL))); + tempSampleL += (bL[3] * (1.09957637225311622 + (0.33199581815501555*applyconvL))); + tempSampleL += (bL[4] * (0.62025358899656258 + (0.37476042042088142*applyconvL))); + tempSampleL += (bL[5] * (0.12926194402137478 + (0.24702655568406759*applyconvL))); + tempSampleL -= (bL[6] * (0.28927985011367602 - (0.13289168298307708*applyconvL))); + tempSampleL -= (bL[7] * (0.56518146339033448 - (0.11026641793526121*applyconvL))); + tempSampleL -= (bL[8] * (0.59843200696815069 - (0.10139909232154271*applyconvL))); + tempSampleL -= (bL[9] * (0.45219971861789204 - (0.13313355255903159*applyconvL))); + tempSampleL -= (bL[10] * (0.32520490032331351 - (0.29009061730364216*applyconvL))); + tempSampleL -= (bL[11] * (0.29773131872442909 - (0.45307495356996669*applyconvL))); + tempSampleL -= (bL[12] * (0.31738895975218867 - (0.43198591958928922*applyconvL))); + tempSampleL -= (bL[13] * (0.33336150604703757 - (0.24240412850274029*applyconvL))); + tempSampleL -= (bL[14] * (0.32461638442042151 - (0.02779297492397464*applyconvL))); + tempSampleL -= (bL[15] * (0.27812829473787770 + (0.15565718905032455*applyconvL))); + tempSampleL -= (bL[16] * (0.19413454458668097 + (0.32087693535188599*applyconvL))); + tempSampleL -= (bL[17] * (0.12378036344480114 + (0.37736575956794161*applyconvL))); + tempSampleL -= (bL[18] * (0.12550494837257106 + (0.25593811142722300*applyconvL))); + tempSampleL -= (bL[19] * (0.17725736033713696 + (0.07708896413593636*applyconvL))); + tempSampleL -= (bL[20] * (0.22023699647700670 - (0.01600371273599124*applyconvL))); + tempSampleL -= (bL[21] * (0.21987645486953747 + (0.00973336938352798*applyconvL))); + tempSampleL -= (bL[22] * (0.15014276479707978 + (0.11602269600138954*applyconvL))); + tempSampleL -= (bL[23] * (0.05176520203073560 + (0.20383164255692698*applyconvL))); + tempSampleL -= (bL[24] * (0.04276687165294867 + (0.17785002166834518*applyconvL))); + tempSampleL -= (bL[25] * (0.15951546388137597 + (0.06748854885822464*applyconvL))); + tempSampleL -= (bL[26] * (0.30211952144352616 - (0.03440494237025149*applyconvL))); + tempSampleL -= (bL[27] * (0.36462803375134506 - (0.05874284362202409*applyconvL))); + tempSampleL -= (bL[28] * (0.32283960219377539 + (0.01189623197958362*applyconvL))); + tempSampleL -= (bL[29] * (0.19245178663350720 + (0.11088858383712991*applyconvL))); + tempSampleL += (bL[30] * (0.00681589563349590 - (0.16314250963457660*applyconvL))); + tempSampleL += (bL[31] * (0.20927798345622584 - (0.16952981620487462*applyconvL))); + tempSampleL += (bL[32] * (0.25638846543430976 - (0.11462562122281153*applyconvL))); + tempSampleL += (bL[33] * (0.04584495673888605 + (0.04669671229804190*applyconvL))); + tempSampleL -= (bL[34] * (0.25221561978187662 - (0.19250758741703761*applyconvL))); + tempSampleL -= (bL[35] * (0.35662801992424953 - (0.12244680002787561*applyconvL))); + tempSampleL -= (bL[36] * (0.21498114329314663 + (0.12152120956991189*applyconvL))); + tempSampleL += (bL[37] * (0.00968605571673376 - (0.30597812512858558*applyconvL))); + tempSampleL += (bL[38] * (0.18029119870614621 - (0.31569386468576782*applyconvL))); + tempSampleL += (bL[39] * (0.22744437185251629 - (0.18028438460422197*applyconvL))); + tempSampleL += (bL[40] * (0.09725687638959078 + (0.05479918522830433*applyconvL))); + tempSampleL -= (bL[41] * (0.17970389267353537 - (0.29222750363124067*applyconvL))); + tempSampleL -= (bL[42] * (0.42371969704763018 - (0.34924957781842314*applyconvL))); + tempSampleL -= (bL[43] * (0.43313266755788055 - (0.11503731970288061*applyconvL))); + tempSampleL -= (bL[44] * (0.22178165627851801 + (0.25002925550036226*applyconvL))); + tempSampleL -= (bL[45] * (0.00410198176852576 + (0.43283281457037676*applyconvL))); + tempSampleL += (bL[46] * (0.09072426344812032 - (0.35318250460706446*applyconvL))); + tempSampleL += (bL[47] * (0.08405839183965140 - (0.16936391987143717*applyconvL))); + tempSampleL -= (bL[48] * (0.01110419756114383 - (0.01247164991313877*applyconvL))); + tempSampleL -= (bL[49] * (0.18593334646855278 - (0.14513260199423966*applyconvL))); + tempSampleL -= (bL[50] * (0.33665010871497486 - (0.14456206192169668*applyconvL))); + tempSampleL -= (bL[51] * (0.32644968491439380 + (0.01594380759082303*applyconvL))); + tempSampleL -= (bL[52] * (0.14855437679485431 + (0.23555511219002742*applyconvL))); + tempSampleL += (bL[53] * (0.05113019250820622 - (0.35556617126595202*applyconvL))); + tempSampleL += (bL[54] * (0.12915754942362243 - (0.28571671825750300*applyconvL))); + tempSampleL += (bL[55] * (0.07406865846069306 - (0.10543886479975995*applyconvL))); + tempSampleL -= (bL[56] * (0.03669573814193980 - (0.03194267657582078*applyconvL))); + tempSampleL -= (bL[57] * (0.13429103278009327 - (0.06145796486786051*applyconvL))); + tempSampleL -= (bL[58] * (0.17884021749974641 - (0.00156626902982124*applyconvL))); + tempSampleL -= (bL[59] * (0.16138212225178239 + (0.09402070836837134*applyconvL))); + tempSampleL -= (bL[60] * (0.10867028245257521 + (0.15407963447815898*applyconvL))); + tempSampleL -= (bL[61] * (0.06312416389213464 + (0.11241095544179526*applyconvL))); + tempSampleL -= (bL[62] * (0.05826376574081994 - (0.03635253545701986*applyconvL))); + tempSampleL -= (bL[63] * (0.07991631148258237 - (0.18041947557579863*applyconvL))); + tempSampleL -= (bL[64] * (0.07777397532506500 - (0.20817156738202205*applyconvL))); + tempSampleL -= (bL[65] * (0.03812528734394271 - (0.13679963125162486*applyconvL))); + tempSampleL += (bL[66] * (0.00204900323943951 + (0.04009000730101046*applyconvL))); + tempSampleL += (bL[67] * (0.01779599498119764 - (0.04218637577942354*applyconvL))); + tempSampleL += (bL[68] * (0.00950301949319113 - (0.07908911305044238*applyconvL))); + tempSampleL -= (bL[69] * (0.04283600714814891 + (0.02716262334097985*applyconvL))); + tempSampleL -= (bL[70] * (0.14478320837041933 - (0.08823515277628832*applyconvL))); + tempSampleL -= (bL[71] * (0.23250267035795688 - (0.15334197814956568*applyconvL))); + tempSampleL -= (bL[72] * (0.22369031446225857 - (0.08550989980799503*applyconvL))); + tempSampleL -= (bL[73] * (0.11142757883989868 + (0.08321482928259660*applyconvL))); + tempSampleL += (bL[74] * (0.02752318631713307 - (0.25252906099212968*applyconvL))); + tempSampleL += (bL[75] * (0.11940028414727490 - (0.34358127205009553*applyconvL))); + tempSampleL += (bL[76] * (0.12702057126698307 - (0.31808560130583663*applyconvL))); + tempSampleL += (bL[77] * (0.03639067777025356 - (0.17970282734717846*applyconvL))); + tempSampleL -= (bL[78] * (0.11389848143835518 + (0.00470616711331971*applyconvL))); + tempSampleL -= (bL[79] * (0.23024072979374310 - (0.09772245468884058*applyconvL))); + tempSampleL -= (bL[80] * (0.24389015061112601 - (0.09600959885615798*applyconvL))); + tempSampleL -= (bL[81] * (0.16680269075295703 - (0.05194978963662898*applyconvL))); + tempSampleL -= (bL[82] * (0.05108041495077725 - (0.01796071525570735*applyconvL))); + tempSampleL += (bL[83] * (0.06489835353859555 - (0.00808013770331126*applyconvL))); + tempSampleL += (bL[84] * (0.15481511440233464 - (0.02674063848284838*applyconvL))); + tempSampleL += (bL[85] * (0.18620867857907253 - (0.01786423699465214*applyconvL))); + tempSampleL += (bL[86] * (0.13879832139055756 + (0.01584446839973597*applyconvL))); + tempSampleL += (bL[87] * (0.04878235109120615 + (0.02962866516075816*applyconvL))); + //begin LargeCombo conv R + tempSampleR += (bR[1] * (1.31819680801404560 + (0.00362521700518292*applyconvR))); + tempSampleR += (bR[2] * (1.37738284126127919 + (0.14134596126256205*applyconvR))); + tempSampleR += (bR[3] * (1.09957637225311622 + (0.33199581815501555*applyconvR))); + tempSampleR += (bR[4] * (0.62025358899656258 + (0.37476042042088142*applyconvR))); + tempSampleR += (bR[5] * (0.12926194402137478 + (0.24702655568406759*applyconvR))); + tempSampleR -= (bR[6] * (0.28927985011367602 - (0.13289168298307708*applyconvR))); + tempSampleR -= (bR[7] * (0.56518146339033448 - (0.11026641793526121*applyconvR))); + tempSampleR -= (bR[8] * (0.59843200696815069 - (0.10139909232154271*applyconvR))); + tempSampleR -= (bR[9] * (0.45219971861789204 - (0.13313355255903159*applyconvR))); + tempSampleR -= (bR[10] * (0.32520490032331351 - (0.29009061730364216*applyconvR))); + tempSampleR -= (bR[11] * (0.29773131872442909 - (0.45307495356996669*applyconvR))); + tempSampleR -= (bR[12] * (0.31738895975218867 - (0.43198591958928922*applyconvR))); + tempSampleR -= (bR[13] * (0.33336150604703757 - (0.24240412850274029*applyconvR))); + tempSampleR -= (bR[14] * (0.32461638442042151 - (0.02779297492397464*applyconvR))); + tempSampleR -= (bR[15] * (0.27812829473787770 + (0.15565718905032455*applyconvR))); + tempSampleR -= (bR[16] * (0.19413454458668097 + (0.32087693535188599*applyconvR))); + tempSampleR -= (bR[17] * (0.12378036344480114 + (0.37736575956794161*applyconvR))); + tempSampleR -= (bR[18] * (0.12550494837257106 + (0.25593811142722300*applyconvR))); + tempSampleR -= (bR[19] * (0.17725736033713696 + (0.07708896413593636*applyconvR))); + tempSampleR -= (bR[20] * (0.22023699647700670 - (0.01600371273599124*applyconvR))); + tempSampleR -= (bR[21] * (0.21987645486953747 + (0.00973336938352798*applyconvR))); + tempSampleR -= (bR[22] * (0.15014276479707978 + (0.11602269600138954*applyconvR))); + tempSampleR -= (bR[23] * (0.05176520203073560 + (0.20383164255692698*applyconvR))); + tempSampleR -= (bR[24] * (0.04276687165294867 + (0.17785002166834518*applyconvR))); + tempSampleR -= (bR[25] * (0.15951546388137597 + (0.06748854885822464*applyconvR))); + tempSampleR -= (bR[26] * (0.30211952144352616 - (0.03440494237025149*applyconvR))); + tempSampleR -= (bR[27] * (0.36462803375134506 - (0.05874284362202409*applyconvR))); + tempSampleR -= (bR[28] * (0.32283960219377539 + (0.01189623197958362*applyconvR))); + tempSampleR -= (bR[29] * (0.19245178663350720 + (0.11088858383712991*applyconvR))); + tempSampleR += (bR[30] * (0.00681589563349590 - (0.16314250963457660*applyconvR))); + tempSampleR += (bR[31] * (0.20927798345622584 - (0.16952981620487462*applyconvR))); + tempSampleR += (bR[32] * (0.25638846543430976 - (0.11462562122281153*applyconvR))); + tempSampleR += (bR[33] * (0.04584495673888605 + (0.04669671229804190*applyconvR))); + tempSampleR -= (bR[34] * (0.25221561978187662 - (0.19250758741703761*applyconvR))); + tempSampleR -= (bR[35] * (0.35662801992424953 - (0.12244680002787561*applyconvR))); + tempSampleR -= (bR[36] * (0.21498114329314663 + (0.12152120956991189*applyconvR))); + tempSampleR += (bR[37] * (0.00968605571673376 - (0.30597812512858558*applyconvR))); + tempSampleR += (bR[38] * (0.18029119870614621 - (0.31569386468576782*applyconvR))); + tempSampleR += (bR[39] * (0.22744437185251629 - (0.18028438460422197*applyconvR))); + tempSampleR += (bR[40] * (0.09725687638959078 + (0.05479918522830433*applyconvR))); + tempSampleR -= (bR[41] * (0.17970389267353537 - (0.29222750363124067*applyconvR))); + tempSampleR -= (bR[42] * (0.42371969704763018 - (0.34924957781842314*applyconvR))); + tempSampleR -= (bR[43] * (0.43313266755788055 - (0.11503731970288061*applyconvR))); + tempSampleR -= (bR[44] * (0.22178165627851801 + (0.25002925550036226*applyconvR))); + tempSampleR -= (bR[45] * (0.00410198176852576 + (0.43283281457037676*applyconvR))); + tempSampleR += (bR[46] * (0.09072426344812032 - (0.35318250460706446*applyconvR))); + tempSampleR += (bR[47] * (0.08405839183965140 - (0.16936391987143717*applyconvR))); + tempSampleR -= (bR[48] * (0.01110419756114383 - (0.01247164991313877*applyconvR))); + tempSampleR -= (bR[49] * (0.18593334646855278 - (0.14513260199423966*applyconvR))); + tempSampleR -= (bR[50] * (0.33665010871497486 - (0.14456206192169668*applyconvR))); + tempSampleR -= (bR[51] * (0.32644968491439380 + (0.01594380759082303*applyconvR))); + tempSampleR -= (bR[52] * (0.14855437679485431 + (0.23555511219002742*applyconvR))); + tempSampleR += (bR[53] * (0.05113019250820622 - (0.35556617126595202*applyconvR))); + tempSampleR += (bR[54] * (0.12915754942362243 - (0.28571671825750300*applyconvR))); + tempSampleR += (bR[55] * (0.07406865846069306 - (0.10543886479975995*applyconvR))); + tempSampleR -= (bR[56] * (0.03669573814193980 - (0.03194267657582078*applyconvR))); + tempSampleR -= (bR[57] * (0.13429103278009327 - (0.06145796486786051*applyconvR))); + tempSampleR -= (bR[58] * (0.17884021749974641 - (0.00156626902982124*applyconvR))); + tempSampleR -= (bR[59] * (0.16138212225178239 + (0.09402070836837134*applyconvR))); + tempSampleR -= (bR[60] * (0.10867028245257521 + (0.15407963447815898*applyconvR))); + tempSampleR -= (bR[61] * (0.06312416389213464 + (0.11241095544179526*applyconvR))); + tempSampleR -= (bR[62] * (0.05826376574081994 - (0.03635253545701986*applyconvR))); + tempSampleR -= (bR[63] * (0.07991631148258237 - (0.18041947557579863*applyconvR))); + tempSampleR -= (bR[64] * (0.07777397532506500 - (0.20817156738202205*applyconvR))); + tempSampleR -= (bR[65] * (0.03812528734394271 - (0.13679963125162486*applyconvR))); + tempSampleR += (bR[66] * (0.00204900323943951 + (0.04009000730101046*applyconvR))); + tempSampleR += (bR[67] * (0.01779599498119764 - (0.04218637577942354*applyconvR))); + tempSampleR += (bR[68] * (0.00950301949319113 - (0.07908911305044238*applyconvR))); + tempSampleR -= (bR[69] * (0.04283600714814891 + (0.02716262334097985*applyconvR))); + tempSampleR -= (bR[70] * (0.14478320837041933 - (0.08823515277628832*applyconvR))); + tempSampleR -= (bR[71] * (0.23250267035795688 - (0.15334197814956568*applyconvR))); + tempSampleR -= (bR[72] * (0.22369031446225857 - (0.08550989980799503*applyconvR))); + tempSampleR -= (bR[73] * (0.11142757883989868 + (0.08321482928259660*applyconvR))); + tempSampleR += (bR[74] * (0.02752318631713307 - (0.25252906099212968*applyconvR))); + tempSampleR += (bR[75] * (0.11940028414727490 - (0.34358127205009553*applyconvR))); + tempSampleR += (bR[76] * (0.12702057126698307 - (0.31808560130583663*applyconvR))); + tempSampleR += (bR[77] * (0.03639067777025356 - (0.17970282734717846*applyconvR))); + tempSampleR -= (bR[78] * (0.11389848143835518 + (0.00470616711331971*applyconvR))); + tempSampleR -= (bR[79] * (0.23024072979374310 - (0.09772245468884058*applyconvR))); + tempSampleR -= (bR[80] * (0.24389015061112601 - (0.09600959885615798*applyconvR))); + tempSampleR -= (bR[81] * (0.16680269075295703 - (0.05194978963662898*applyconvR))); + tempSampleR -= (bR[82] * (0.05108041495077725 - (0.01796071525570735*applyconvR))); + tempSampleR += (bR[83] * (0.06489835353859555 - (0.00808013770331126*applyconvR))); + tempSampleR += (bR[84] * (0.15481511440233464 - (0.02674063848284838*applyconvR))); + tempSampleR += (bR[85] * (0.18620867857907253 - (0.01786423699465214*applyconvR))); + tempSampleR += (bR[86] * (0.13879832139055756 + (0.01584446839973597*applyconvR))); + tempSampleR += (bR[87] * (0.04878235109120615 + (0.02962866516075816*applyconvR))); + //end LargeCombo conv + break; + case 5: + //begin SmallCombo conv L + tempSampleL += (bL[1] * (1.42133070619855229 - (0.18270903813104500*applyconvL))); + tempSampleL += (bL[2] * (1.47209686171873821 - (0.27954009590498585*applyconvL))); + tempSampleL += (bL[3] * (1.34648011331265294 - (0.47178343556301960*applyconvL))); + tempSampleL += (bL[4] * (0.82133804036124580 - (0.41060189990353935*applyconvL))); + tempSampleL += (bL[5] * (0.21628057120466901 - (0.26062442734317454*applyconvL))); + tempSampleL -= (bL[6] * (0.30306716082877883 + (0.10067648425439185*applyconvL))); + tempSampleL -= (bL[7] * (0.69484313178531876 - (0.09655574841702286*applyconvL))); + tempSampleL -= (bL[8] * (0.88320822356980833 - (0.26501644327144314*applyconvL))); + tempSampleL -= (bL[9] * (0.81326147029423723 - (0.31115926837054075*applyconvL))); + tempSampleL -= (bL[10] * (0.56728759049069222 - (0.23304233545561287*applyconvL))); + tempSampleL -= (bL[11] * (0.33340326645198737 - (0.12361361388240180*applyconvL))); + tempSampleL -= (bL[12] * (0.20280263733605616 - (0.03531960962500105*applyconvL))); + tempSampleL -= (bL[13] * (0.15864533788751345 + (0.00355160825317868*applyconvL))); + tempSampleL -= (bL[14] * (0.12544767480555119 + (0.01979010423176500*applyconvL))); + tempSampleL -= (bL[15] * (0.06666788902658917 + (0.00188830739903378*applyconvL))); + tempSampleL += (bL[16] * (0.02977793355081072 + (0.02304216615605394*applyconvL))); + tempSampleL += (bL[17] * (0.12821526330916558 + (0.02636238376777800*applyconvL))); + tempSampleL += (bL[18] * (0.19933812710210136 - (0.02932657234709721*applyconvL))); + tempSampleL += (bL[19] * (0.18346460191225772 - (0.12859581955080629*applyconvL))); + tempSampleL -= (bL[20] * (0.00088697526755385 + (0.15855257539277415*applyconvL))); + tempSampleL -= (bL[21] * (0.28904286712096761 + (0.06226286786982616*applyconvL))); + tempSampleL -= (bL[22] * (0.49133546282552537 - (0.06512851581813534*applyconvL))); + tempSampleL -= (bL[23] * (0.52908013030763046 - (0.13606992188523465*applyconvL))); + tempSampleL -= (bL[24] * (0.45897241332311706 - (0.15527194946346906*applyconvL))); + tempSampleL -= (bL[25] * (0.35535938629924352 - (0.13634771941703441*applyconvL))); + tempSampleL -= (bL[26] * (0.26185269405237693 - (0.08736651482771546*applyconvL))); + tempSampleL -= (bL[27] * (0.19997351944186473 - (0.01714565029656306*applyconvL))); + tempSampleL -= (bL[28] * (0.18894054145105646 + (0.04557612705740050*applyconvL))); + tempSampleL -= (bL[29] * (0.24043993691153928 + (0.05267500387081067*applyconvL))); + tempSampleL -= (bL[30] * (0.29191852873822671 + (0.01922151122971644*applyconvL))); + tempSampleL -= (bL[31] * (0.29399783430587761 - (0.02238952856106585*applyconvL))); + tempSampleL -= (bL[32] * (0.26662219155294159 - (0.07760819463416335*applyconvL))); + tempSampleL -= (bL[33] * (0.20881206667122221 - (0.11930017354479640*applyconvL))); + tempSampleL -= (bL[34] * (0.12916658879944876 - (0.11798638949823513*applyconvL))); + tempSampleL -= (bL[35] * (0.07678815166012012 - (0.06826864734598684*applyconvL))); + tempSampleL -= (bL[36] * (0.08568505484529348 - (0.00510459741104792*applyconvL))); + tempSampleL -= (bL[37] * (0.13613615872486634 + (0.02288223583971244*applyconvL))); + tempSampleL -= (bL[38] * (0.17426657494209266 + (0.02723737220296440*applyconvL))); + tempSampleL -= (bL[39] * (0.17343619261009030 + (0.01412920547179825*applyconvL))); + tempSampleL -= (bL[40] * (0.14548368977428555 - (0.02640418940455951*applyconvL))); + tempSampleL -= (bL[41] * (0.10485295885802372 - (0.06334665781931498*applyconvL))); + tempSampleL -= (bL[42] * (0.06632268974717079 - (0.05960343688612868*applyconvL))); + tempSampleL -= (bL[43] * (0.06915692039882040 - (0.03541337869596061*applyconvL))); + tempSampleL -= (bL[44] * (0.11889611687783583 - (0.02250608307287119*applyconvL))); + tempSampleL -= (bL[45] * (0.14598456370320673 + (0.00280345943128246*applyconvL))); + tempSampleL -= (bL[46] * (0.12312084125613143 + (0.04947283933434576*applyconvL))); + tempSampleL -= (bL[47] * (0.11379940289994711 + (0.06590080966570636*applyconvL))); + tempSampleL -= (bL[48] * (0.12963290754003182 + (0.02597647654256477*applyconvL))); + tempSampleL -= (bL[49] * (0.12723837402978638 - (0.04942071966927938*applyconvL))); + tempSampleL -= (bL[50] * (0.09185015882996231 - (0.10420810015956679*applyconvL))); + tempSampleL -= (bL[51] * (0.04011592913036545 - (0.10234174227772008*applyconvL))); + tempSampleL += (bL[52] * (0.00992597785057113 + (0.05674042373836896*applyconvL))); + tempSampleL += (bL[53] * (0.04921452178306781 - (0.00222698867111080*applyconvL))); + tempSampleL += (bL[54] * (0.06096504883783566 - (0.04040426549982253*applyconvL))); + tempSampleL += (bL[55] * (0.04113530718724200 - (0.04190143593049960*applyconvL))); + tempSampleL += (bL[56] * (0.01292699017654650 - (0.01121994018532499*applyconvL))); + tempSampleL -= (bL[57] * (0.00437123132431870 - (0.02482497612289103*applyconvL))); + tempSampleL -= (bL[58] * (0.02090571264211918 - (0.03732746039260295*applyconvL))); + tempSampleL -= (bL[59] * (0.04749751678612051 - (0.02960060937328099*applyconvL))); + tempSampleL -= (bL[60] * (0.07675095194206227 - (0.02241927084099648*applyconvL))); + tempSampleL -= (bL[61] * (0.08879414028581609 - (0.01144281133042115*applyconvL))); + tempSampleL -= (bL[62] * (0.07378854974999530 + (0.02518742701599147*applyconvL))); + tempSampleL -= (bL[63] * (0.04677309194488959 + (0.08984657372223502*applyconvL))); + tempSampleL -= (bL[64] * (0.02911874044176449 + (0.14202665940555093*applyconvL))); + tempSampleL -= (bL[65] * (0.02103564720234969 + (0.14640411976171003*applyconvL))); + tempSampleL -= (bL[66] * (0.01940626429101940 + (0.10867274382865903*applyconvL))); + tempSampleL -= (bL[67] * (0.03965401793931531 + (0.04775225375522835*applyconvL))); + tempSampleL -= (bL[68] * (0.08102486457314527 - (0.03204447425666343*applyconvL))); + tempSampleL -= (bL[69] * (0.11794849372825778 - (0.12755667382696789*applyconvL))); + tempSampleL -= (bL[70] * (0.11946469076758266 - (0.20151394599125422*applyconvL))); + tempSampleL -= (bL[71] * (0.07404630324668053 - (0.21300634351769704*applyconvL))); + tempSampleL -= (bL[72] * (0.00477584437144086 - (0.16864707684978708*applyconvL))); + tempSampleL += (bL[73] * (0.05924822014377220 + (0.09394651445109450*applyconvL))); + tempSampleL += (bL[74] * (0.10060989907457370 + (0.00419196431884887*applyconvL))); + tempSampleL += (bL[75] * (0.10817907203844988 - (0.07459664480796091*applyconvL))); + tempSampleL += (bL[76] * (0.08701102204768002 - (0.11129477437630560*applyconvL))); + tempSampleL += (bL[77] * (0.05673785623180162 - (0.10638640242375266*applyconvL))); + tempSampleL += (bL[78] * (0.02944190197442081 - (0.08499792583420167*applyconvL))); + tempSampleL += (bL[79] * (0.01570145445652971 - (0.06190456843465320*applyconvL))); + tempSampleL += (bL[80] * (0.02770233032476748 - (0.04573713136865480*applyconvL))); + tempSampleL += (bL[81] * (0.05417160459175360 - (0.03965651064634598*applyconvL))); + tempSampleL += (bL[82] * (0.06080831637644498 - (0.02909500789113911*applyconvL))); + //begin SmallCombo conv R + tempSampleR += (bR[1] * (1.42133070619855229 - (0.18270903813104500*applyconvR))); + tempSampleR += (bR[2] * (1.47209686171873821 - (0.27954009590498585*applyconvR))); + tempSampleR += (bR[3] * (1.34648011331265294 - (0.47178343556301960*applyconvR))); + tempSampleR += (bR[4] * (0.82133804036124580 - (0.41060189990353935*applyconvR))); + tempSampleR += (bR[5] * (0.21628057120466901 - (0.26062442734317454*applyconvR))); + tempSampleR -= (bR[6] * (0.30306716082877883 + (0.10067648425439185*applyconvR))); + tempSampleR -= (bR[7] * (0.69484313178531876 - (0.09655574841702286*applyconvR))); + tempSampleR -= (bR[8] * (0.88320822356980833 - (0.26501644327144314*applyconvR))); + tempSampleR -= (bR[9] * (0.81326147029423723 - (0.31115926837054075*applyconvR))); + tempSampleR -= (bR[10] * (0.56728759049069222 - (0.23304233545561287*applyconvR))); + tempSampleR -= (bR[11] * (0.33340326645198737 - (0.12361361388240180*applyconvR))); + tempSampleR -= (bR[12] * (0.20280263733605616 - (0.03531960962500105*applyconvR))); + tempSampleR -= (bR[13] * (0.15864533788751345 + (0.00355160825317868*applyconvR))); + tempSampleR -= (bR[14] * (0.12544767480555119 + (0.01979010423176500*applyconvR))); + tempSampleR -= (bR[15] * (0.06666788902658917 + (0.00188830739903378*applyconvR))); + tempSampleR += (bR[16] * (0.02977793355081072 + (0.02304216615605394*applyconvR))); + tempSampleR += (bR[17] * (0.12821526330916558 + (0.02636238376777800*applyconvR))); + tempSampleR += (bR[18] * (0.19933812710210136 - (0.02932657234709721*applyconvR))); + tempSampleR += (bR[19] * (0.18346460191225772 - (0.12859581955080629*applyconvR))); + tempSampleR -= (bR[20] * (0.00088697526755385 + (0.15855257539277415*applyconvR))); + tempSampleR -= (bR[21] * (0.28904286712096761 + (0.06226286786982616*applyconvR))); + tempSampleR -= (bR[22] * (0.49133546282552537 - (0.06512851581813534*applyconvR))); + tempSampleR -= (bR[23] * (0.52908013030763046 - (0.13606992188523465*applyconvR))); + tempSampleR -= (bR[24] * (0.45897241332311706 - (0.15527194946346906*applyconvR))); + tempSampleR -= (bR[25] * (0.35535938629924352 - (0.13634771941703441*applyconvR))); + tempSampleR -= (bR[26] * (0.26185269405237693 - (0.08736651482771546*applyconvR))); + tempSampleR -= (bR[27] * (0.19997351944186473 - (0.01714565029656306*applyconvR))); + tempSampleR -= (bR[28] * (0.18894054145105646 + (0.04557612705740050*applyconvR))); + tempSampleR -= (bR[29] * (0.24043993691153928 + (0.05267500387081067*applyconvR))); + tempSampleR -= (bR[30] * (0.29191852873822671 + (0.01922151122971644*applyconvR))); + tempSampleR -= (bR[31] * (0.29399783430587761 - (0.02238952856106585*applyconvR))); + tempSampleR -= (bR[32] * (0.26662219155294159 - (0.07760819463416335*applyconvR))); + tempSampleR -= (bR[33] * (0.20881206667122221 - (0.11930017354479640*applyconvR))); + tempSampleR -= (bR[34] * (0.12916658879944876 - (0.11798638949823513*applyconvR))); + tempSampleR -= (bR[35] * (0.07678815166012012 - (0.06826864734598684*applyconvR))); + tempSampleR -= (bR[36] * (0.08568505484529348 - (0.00510459741104792*applyconvR))); + tempSampleR -= (bR[37] * (0.13613615872486634 + (0.02288223583971244*applyconvR))); + tempSampleR -= (bR[38] * (0.17426657494209266 + (0.02723737220296440*applyconvR))); + tempSampleR -= (bR[39] * (0.17343619261009030 + (0.01412920547179825*applyconvR))); + tempSampleR -= (bR[40] * (0.14548368977428555 - (0.02640418940455951*applyconvR))); + tempSampleR -= (bR[41] * (0.10485295885802372 - (0.06334665781931498*applyconvR))); + tempSampleR -= (bR[42] * (0.06632268974717079 - (0.05960343688612868*applyconvR))); + tempSampleR -= (bR[43] * (0.06915692039882040 - (0.03541337869596061*applyconvR))); + tempSampleR -= (bR[44] * (0.11889611687783583 - (0.02250608307287119*applyconvR))); + tempSampleR -= (bR[45] * (0.14598456370320673 + (0.00280345943128246*applyconvR))); + tempSampleR -= (bR[46] * (0.12312084125613143 + (0.04947283933434576*applyconvR))); + tempSampleR -= (bR[47] * (0.11379940289994711 + (0.06590080966570636*applyconvR))); + tempSampleR -= (bR[48] * (0.12963290754003182 + (0.02597647654256477*applyconvR))); + tempSampleR -= (bR[49] * (0.12723837402978638 - (0.04942071966927938*applyconvR))); + tempSampleR -= (bR[50] * (0.09185015882996231 - (0.10420810015956679*applyconvR))); + tempSampleR -= (bR[51] * (0.04011592913036545 - (0.10234174227772008*applyconvR))); + tempSampleR += (bR[52] * (0.00992597785057113 + (0.05674042373836896*applyconvR))); + tempSampleR += (bR[53] * (0.04921452178306781 - (0.00222698867111080*applyconvR))); + tempSampleR += (bR[54] * (0.06096504883783566 - (0.04040426549982253*applyconvR))); + tempSampleR += (bR[55] * (0.04113530718724200 - (0.04190143593049960*applyconvR))); + tempSampleR += (bR[56] * (0.01292699017654650 - (0.01121994018532499*applyconvR))); + tempSampleR -= (bR[57] * (0.00437123132431870 - (0.02482497612289103*applyconvR))); + tempSampleR -= (bR[58] * (0.02090571264211918 - (0.03732746039260295*applyconvR))); + tempSampleR -= (bR[59] * (0.04749751678612051 - (0.02960060937328099*applyconvR))); + tempSampleR -= (bR[60] * (0.07675095194206227 - (0.02241927084099648*applyconvR))); + tempSampleR -= (bR[61] * (0.08879414028581609 - (0.01144281133042115*applyconvR))); + tempSampleR -= (bR[62] * (0.07378854974999530 + (0.02518742701599147*applyconvR))); + tempSampleR -= (bR[63] * (0.04677309194488959 + (0.08984657372223502*applyconvR))); + tempSampleR -= (bR[64] * (0.02911874044176449 + (0.14202665940555093*applyconvR))); + tempSampleR -= (bR[65] * (0.02103564720234969 + (0.14640411976171003*applyconvR))); + tempSampleR -= (bR[66] * (0.01940626429101940 + (0.10867274382865903*applyconvR))); + tempSampleR -= (bR[67] * (0.03965401793931531 + (0.04775225375522835*applyconvR))); + tempSampleR -= (bR[68] * (0.08102486457314527 - (0.03204447425666343*applyconvR))); + tempSampleR -= (bR[69] * (0.11794849372825778 - (0.12755667382696789*applyconvR))); + tempSampleR -= (bR[70] * (0.11946469076758266 - (0.20151394599125422*applyconvR))); + tempSampleR -= (bR[71] * (0.07404630324668053 - (0.21300634351769704*applyconvR))); + tempSampleR -= (bR[72] * (0.00477584437144086 - (0.16864707684978708*applyconvR))); + tempSampleR += (bR[73] * (0.05924822014377220 + (0.09394651445109450*applyconvR))); + tempSampleR += (bR[74] * (0.10060989907457370 + (0.00419196431884887*applyconvR))); + tempSampleR += (bR[75] * (0.10817907203844988 - (0.07459664480796091*applyconvR))); + tempSampleR += (bR[76] * (0.08701102204768002 - (0.11129477437630560*applyconvR))); + tempSampleR += (bR[77] * (0.05673785623180162 - (0.10638640242375266*applyconvR))); + tempSampleR += (bR[78] * (0.02944190197442081 - (0.08499792583420167*applyconvR))); + tempSampleR += (bR[79] * (0.01570145445652971 - (0.06190456843465320*applyconvR))); + tempSampleR += (bR[80] * (0.02770233032476748 - (0.04573713136865480*applyconvR))); + tempSampleR += (bR[81] * (0.05417160459175360 - (0.03965651064634598*applyconvR))); + tempSampleR += (bR[82] * (0.06080831637644498 - (0.02909500789113911*applyconvR))); + //end SmallCombo conv + break; + case 6: + //begin Bass conv L + tempSampleL += (bL[1] * (1.35472031405494242 + (0.00220914099195157*applyconvL))); + tempSampleL += (bL[2] * (1.63534207755253003 - (0.11406232654509685*applyconvL))); + tempSampleL += (bL[3] * (1.82334575691525869 - (0.42647194712964054*applyconvL))); + tempSampleL += (bL[4] * (1.86156386235405868 - (0.76744187887586590*applyconvL))); + tempSampleL += (bL[5] * (1.67332739338852599 - (0.95161997324293013*applyconvL))); + tempSampleL += (bL[6] * (1.25054130794899021 - (0.98410433514572859*applyconvL))); + tempSampleL += (bL[7] * (0.70049121047281737 - (0.87375612110718992*applyconvL))); + tempSampleL += (bL[8] * (0.15291791448081560 - (0.61195266024519046*applyconvL))); + tempSampleL -= (bL[9] * (0.37301992914152693 + (0.16755422915252094*applyconvL))); + tempSampleL -= (bL[10] * (0.76568539228498433 - (0.28554435228965386*applyconvL))); + tempSampleL -= (bL[11] * (0.95726568749937369 - (0.61659719162806048*applyconvL))); + tempSampleL -= (bL[12] * (1.01273552193911032 - (0.81827288407943954*applyconvL))); + tempSampleL -= (bL[13] * (0.93920108117234447 - (0.80077111864205874*applyconvL))); + tempSampleL -= (bL[14] * (0.79831898832953974 - (0.65814750339694406*applyconvL))); + tempSampleL -= (bL[15] * (0.64200088100452313 - (0.46135833001232618*applyconvL))); + tempSampleL -= (bL[16] * (0.48807302802822128 - (0.15506178974799034*applyconvL))); + tempSampleL -= (bL[17] * (0.36545171501947982 + (0.16126103769376721*applyconvL))); + tempSampleL -= (bL[18] * (0.31469581455759105 + (0.32250870039053953*applyconvL))); + tempSampleL -= (bL[19] * (0.36893534817945800 + (0.25409418897237473*applyconvL))); + tempSampleL -= (bL[20] * (0.41092557722975687 + (0.13114730488878301*applyconvL))); + tempSampleL -= (bL[21] * (0.38584044480710594 + (0.06825323739722661*applyconvL))); + tempSampleL -= (bL[22] * (0.33378434007178670 + (0.04144255489164217*applyconvL))); + tempSampleL -= (bL[23] * (0.26144203061699706 + (0.06031313105098152*applyconvL))); + tempSampleL -= (bL[24] * (0.25818342000920502 + (0.03642289242586355*applyconvL))); + tempSampleL -= (bL[25] * (0.28096018498822661 + (0.00976973667327174*applyconvL))); + tempSampleL -= (bL[26] * (0.25845682019095384 + (0.02749015358080831*applyconvL))); + tempSampleL -= (bL[27] * (0.26655607865953096 - (0.00329839675455690*applyconvL))); + tempSampleL -= (bL[28] * (0.30590085026938518 - (0.07375043215328811*applyconvL))); + tempSampleL -= (bL[29] * (0.32875683916470899 - (0.12454134857516502*applyconvL))); + tempSampleL -= (bL[30] * (0.38166643180506560 - (0.19973911428609989*applyconvL))); + tempSampleL -= (bL[31] * (0.49068186937289598 - (0.34785166842136384*applyconvL))); + tempSampleL -= (bL[32] * (0.60274753867622777 - (0.48685038872711034*applyconvL))); + tempSampleL -= (bL[33] * (0.65944678627090636 - (0.49844657885975518*applyconvL))); + tempSampleL -= (bL[34] * (0.64488955808717285 - (0.40514406499806987*applyconvL))); + tempSampleL -= (bL[35] * (0.55818730353434354 - (0.28029870614987346*applyconvL))); + tempSampleL -= (bL[36] * (0.43110859113387556 - (0.15373504582939335*applyconvL))); + tempSampleL -= (bL[37] * (0.37726894966096269 - (0.11570983506028532*applyconvL))); + tempSampleL -= (bL[38] * (0.39953242355200935 - (0.17879231130484088*applyconvL))); + tempSampleL -= (bL[39] * (0.36726676379100875 - (0.22013553023983223*applyconvL))); + tempSampleL -= (bL[40] * (0.27187029469227386 - (0.18461171768478427*applyconvL))); + tempSampleL -= (bL[41] * (0.21109334552321635 - (0.14497481318083569*applyconvL))); + tempSampleL -= (bL[42] * (0.19808797405293213 - (0.14916579928186940*applyconvL))); + tempSampleL -= (bL[43] * (0.16287926785495671 - (0.15146098461120627*applyconvL))); + tempSampleL -= (bL[44] * (0.11086621477163359 - (0.13182973443924018*applyconvL))); + tempSampleL -= (bL[45] * (0.07531043236890560 - (0.08062172796472888*applyconvL))); + tempSampleL -= (bL[46] * (0.01747364473230771 + (0.02201865873632456*applyconvL))); + tempSampleL += (bL[47] * (0.03080279125662693 - (0.08721756240972101*applyconvL))); + tempSampleL += (bL[48] * (0.02354148659185142 - (0.06376361763053796*applyconvL))); + tempSampleL -= (bL[49] * (0.02835772372098715 + (0.00589978513642627*applyconvL))); + tempSampleL -= (bL[50] * (0.08983370744565244 - (0.02350960427706536*applyconvL))); + tempSampleL -= (bL[51] * (0.14148947620055380 - (0.03329826628693369*applyconvL))); + tempSampleL -= (bL[52] * (0.17576502674572581 - (0.06507546651241880*applyconvL))); + tempSampleL -= (bL[53] * (0.17168865666573860 - (0.07734801128437317*applyconvL))); + tempSampleL -= (bL[54] * (0.14107027738292105 - (0.03136459344220402*applyconvL))); + tempSampleL -= (bL[55] * (0.12287163395380074 + (0.01933408169185258*applyconvL))); + tempSampleL -= (bL[56] * (0.12276622398112971 + (0.01983508766241737*applyconvL))); + tempSampleL -= (bL[57] * (0.12349721440213673 - (0.01111031415304768*applyconvL))); + tempSampleL -= (bL[58] * (0.08649454142716655 + (0.02252815645513927*applyconvL))); + tempSampleL -= (bL[59] * (0.00953083685474757 + (0.13778878548343007*applyconvL))); + tempSampleL += (bL[60] * (0.06045983158868478 - (0.23966318224935096*applyconvL))); + tempSampleL += (bL[61] * (0.09053229817093242 - (0.27190119941572544*applyconvL))); + tempSampleL += (bL[62] * (0.08112662178843048 - (0.22456862606452327*applyconvL))); + tempSampleL += (bL[63] * (0.07503525686243730 - (0.14330154410548213*applyconvL))); + tempSampleL += (bL[64] * (0.07372595404399729 - (0.06185193766408734*applyconvL))); + tempSampleL += (bL[65] * (0.06073789200080433 + (0.01261857435786178*applyconvL))); + tempSampleL += (bL[66] * (0.04616712695742254 + (0.05851771967084609*applyconvL))); + tempSampleL += (bL[67] * (0.01036235510345900 + (0.08286534414423796*applyconvL))); + tempSampleL -= (bL[68] * (0.03708389413229191 - (0.06695282381039531*applyconvL))); + tempSampleL -= (bL[69] * (0.07092204876981217 - (0.01915829199112784*applyconvL))); + tempSampleL -= (bL[70] * (0.09443579589460312 + (0.01210082455316246*applyconvL))); + tempSampleL -= (bL[71] * (0.07824038577769601 + (0.06121988546065113*applyconvL))); + tempSampleL -= (bL[72] * (0.00854730633079399 + (0.14468518752295506*applyconvL))); + tempSampleL += (bL[73] * (0.06845589924191028 - (0.18902431382592944*applyconvL))); + tempSampleL += (bL[74] * (0.10351569998375465 - (0.13204443060279647*applyconvL))); + tempSampleL += (bL[75] * (0.10513368758532179 - (0.02993199294485649*applyconvL))); + tempSampleL += (bL[76] * (0.08896978950235003 + (0.04074499273825906*applyconvL))); + tempSampleL += (bL[77] * (0.03697537734050980 + (0.09217751130846838*applyconvL))); + tempSampleL -= (bL[78] * (0.04014322441280276 - (0.14062297149365666*applyconvL))); + tempSampleL -= (bL[79] * (0.10505934581398618 - (0.16988861157275814*applyconvL))); + tempSampleL -= (bL[80] * (0.13937661651676272 - (0.15083294570551492*applyconvL))); + tempSampleL -= (bL[81] * (0.13183458845108439 - (0.06657454442471208*applyconvL))); + //begin Bass conv R + tempSampleR += (bR[1] * (1.35472031405494242 + (0.00220914099195157*applyconvR))); + tempSampleR += (bR[2] * (1.63534207755253003 - (0.11406232654509685*applyconvR))); + tempSampleR += (bR[3] * (1.82334575691525869 - (0.42647194712964054*applyconvR))); + tempSampleR += (bR[4] * (1.86156386235405868 - (0.76744187887586590*applyconvR))); + tempSampleR += (bR[5] * (1.67332739338852599 - (0.95161997324293013*applyconvR))); + tempSampleR += (bR[6] * (1.25054130794899021 - (0.98410433514572859*applyconvR))); + tempSampleR += (bR[7] * (0.70049121047281737 - (0.87375612110718992*applyconvR))); + tempSampleR += (bR[8] * (0.15291791448081560 - (0.61195266024519046*applyconvR))); + tempSampleR -= (bR[9] * (0.37301992914152693 + (0.16755422915252094*applyconvR))); + tempSampleR -= (bR[10] * (0.76568539228498433 - (0.28554435228965386*applyconvR))); + tempSampleR -= (bR[11] * (0.95726568749937369 - (0.61659719162806048*applyconvR))); + tempSampleR -= (bR[12] * (1.01273552193911032 - (0.81827288407943954*applyconvR))); + tempSampleR -= (bR[13] * (0.93920108117234447 - (0.80077111864205874*applyconvR))); + tempSampleR -= (bR[14] * (0.79831898832953974 - (0.65814750339694406*applyconvR))); + tempSampleR -= (bR[15] * (0.64200088100452313 - (0.46135833001232618*applyconvR))); + tempSampleR -= (bR[16] * (0.48807302802822128 - (0.15506178974799034*applyconvR))); + tempSampleR -= (bR[17] * (0.36545171501947982 + (0.16126103769376721*applyconvR))); + tempSampleR -= (bR[18] * (0.31469581455759105 + (0.32250870039053953*applyconvR))); + tempSampleR -= (bR[19] * (0.36893534817945800 + (0.25409418897237473*applyconvR))); + tempSampleR -= (bR[20] * (0.41092557722975687 + (0.13114730488878301*applyconvR))); + tempSampleR -= (bR[21] * (0.38584044480710594 + (0.06825323739722661*applyconvR))); + tempSampleR -= (bR[22] * (0.33378434007178670 + (0.04144255489164217*applyconvR))); + tempSampleR -= (bR[23] * (0.26144203061699706 + (0.06031313105098152*applyconvR))); + tempSampleR -= (bR[24] * (0.25818342000920502 + (0.03642289242586355*applyconvR))); + tempSampleR -= (bR[25] * (0.28096018498822661 + (0.00976973667327174*applyconvR))); + tempSampleR -= (bR[26] * (0.25845682019095384 + (0.02749015358080831*applyconvR))); + tempSampleR -= (bR[27] * (0.26655607865953096 - (0.00329839675455690*applyconvR))); + tempSampleR -= (bR[28] * (0.30590085026938518 - (0.07375043215328811*applyconvR))); + tempSampleR -= (bR[29] * (0.32875683916470899 - (0.12454134857516502*applyconvR))); + tempSampleR -= (bR[30] * (0.38166643180506560 - (0.19973911428609989*applyconvR))); + tempSampleR -= (bR[31] * (0.49068186937289598 - (0.34785166842136384*applyconvR))); + tempSampleR -= (bR[32] * (0.60274753867622777 - (0.48685038872711034*applyconvR))); + tempSampleR -= (bR[33] * (0.65944678627090636 - (0.49844657885975518*applyconvR))); + tempSampleR -= (bR[34] * (0.64488955808717285 - (0.40514406499806987*applyconvR))); + tempSampleR -= (bR[35] * (0.55818730353434354 - (0.28029870614987346*applyconvR))); + tempSampleR -= (bR[36] * (0.43110859113387556 - (0.15373504582939335*applyconvR))); + tempSampleR -= (bR[37] * (0.37726894966096269 - (0.11570983506028532*applyconvR))); + tempSampleR -= (bR[38] * (0.39953242355200935 - (0.17879231130484088*applyconvR))); + tempSampleR -= (bR[39] * (0.36726676379100875 - (0.22013553023983223*applyconvR))); + tempSampleR -= (bR[40] * (0.27187029469227386 - (0.18461171768478427*applyconvR))); + tempSampleR -= (bR[41] * (0.21109334552321635 - (0.14497481318083569*applyconvR))); + tempSampleR -= (bR[42] * (0.19808797405293213 - (0.14916579928186940*applyconvR))); + tempSampleR -= (bR[43] * (0.16287926785495671 - (0.15146098461120627*applyconvR))); + tempSampleR -= (bR[44] * (0.11086621477163359 - (0.13182973443924018*applyconvR))); + tempSampleR -= (bR[45] * (0.07531043236890560 - (0.08062172796472888*applyconvR))); + tempSampleR -= (bR[46] * (0.01747364473230771 + (0.02201865873632456*applyconvR))); + tempSampleR += (bR[47] * (0.03080279125662693 - (0.08721756240972101*applyconvR))); + tempSampleR += (bR[48] * (0.02354148659185142 - (0.06376361763053796*applyconvR))); + tempSampleR -= (bR[49] * (0.02835772372098715 + (0.00589978513642627*applyconvR))); + tempSampleR -= (bR[50] * (0.08983370744565244 - (0.02350960427706536*applyconvR))); + tempSampleR -= (bR[51] * (0.14148947620055380 - (0.03329826628693369*applyconvR))); + tempSampleR -= (bR[52] * (0.17576502674572581 - (0.06507546651241880*applyconvR))); + tempSampleR -= (bR[53] * (0.17168865666573860 - (0.07734801128437317*applyconvR))); + tempSampleR -= (bR[54] * (0.14107027738292105 - (0.03136459344220402*applyconvR))); + tempSampleR -= (bR[55] * (0.12287163395380074 + (0.01933408169185258*applyconvR))); + tempSampleR -= (bR[56] * (0.12276622398112971 + (0.01983508766241737*applyconvR))); + tempSampleR -= (bR[57] * (0.12349721440213673 - (0.01111031415304768*applyconvR))); + tempSampleR -= (bR[58] * (0.08649454142716655 + (0.02252815645513927*applyconvR))); + tempSampleR -= (bR[59] * (0.00953083685474757 + (0.13778878548343007*applyconvR))); + tempSampleR += (bR[60] * (0.06045983158868478 - (0.23966318224935096*applyconvR))); + tempSampleR += (bR[61] * (0.09053229817093242 - (0.27190119941572544*applyconvR))); + tempSampleR += (bR[62] * (0.08112662178843048 - (0.22456862606452327*applyconvR))); + tempSampleR += (bR[63] * (0.07503525686243730 - (0.14330154410548213*applyconvR))); + tempSampleR += (bR[64] * (0.07372595404399729 - (0.06185193766408734*applyconvR))); + tempSampleR += (bR[65] * (0.06073789200080433 + (0.01261857435786178*applyconvR))); + tempSampleR += (bR[66] * (0.04616712695742254 + (0.05851771967084609*applyconvR))); + tempSampleR += (bR[67] * (0.01036235510345900 + (0.08286534414423796*applyconvR))); + tempSampleR -= (bR[68] * (0.03708389413229191 - (0.06695282381039531*applyconvR))); + tempSampleR -= (bR[69] * (0.07092204876981217 - (0.01915829199112784*applyconvR))); + tempSampleR -= (bR[70] * (0.09443579589460312 + (0.01210082455316246*applyconvR))); + tempSampleR -= (bR[71] * (0.07824038577769601 + (0.06121988546065113*applyconvR))); + tempSampleR -= (bR[72] * (0.00854730633079399 + (0.14468518752295506*applyconvR))); + tempSampleR += (bR[73] * (0.06845589924191028 - (0.18902431382592944*applyconvR))); + tempSampleR += (bR[74] * (0.10351569998375465 - (0.13204443060279647*applyconvR))); + tempSampleR += (bR[75] * (0.10513368758532179 - (0.02993199294485649*applyconvR))); + tempSampleR += (bR[76] * (0.08896978950235003 + (0.04074499273825906*applyconvR))); + tempSampleR += (bR[77] * (0.03697537734050980 + (0.09217751130846838*applyconvR))); + tempSampleR -= (bR[78] * (0.04014322441280276 - (0.14062297149365666*applyconvR))); + tempSampleR -= (bR[79] * (0.10505934581398618 - (0.16988861157275814*applyconvR))); + tempSampleR -= (bR[80] * (0.13937661651676272 - (0.15083294570551492*applyconvR))); + tempSampleR -= (bR[81] * (0.13183458845108439 - (0.06657454442471208*applyconvR))); + //end Bass conv + break; + } + inputSampleL *= correctdrygain; + inputSampleL += (tempSampleL*colorIntensity); + inputSampleL /= correctboost; + ataHalfwaySampleL += inputSampleL; //-------------------- + inputSampleR *= correctdrygain; + inputSampleR += (tempSampleR*colorIntensity); + inputSampleR /= correctboost; + ataHalfwaySampleR += inputSampleR; + //restore interpolated signal including time domain stuff now + //end center code for handling timedomain/conv stuff + + //second wave of Cabs style slew clamping + clamp = inputSampleL - lastPostSampleL; + if (clamp > threshold) inputSampleL = lastPostSampleL + threshold; + if (-clamp > rarefaction) inputSampleL = lastPostSampleL - rarefaction; + lastPostSampleL = inputSampleL; //------------------------------------- + clamp = inputSampleR - lastPostSampleR; + if (clamp > threshold) inputSampleR = lastPostSampleR + threshold; + if (-clamp > rarefaction) inputSampleR = lastPostSampleR - rarefaction; + lastPostSampleR = inputSampleR; + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + clamp = ataHalfwaySampleL - lastPostHalfSampleL; + if (clamp > threshold) ataHalfwaySampleL = lastPostHalfSampleL + threshold; + if (-clamp > rarefaction) ataHalfwaySampleL = lastPostHalfSampleL - rarefaction; + lastPostHalfSampleL = ataHalfwaySampleL; //---------------------------------- + clamp = ataHalfwaySampleR - lastPostHalfSampleR; + if (clamp > threshold) ataHalfwaySampleR = lastPostHalfSampleR + threshold; + if (-clamp > rarefaction) ataHalfwaySampleR = lastPostHalfSampleR - rarefaction; + lastPostHalfSampleR = ataHalfwaySampleR; + //end interpolated sample + + //post-center code on inputSample and halfwaySample in parallel + //begin raw sample- inputSample and ataDrySample handled separately here + double HeadBumpL; + double HeadBumpR; + if (flip) + { + iirHeadBumpAL += (inputSampleL * HeadBumpFreq); + iirHeadBumpAL -= (iirHeadBumpAL * iirHeadBumpAL * iirHeadBumpAL * HeadBumpFreq); + if (iirHeadBumpAL > 0) iirHeadBumpAL -= dcblock; + if (iirHeadBumpAL < 0) iirHeadBumpAL += dcblock; + if (fabs(iirHeadBumpAL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHeadBumpAL; //----------------------------------------------- + iirHeadBumpAR += (inputSampleR * HeadBumpFreq); + iirHeadBumpAR -= (iirHeadBumpAR * iirHeadBumpAR * iirHeadBumpAR * HeadBumpFreq); + if (iirHeadBumpAR > 0) iirHeadBumpAR -= dcblock; + if (iirHeadBumpAR < 0) iirHeadBumpAR += dcblock; + if (fabs(iirHeadBumpAR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHeadBumpAR; + } + else + { + iirHeadBumpBL += (inputSampleL * HeadBumpFreq); + iirHeadBumpBL -= (iirHeadBumpBL * iirHeadBumpBL * iirHeadBumpBL * HeadBumpFreq); + if (iirHeadBumpBL > 0) iirHeadBumpBL -= dcblock; + if (iirHeadBumpBL < 0) iirHeadBumpBL += dcblock; + if (fabs(iirHeadBumpBL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHeadBumpBL; //--------------------------------------------------- + iirHeadBumpBR += (inputSampleR * HeadBumpFreq); + iirHeadBumpBR -= (iirHeadBumpBR * iirHeadBumpBR * iirHeadBumpBR * HeadBumpFreq); + if (iirHeadBumpBR > 0) iirHeadBumpBR -= dcblock; + if (iirHeadBumpBR < 0) iirHeadBumpBR += dcblock; + if (fabs(iirHeadBumpBR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHeadBumpBR; + } + HeadBumpL /= LowsPad; + inputSampleL = (inputSampleL * (1.0-heavy)) + (HeadBumpL * heavy); //--------------------- + HeadBumpR /= LowsPad; + inputSampleR = (inputSampleR * (1.0-heavy)) + (HeadBumpR * heavy); + //end raw sample + + //begin interpolated sample- change inputSample -> ataHalfwaySample, ataDrySample -> ataHalfDrySample + if (flip) + { + iirHalfHeadBumpAL += (ataHalfwaySampleL * HeadBumpFreq); + iirHalfHeadBumpAL -= (iirHalfHeadBumpAL * iirHalfHeadBumpAL * iirHalfHeadBumpAL * HeadBumpFreq); + if (iirHalfHeadBumpAL > 0) iirHalfHeadBumpAL -= dcblock; + if (iirHalfHeadBumpAL < 0) iirHalfHeadBumpAL += dcblock; + if (fabs(iirHalfHeadBumpAL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHalfHeadBumpAL; //------------------------------------------------------ + iirHalfHeadBumpAR += (ataHalfwaySampleR * HeadBumpFreq); + iirHalfHeadBumpAR -= (iirHalfHeadBumpAR * iirHalfHeadBumpAR * iirHalfHeadBumpAR * HeadBumpFreq); + if (iirHalfHeadBumpAR > 0) iirHalfHeadBumpAR -= dcblock; + if (iirHalfHeadBumpAR < 0) iirHalfHeadBumpAR += dcblock; + if (fabs(iirHalfHeadBumpAR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHalfHeadBumpAR; + } + else + { + iirHalfHeadBumpBL += (ataHalfwaySampleL * HeadBumpFreq); + iirHalfHeadBumpBL -= (iirHalfHeadBumpBL * iirHalfHeadBumpBL * iirHalfHeadBumpBL * HeadBumpFreq); + if (iirHalfHeadBumpBL > 0) iirHalfHeadBumpBL -= dcblock; + if (iirHalfHeadBumpBL < 0) iirHalfHeadBumpBL += dcblock; + if (fabs(iirHalfHeadBumpBL) > 100.0) + {iirHeadBumpAL = 0.0; iirHeadBumpBL = 0.0; iirHalfHeadBumpAL = 0.0; iirHalfHeadBumpBL = 0.0;} + HeadBumpL = iirHalfHeadBumpBL; //--------------------------------------------------- + iirHalfHeadBumpBR += (ataHalfwaySampleR * HeadBumpFreq); + iirHalfHeadBumpBR -= (iirHalfHeadBumpBR * iirHalfHeadBumpBR * iirHalfHeadBumpBR * HeadBumpFreq); + if (iirHalfHeadBumpBR > 0) iirHalfHeadBumpBR -= dcblock; + if (iirHalfHeadBumpBR < 0) iirHalfHeadBumpBR += dcblock; + if (fabs(iirHalfHeadBumpBR) > 100.0) + {iirHeadBumpAR = 0.0; iirHeadBumpBR = 0.0; iirHalfHeadBumpAR = 0.0; iirHalfHeadBumpBR = 0.0;} + HeadBumpR = iirHalfHeadBumpBR; + } + HeadBumpL /= LowsPad; + ataHalfwaySampleL = (ataHalfwaySampleL * (1.0-heavy)) + (HeadBumpL * heavy); //-------------------- + HeadBumpR /= LowsPad; + ataHalfwaySampleR = (ataHalfwaySampleR * (1.0-heavy)) + (HeadBumpR * heavy); + //end interpolated sample + + //begin antialiasing section for halfway sample + ataCL = ataHalfwaySampleL - ataHalfDrySampleL; + if (flip) {ataAL *= 0.94; ataBL *= 0.94; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL;} + else {ataBL *= 0.94; ataAL *= 0.94; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL;} + ataHalfDiffSampleL = (ataCL * 0.94); //--------------------------------- + ataCR = ataHalfwaySampleR - ataHalfDrySampleR; + if (flip) {ataAR *= 0.94; ataBR *= 0.94; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR;} + else {ataBR *= 0.94; ataAR *= 0.94; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR;} + ataHalfDiffSampleR = (ataCR * 0.94); + //end antialiasing section for halfway sample + + //begin antialiasing section for raw sample + ataCL = inputSampleL - ataDrySampleL; + if (flip) {ataAL *= 0.94; ataBL *= 0.94; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL;} + else {ataBL *= 0.94; ataAL *= 0.94; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL;} + ataDiffSampleL = (ataCL * 0.94); //----------------------------- + ataCR = inputSampleR - ataDrySampleR; + if (flip) {ataAR *= 0.94; ataBR *= 0.94; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR;} + else {ataBR *= 0.94; ataAR *= 0.94; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR;} + ataDiffSampleR = (ataCR * 0.94); + //end antialiasing section for input sample + flip = !flip; + + inputSampleL = ataDrySampleL; inputSampleL += ((ataDiffSampleL + ataHalfDiffSampleL + ataPrevDiffSampleL) / 1.0); + ataPrevDiffSampleL = ataDiffSampleL / 2.0; //---------------------------- + inputSampleR = ataDrySampleR; inputSampleR += ((ataDiffSampleR + ataHalfDiffSampleR + ataPrevDiffSampleR) / 1.0); + ataPrevDiffSampleR = ataDiffSampleR / 2.0; + //apply processing as difference to non-oversampled raw input + + clamp = inputSampleL - postPostSampleL; + if (clamp > postThreshold) inputSampleL = postPostSampleL + postThreshold; + if (-clamp > postRarefaction) inputSampleL = postPostSampleL - postRarefaction; + postPostSampleL = inputSampleL; + inputSampleL /= postTrim; + inputSampleL *= output; //------------------------------ + clamp = inputSampleR - postPostSampleR; + if (clamp > postThreshold) inputSampleR = postPostSampleR + postThreshold; + if (-clamp > postRarefaction) inputSampleR = postPostSampleR - postRarefaction; + postPostSampleR = inputSampleR; + inputSampleR /= postTrim; + inputSampleR *= output; + + if (cycleEnd == 4) { + lastRefL[0] = lastRefL[4]; //start from previous last + lastRefL[2] = (lastRefL[0] + inputSampleL)/2; //half + lastRefL[1] = (lastRefL[0] + lastRefL[2])/2; //one quarter + lastRefL[3] = (lastRefL[2] + inputSampleL)/2; //three quarters + lastRefL[4] = inputSampleL; //full + lastRefR[0] = lastRefR[4]; //start from previous last + lastRefR[2] = (lastRefR[0] + inputSampleR)/2; //half + lastRefR[1] = (lastRefR[0] + lastRefR[2])/2; //one quarter + lastRefR[3] = (lastRefR[2] + inputSampleR)/2; //three quarters + lastRefR[4] = inputSampleR; //full + } + if (cycleEnd == 3) { + lastRefL[0] = lastRefL[3]; //start from previous last + lastRefL[2] = (lastRefL[0]+lastRefL[0]+inputSampleL)/3; //third + lastRefL[1] = (lastRefL[0]+inputSampleL+inputSampleL)/3; //two thirds + lastRefL[3] = inputSampleL; //full + lastRefR[0] = lastRefR[3]; //start from previous last + lastRefR[2] = (lastRefR[0]+lastRefR[0]+inputSampleR)/3; //third + lastRefR[1] = (lastRefR[0]+inputSampleR+inputSampleR)/3; //two thirds + lastRefR[3] = inputSampleR; //full + } + if (cycleEnd == 2) { + lastRefL[0] = lastRefL[2]; //start from previous last + lastRefL[1] = (lastRefL[0] + inputSampleL)/2; //half + lastRefL[2] = inputSampleL; //full + lastRefR[0] = lastRefR[2]; //start from previous last + lastRefR[1] = (lastRefR[0] + inputSampleR)/2; //half + lastRefR[2] = inputSampleR; //full + } + if (cycleEnd == 1) { + lastRefL[0] = inputSampleL; + lastRefR[0] = inputSampleR; + } + cycle = 0; //reset + inputSampleL = lastRefL[cycle]; + inputSampleR = lastRefR[cycle]; + } else { + inputSampleL = lastRefL[cycle]; + inputSampleR = lastRefR[cycle]; + //we are going through our references now + } + + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither + + *out1 = inputSampleL; + *out2 = inputSampleR; + + in1++; + in2++; + out1++; + out2++; + } +} diff --git a/plugins/MacSignedVST/Calibre/source/CalibreProc.cpp b/plugins/MacSignedVST/Calibre/source/CalibreProc.cpp index a7d6cd0db..14350eff2 100755 --- a/plugins/MacSignedVST/Calibre/source/CalibreProc.cpp +++ b/plugins/MacSignedVST/Calibre/source/CalibreProc.cpp @@ -37,8 +37,8 @@ void Calibre::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Calibre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Capacitor/source/Capacitor.cpp b/plugins/MacSignedVST/Capacitor/source/Capacitor.cpp index 0ade9c9db..525bf3763 100755 --- a/plugins/MacSignedVST/Capacitor/source/Capacitor.cpp +++ b/plugins/MacSignedVST/Capacitor/source/Capacitor.cpp @@ -51,8 +51,8 @@ Capacitor::Capacitor(audioMasterCallback audioMaster) : lastHighpass = 1000.0; lastWet = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Capacitor/source/Capacitor.h b/plugins/MacSignedVST/Capacitor/source/Capacitor.h index 0799d39d2..7407eb5d1 100755 --- a/plugins/MacSignedVST/Capacitor/source/Capacitor.h +++ b/plugins/MacSignedVST/Capacitor/source/Capacitor.h @@ -94,8 +94,8 @@ private: double lastHighpass; double lastWet; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Capacitor/source/CapacitorProc.cpp b/plugins/MacSignedVST/Capacitor/source/CapacitorProc.cpp index 6b3582b09..f851b2c9e 100755 --- a/plugins/MacSignedVST/Capacitor/source/CapacitorProc.cpp +++ b/plugins/MacSignedVST/Capacitor/source/CapacitorProc.cpp @@ -31,8 +31,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; float drySampleL; float drySampleR; @@ -40,44 +40,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -179,14 +143,14 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -222,8 +186,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -232,44 +196,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -370,16 +298,14 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Capacitor2/source/Capacitor2Proc.cpp b/plugins/MacSignedVST/Capacitor2/source/Capacitor2Proc.cpp index 7799c21a8..899aaaa4a 100755 --- a/plugins/MacSignedVST/Capacitor2/source/Capacitor2Proc.cpp +++ b/plugins/MacSignedVST/Capacitor2/source/Capacitor2Proc.cpp @@ -30,12 +30,12 @@ void Capacitor2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); @@ -193,12 +193,12 @@ void Capacitor2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); diff --git a/plugins/MacSignedVST/Chamber/source/ChamberProc.cpp b/plugins/MacSignedVST/Chamber/source/ChamberProc.cpp index 1dbe7bae0..c536ef030 100755 --- a/plugins/MacSignedVST/Chamber/source/ChamberProc.cpp +++ b/plugins/MacSignedVST/Chamber/source/ChamberProc.cpp @@ -58,12 +58,12 @@ void Chamber::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -314,12 +314,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -501,12 +501,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Channel4/source/Channel4.h b/plugins/MacSignedVST/Channel4/source/Channel4.h index 0338d0a77..e8ca7a260 100755 --- a/plugins/MacSignedVST/Channel4/source/Channel4.h +++ b/plugins/MacSignedVST/Channel4/source/Channel4.h @@ -53,10 +53,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp b/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp index 380e52c9e..a57623d4f 100755 --- a/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp +++ b/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp @@ -25,53 +25,17 @@ void Channel4::processReplacing(float **inputs, float **outputs, VstInt32 sample const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -165,53 +129,17 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/MacSignedVST/Channel5/source/Channel5.cpp b/plugins/MacSignedVST/Channel5/source/Channel5.cpp index 26b592a7d..21581df74 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5.cpp +++ b/plugins/MacSignedVST/Channel5/source/Channel5.cpp @@ -15,8 +15,8 @@ Channel5::Channel5(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/MacSignedVST/Channel5/source/Channel5.h b/plugins/MacSignedVST/Channel5/source/Channel5.h index 07516f7a7..510f34f6a 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5.h +++ b/plugins/MacSignedVST/Channel5/source/Channel5.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp b/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp index 174ee28c5..b029d9303 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp +++ b/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp @@ -23,8 +23,8 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -79,7 +79,7 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); @@ -158,8 +158,8 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -214,7 +214,7 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); diff --git a/plugins/MacSignedVST/Channel6/source/Channel6Proc.cpp b/plugins/MacSignedVST/Channel6/source/Channel6Proc.cpp index b0ad39368..777666f14 100755 --- a/plugins/MacSignedVST/Channel6/source/Channel6Proc.cpp +++ b/plugins/MacSignedVST/Channel6/source/Channel6Proc.cpp @@ -23,8 +23,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -45,8 +45,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -54,7 +54,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -63,7 +63,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section @@ -123,8 +123,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -145,8 +145,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -154,7 +154,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -163,7 +163,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section diff --git a/plugins/MacSignedVST/Channel7/source/Channel7Proc.cpp b/plugins/MacSignedVST/Channel7/source/Channel7Proc.cpp index b19f42671..e9e9a6852 100755 --- a/plugins/MacSignedVST/Channel7/source/Channel7Proc.cpp +++ b/plugins/MacSignedVST/Channel7/source/Channel7Proc.cpp @@ -26,8 +26,8 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -46,16 +46,16 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -63,11 +63,11 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -132,8 +132,8 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -152,16 +152,16 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -169,11 +169,11 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/MacSignedVST/Channel8/source/Channel8Proc.cpp b/plugins/MacSignedVST/Channel8/source/Channel8Proc.cpp index 8442ad2d8..afb1a48fe 100755 --- a/plugins/MacSignedVST/Channel8/source/Channel8Proc.cpp +++ b/plugins/MacSignedVST/Channel8/source/Channel8Proc.cpp @@ -27,8 +27,8 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -50,16 +50,16 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -67,11 +67,11 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -157,8 +157,8 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -180,16 +180,16 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -197,11 +197,11 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/MacSignedVST/Channel9/source/Channel9.h b/plugins/MacSignedVST/Channel9/source/Channel9.h index 5772f32ff..1232f66f6 100755 --- a/plugins/MacSignedVST/Channel9/source/Channel9.h +++ b/plugins/MacSignedVST/Channel9/source/Channel9.h @@ -68,8 +68,8 @@ private: double lastSampleAR; double lastSampleBR; double lastSampleCR; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; double iirAmount; double threshold; double cutoff; diff --git a/plugins/MacSignedVST/Channel9/source/Channel9Proc.cpp b/plugins/MacSignedVST/Channel9/source/Channel9Proc.cpp index 7c37fea56..5ca21ec9c 100755 --- a/plugins/MacSignedVST/Channel9/source/Channel9Proc.cpp +++ b/plugins/MacSignedVST/Channel9/source/Channel9Proc.cpp @@ -46,11 +46,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -83,16 +83,16 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -100,11 +100,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -218,11 +218,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -255,16 +255,16 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -272,11 +272,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -333,12 +333,12 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Chorus/source/Chorus.cpp b/plugins/MacSignedVST/Chorus/source/Chorus.cpp index 1f3965afd..d2a630dff 100755 --- a/plugins/MacSignedVST/Chorus/source/Chorus.cpp +++ b/plugins/MacSignedVST/Chorus/source/Chorus.cpp @@ -28,8 +28,8 @@ Chorus::Chorus(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Chorus/source/Chorus.h b/plugins/MacSignedVST/Chorus/source/Chorus.h index 5508ac3a3..933415bca 100755 --- a/plugins/MacSignedVST/Chorus/source/Chorus.h +++ b/plugins/MacSignedVST/Chorus/source/Chorus.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 16386; float dL[totalsamples]; diff --git a/plugins/MacSignedVST/Chorus/source/ChorusProc.cpp b/plugins/MacSignedVST/Chorus/source/ChorusProc.cpp index 368ade75c..8f02bebbc 100755 --- a/plugins/MacSignedVST/Chorus/source/ChorusProc.cpp +++ b/plugins/MacSignedVST/Chorus/source/ChorusProc.cpp @@ -31,8 +31,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -40,44 +40,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -176,8 +140,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -185,44 +149,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither fpFlip = !fpFlip; *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.cpp b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.cpp index 318b6782b..a9f898ec9 100755 --- a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.cpp +++ b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.cpp @@ -28,8 +28,8 @@ ChorusEnsemble::ChorusEnsemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.h b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.h index e7df33253..8b796e8eb 100755 --- a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.h +++ b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsemble.h @@ -68,8 +68,8 @@ private: double airOddR; double airFactorR; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp index 166324483..8ee1eea32 100755 --- a/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp +++ b/plugins/MacSignedVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp @@ -30,8 +30,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -44,44 +44,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -174,14 +138,14 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -216,8 +180,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -230,44 +194,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -360,16 +288,14 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ChromeOxide/source/ChromeOxideProc.cpp b/plugins/MacSignedVST/ChromeOxide/source/ChromeOxideProc.cpp index 6c2d99f53..be036a80e 100755 --- a/plugins/MacSignedVST/ChromeOxide/source/ChromeOxideProc.cpp +++ b/plugins/MacSignedVST/ChromeOxide/source/ChromeOxideProc.cpp @@ -46,8 +46,8 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -207,8 +207,8 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Cider/source/CiderProc.cpp b/plugins/MacSignedVST/Cider/source/CiderProc.cpp index e5631e4b7..9222a2ea7 100755 --- a/plugins/MacSignedVST/Cider/source/CiderProc.cpp +++ b/plugins/MacSignedVST/Cider/source/CiderProc.cpp @@ -37,8 +37,8 @@ void Cider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Cider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/ClipOnly2/source/ClipOnly2.h b/plugins/MacSignedVST/ClipOnly2/source/ClipOnly2.h index 451dba2fb..efe560d03 100755 --- a/plugins/MacSignedVST/ClipOnly2/source/ClipOnly2.h +++ b/plugins/MacSignedVST/ClipOnly2/source/ClipOnly2.h @@ -51,12 +51,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacSignedVST/Coils/source/Coils.h b/plugins/MacSignedVST/Coils/source/Coils.h index 08171fbee..8a4469ee2 100755 --- a/plugins/MacSignedVST/Coils/source/Coils.h +++ b/plugins/MacSignedVST/Coils/source/Coils.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/Coils/source/CoilsProc.cpp b/plugins/MacSignedVST/Coils/source/CoilsProc.cpp index 409fd66d7..d963e9053 100755 --- a/plugins/MacSignedVST/Coils/source/CoilsProc.cpp +++ b/plugins/MacSignedVST/Coils/source/CoilsProc.cpp @@ -32,14 +32,14 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -51,7 +51,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); @@ -116,14 +116,14 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -135,7 +135,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/MacSignedVST/Coils2/source/Coils2.h b/plugins/MacSignedVST/Coils2/source/Coils2.h index 92cf19efc..0e3f61a3c 100755 --- a/plugins/MacSignedVST/Coils2/source/Coils2.h +++ b/plugins/MacSignedVST/Coils2/source/Coils2.h @@ -54,10 +54,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double hysteresisL; - long double hysteresisR; + double biquadA[15]; + double biquadB[15]; + double hysteresisL; + double hysteresisR; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/Coils2/source/Coils2Proc.cpp b/plugins/MacSignedVST/Coils2/source/Coils2Proc.cpp index 2ae3bf41d..d4466f4bc 100755 --- a/plugins/MacSignedVST/Coils2/source/Coils2Proc.cpp +++ b/plugins/MacSignedVST/Coils2/source/Coils2Proc.cpp @@ -22,7 +22,7 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -42,15 +42,15 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -59,10 +59,10 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -121,7 +121,7 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -141,15 +141,15 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -158,10 +158,10 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -187,12 +187,12 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Cojones/source/Cojones.cpp b/plugins/MacSignedVST/Cojones/source/Cojones.cpp index f1a8359e6..bd6001fa7 100755 --- a/plugins/MacSignedVST/Cojones/source/Cojones.cpp +++ b/plugins/MacSignedVST/Cojones/source/Cojones.cpp @@ -24,8 +24,8 @@ Cojones::Cojones(audioMasterCallback audioMaster) : storedR[0] = storedR[1] = 0.0; diffR[0] = diffR[1] = diffR[2] = diffR[3] = diffR[4] = diffR[5] = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Cojones/source/Cojones.h b/plugins/MacSignedVST/Cojones/source/Cojones.h index 10650f832..519304f48 100755 --- a/plugins/MacSignedVST/Cojones/source/Cojones.h +++ b/plugins/MacSignedVST/Cojones/source/Cojones.h @@ -56,15 +56,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double storedL[2]; - long double diffL[6]; + double storedL[2]; + double diffL[6]; - long double storedR[2]; - long double diffR[6]; + double storedR[2]; + double diffR[6]; float A; float B; diff --git a/plugins/MacSignedVST/Cojones/source/CojonesProc.cpp b/plugins/MacSignedVST/Cojones/source/CojonesProc.cpp index f1af80356..24606e3af 100755 --- a/plugins/MacSignedVST/Cojones/source/CojonesProc.cpp +++ b/plugins/MacSignedVST/Cojones/source/CojonesProc.cpp @@ -24,8 +24,8 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,17 +88,17 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -158,14 +158,14 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -194,8 +194,8 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,17 +258,17 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -328,16 +328,14 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp b/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp index f39d52e6a..921f25b11 100755 --- a/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp +++ b/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp @@ -25,8 +25,8 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -64,13 +64,13 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin drive L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -82,7 +82,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with @@ -240,8 +240,8 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -279,13 +279,13 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -297,7 +297,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp index 0c8e00c34..4db7b1432 100755 --- a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp +++ b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp @@ -22,8 +22,8 @@ Console4Buss::Console4Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/MacSignedVST/Console4Buss/source/Console4BussProc.cpp b/plugins/MacSignedVST/Console4Buss/source/Console4BussProc.cpp index dde872ab2..2b863eaf1 100755 --- a/plugins/MacSignedVST/Console4Buss/source/Console4BussProc.cpp +++ b/plugins/MacSignedVST/Console4Buss/source/Console4BussProc.cpp @@ -18,11 +18,11 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -36,44 +36,8 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -149,11 +113,11 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -166,44 +130,8 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -249,16 +177,14 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Console4Channel/source/Console4Channel.cpp b/plugins/MacSignedVST/Console4Channel/source/Console4Channel.cpp index 2e524a1e5..6e8f95441 100755 --- a/plugins/MacSignedVST/Console4Channel/source/Console4Channel.cpp +++ b/plugins/MacSignedVST/Console4Channel/source/Console4Channel.cpp @@ -20,8 +20,8 @@ Console4Channel::Console4Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/MacSignedVST/Console4Channel/source/Console4ChannelProc.cpp b/plugins/MacSignedVST/Console4Channel/source/Console4ChannelProc.cpp index 3538710ed..eed5c8d67 100755 --- a/plugins/MacSignedVST/Console4Channel/source/Console4ChannelProc.cpp +++ b/plugins/MacSignedVST/Console4Channel/source/Console4ChannelProc.cpp @@ -18,10 +18,10 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; // replace inputgain with gain, serves same purpose. Stereo inputsample. if (settingchase != gain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -101,14 +65,14 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,10 +95,10 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; if (settingchase != gain) { chasespeed *= 2.0; @@ -148,44 +112,8 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -214,16 +142,14 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Console5Buss/source/Console5Buss.cpp b/plugins/MacSignedVST/Console5Buss/source/Console5Buss.cpp index 7e937a84b..69a467ab8 100755 --- a/plugins/MacSignedVST/Console5Buss/source/Console5Buss.cpp +++ b/plugins/MacSignedVST/Console5Buss/source/Console5Buss.cpp @@ -22,8 +22,8 @@ Console5Buss::Console5Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Console5Buss/source/Console5Buss.h b/plugins/MacSignedVST/Console5Buss/source/Console5Buss.h index 0166f3370..81f9d0eac 100755 --- a/plugins/MacSignedVST/Console5Buss/source/Console5Buss.h +++ b/plugins/MacSignedVST/Console5Buss/source/Console5Buss.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Console5Buss/source/Console5BussProc.cpp b/plugins/MacSignedVST/Console5Buss/source/Console5BussProc.cpp index 21069e81e..a61c2e7cb 100755 --- a/plugins/MacSignedVST/Console5Buss/source/Console5BussProc.cpp +++ b/plugins/MacSignedVST/Console5Buss/source/Console5BussProc.cpp @@ -25,8 +25,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -148,14 +112,14 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -185,8 +149,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -199,44 +163,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -308,16 +236,14 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Console5Channel/source/Console5Channel.cpp b/plugins/MacSignedVST/Console5Channel/source/Console5Channel.cpp index 1a8f6fb00..b38d63844 100755 --- a/plugins/MacSignedVST/Console5Channel/source/Console5Channel.cpp +++ b/plugins/MacSignedVST/Console5Channel/source/Console5Channel.cpp @@ -22,8 +22,8 @@ Console5Channel::Console5Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Console5Channel/source/Console5Channel.h b/plugins/MacSignedVST/Console5Channel/source/Console5Channel.h index bbc58b357..17e48be47 100755 --- a/plugins/MacSignedVST/Console5Channel/source/Console5Channel.h +++ b/plugins/MacSignedVST/Console5Channel/source/Console5Channel.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Console5Channel/source/Console5ChannelProc.cpp b/plugins/MacSignedVST/Console5Channel/source/Console5ChannelProc.cpp index a01017008..bab2c5971 100755 --- a/plugins/MacSignedVST/Console5Channel/source/Console5ChannelProc.cpp +++ b/plugins/MacSignedVST/Console5Channel/source/Console5ChannelProc.cpp @@ -25,8 +25,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.cpp b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.cpp index 350a6b379..25995665f 100755 --- a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.cpp +++ b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.cpp @@ -22,8 +22,8 @@ Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.h b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.h index 3265f5ca6..f3a777fbb 100755 --- a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.h +++ b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkCh.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkChProc.cpp b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkChProc.cpp index ba3a84275..60469e11e 100755 --- a/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkChProc.cpp +++ b/plugins/MacSignedVST/Console5DarkCh/source/Console5DarkChProc.cpp @@ -25,8 +25,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Console6Buss/source/Console6BussProc.cpp b/plugins/MacSignedVST/Console6Buss/source/Console6BussProc.cpp index ea597bf6a..03f8fb9a6 100755 --- a/plugins/MacSignedVST/Console6Buss/source/Console6BussProc.cpp +++ b/plugins/MacSignedVST/Console6Buss/source/Console6BussProc.cpp @@ -18,8 +18,8 @@ void Console6Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Console6Channel/source/Console6ChannelProc.cpp b/plugins/MacSignedVST/Console6Channel/source/Console6ChannelProc.cpp index 65d2e793c..2d835fc8c 100755 --- a/plugins/MacSignedVST/Console6Channel/source/Console6ChannelProc.cpp +++ b/plugins/MacSignedVST/Console6Channel/source/Console6ChannelProc.cpp @@ -18,8 +18,8 @@ void Console6Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/xcshareddata/xcschemes/Console7Buss.xcscheme b/plugins/MacSignedVST/Console7Buss/Console7Buss.xcodeproj/xcshareddata/xcschemes/Console7Buss.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Console7Buss/source/Console7Buss.h b/plugins/MacSignedVST/Console7Buss/source/Console7Buss.h index 7fa80b088..0be4fcf81 100755 --- a/plugins/MacSignedVST/Console7Buss/source/Console7Buss.h +++ b/plugins/MacSignedVST/Console7Buss/source/Console7Buss.h @@ -55,8 +55,8 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Console7Buss/source/Console7BussProc.cpp b/plugins/MacSignedVST/Console7Buss/source/Console7BussProc.cpp index 0ef605a6e..6008a31b0 100755 --- a/plugins/MacSignedVST/Console7Buss/source/Console7BussProc.cpp +++ b/plugins/MacSignedVST/Console7Buss/source/Console7BussProc.cpp @@ -14,7 +14,7 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -42,15 +42,15 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -104,7 +104,7 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -132,15 +132,15 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -169,12 +169,12 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Console7Cascade/source/Console7Cascade.h b/plugins/MacSignedVST/Console7Cascade/source/Console7Cascade.h index 13ef6e55e..05254a102 100755 --- a/plugins/MacSignedVST/Console7Cascade/source/Console7Cascade.h +++ b/plugins/MacSignedVST/Console7Cascade/source/Console7Cascade.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Console7Cascade/source/Console7CascadeProc.cpp b/plugins/MacSignedVST/Console7Cascade/source/Console7CascadeProc.cpp index d210ca9a8..f004da812 100755 --- a/plugins/MacSignedVST/Console7Cascade/source/Console7CascadeProc.cpp +++ b/plugins/MacSignedVST/Console7Cascade/source/Console7CascadeProc.cpp @@ -14,7 +14,7 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/xcshareddata/xcschemes/Console7Channel.xcscheme b/plugins/MacSignedVST/Console7Channel/Console7Channel.xcodeproj/xcshareddata/xcschemes/Console7Channel.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Console7Channel/source/Console7Channel.h b/plugins/MacSignedVST/Console7Channel/source/Console7Channel.h index 7833df454..7c8703c47 100755 --- a/plugins/MacSignedVST/Console7Channel/source/Console7Channel.h +++ b/plugins/MacSignedVST/Console7Channel/source/Console7Channel.h @@ -55,7 +55,7 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Console7Channel/source/Console7ChannelProc.cpp b/plugins/MacSignedVST/Console7Channel/source/Console7ChannelProc.cpp index 18976ea5e..b683073da 100755 --- a/plugins/MacSignedVST/Console7Channel/source/Console7ChannelProc.cpp +++ b/plugins/MacSignedVST/Console7Channel/source/Console7ChannelProc.cpp @@ -14,7 +14,7 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -36,15 +36,15 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -94,7 +94,7 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -116,15 +116,15 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -149,12 +149,12 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Console7Crunch/source/Console7Crunch.h b/plugins/MacSignedVST/Console7Crunch/source/Console7Crunch.h index fad7640a6..cb1c47ff2 100755 --- a/plugins/MacSignedVST/Console7Crunch/source/Console7Crunch.h +++ b/plugins/MacSignedVST/Console7Crunch/source/Console7Crunch.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Console7Crunch/source/Console7CrunchProc.cpp b/plugins/MacSignedVST/Console7Crunch/source/Console7CrunchProc.cpp index f4c07fc9d..7dac81098 100755 --- a/plugins/MacSignedVST/Console7Crunch/source/Console7CrunchProc.cpp +++ b/plugins/MacSignedVST/Console7Crunch/source/Console7CrunchProc.cpp @@ -14,7 +14,7 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp index 6653b9192..d634bfc08 100755 --- a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp +++ b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp @@ -36,8 +36,8 @@ CrunchyGrooveWear::CrunchyGrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h index 3489e5bd3..3ccd654a6 100755 --- a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h +++ b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp index 3c9762ef2..632ee3f59 100755 --- a/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp +++ b/plugins/MacSignedVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp @@ -99,51 +99,15 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -431,14 +395,14 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -542,51 +506,15 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -874,16 +802,14 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Crystal/source/Crystal.cpp b/plugins/MacSignedVST/Crystal/source/Crystal.cpp index 705fe2a99..67db8482c 100755 --- a/plugins/MacSignedVST/Crystal/source/Crystal.cpp +++ b/plugins/MacSignedVST/Crystal/source/Crystal.cpp @@ -19,8 +19,8 @@ Crystal::Crystal(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bL[count] = 0; bR[count] = 0;} lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Crystal/source/Crystal.h b/plugins/MacSignedVST/Crystal/source/Crystal.h index 45ebb6ad0..524bbc595 100755 --- a/plugins/MacSignedVST/Crystal/source/Crystal.h +++ b/plugins/MacSignedVST/Crystal/source/Crystal.h @@ -60,8 +60,8 @@ private: double bR[35]; double lastSampleR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Crystal/source/CrystalProc.cpp b/plugins/MacSignedVST/Crystal/source/CrystalProc.cpp index 7e696a70f..f5d6746b1 100755 --- a/plugins/MacSignedVST/Crystal/source/CrystalProc.cpp +++ b/plugins/MacSignedVST/Crystal/source/CrystalProc.cpp @@ -37,8 +37,8 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -191,14 +191,14 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -240,8 +240,8 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -394,16 +394,14 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Dark/source/DarkProc.cpp b/plugins/MacSignedVST/Dark/source/DarkProc.cpp index 955a53f85..811fdf384 100755 --- a/plugins/MacSignedVST/Dark/source/DarkProc.cpp +++ b/plugins/MacSignedVST/Dark/source/DarkProc.cpp @@ -34,8 +34,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -149,8 +149,8 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/DarkNoise/source/DarkNoiseProc.cpp b/plugins/MacSignedVST/DarkNoise/source/DarkNoiseProc.cpp index be7b9d0b5..cb4f3428f 100755 --- a/plugins/MacSignedVST/DarkNoise/source/DarkNoiseProc.cpp +++ b/plugins/MacSignedVST/DarkNoise/source/DarkNoiseProc.cpp @@ -51,12 +51,12 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -92,8 +92,8 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -184,12 +184,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -225,8 +225,8 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -255,12 +255,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/DeBess/source/DeBess.h b/plugins/MacSignedVST/DeBess/source/DeBess.h index b60d94f0a..26e8bb620 100755 --- a/plugins/MacSignedVST/DeBess/source/DeBess.h +++ b/plugins/MacSignedVST/DeBess/source/DeBess.h @@ -56,13 +56,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double sL[41], mL[41], cL[41]; + double sL[41], mL[41], cL[41]; double ratioAL; double ratioBL; double iirSampleAL; double iirSampleBL; - long double sR[41], mR[41], cR[41]; + double sR[41], mR[41], cR[41]; double ratioAR; double ratioBR; double iirSampleAR; diff --git a/plugins/MacSignedVST/DeBess/source/DeBessProc.cpp b/plugins/MacSignedVST/DeBess/source/DeBessProc.cpp index 05d4b5668..075c9de3e 100755 --- a/plugins/MacSignedVST/DeBess/source/DeBessProc.cpp +++ b/plugins/MacSignedVST/DeBess/source/DeBessProc.cpp @@ -28,8 +28,8 @@ void DeBess::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -130,8 +130,8 @@ void DeBess::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/DeEss/source/DeEss.cpp b/plugins/MacSignedVST/DeEss/source/DeEss.cpp index 64a9503df..f57f5c63c 100755 --- a/plugins/MacSignedVST/DeEss/source/DeEss.cpp +++ b/plugins/MacSignedVST/DeEss/source/DeEss.cpp @@ -32,8 +32,8 @@ DeEss::DeEss(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/DeEss/source/DeEss.h b/plugins/MacSignedVST/DeEss/source/DeEss.h index dcab1e6c3..93afbe7b9 100755 --- a/plugins/MacSignedVST/DeEss/source/DeEss.h +++ b/plugins/MacSignedVST/DeEss/source/DeEss.h @@ -103,8 +103,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/DeEss/source/DeEssProc.cpp b/plugins/MacSignedVST/DeEss/source/DeEssProc.cpp index 9b030a4c6..3f9adf647 100755 --- a/plugins/MacSignedVST/DeEss/source/DeEssProc.cpp +++ b/plugins/MacSignedVST/DeEss/source/DeEssProc.cpp @@ -28,8 +28,8 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -148,14 +148,14 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,8 +188,8 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -308,16 +308,14 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DeHiss/source/DeHissProc.cpp b/plugins/MacSignedVST/DeHiss/source/DeHissProc.cpp index 405566e8a..41074f9c5 100755 --- a/plugins/MacSignedVST/DeHiss/source/DeHissProc.cpp +++ b/plugins/MacSignedVST/DeHiss/source/DeHissProc.cpp @@ -35,12 +35,12 @@ void DeHiss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; @@ -166,12 +166,12 @@ void DeHiss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; diff --git a/plugins/MacSignedVST/DeRez/source/DeRez.cpp b/plugins/MacSignedVST/DeRez/source/DeRez.cpp index cb9b514a8..f24f99df9 100755 --- a/plugins/MacSignedVST/DeRez/source/DeRez.cpp +++ b/plugins/MacSignedVST/DeRez/source/DeRez.cpp @@ -23,8 +23,8 @@ DeRez::DeRez(audioMasterCallback audioMaster) : incrementA = 0.0; incrementB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/DeRez/source/DeRez.h b/plugins/MacSignedVST/DeRez/source/DeRez.h index 8ebdcd9d6..85cfe1c66 100755 --- a/plugins/MacSignedVST/DeRez/source/DeRez.h +++ b/plugins/MacSignedVST/DeRez/source/DeRez.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/DeRez/source/DeRezProc.cpp b/plugins/MacSignedVST/DeRez/source/DeRezProc.cpp index cbe42d57d..36cb20004 100755 --- a/plugins/MacSignedVST/DeRez/source/DeRezProc.cpp +++ b/plugins/MacSignedVST/DeRez/source/DeRezProc.cpp @@ -26,48 +26,12 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -75,8 +39,8 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -90,7 +54,7 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -130,14 +94,14 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,48 +132,12 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -217,8 +145,8 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -232,7 +160,7 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -272,16 +200,14 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DeRez2/source/DeRez2Proc.cpp b/plugins/MacSignedVST/DeRez2/source/DeRez2Proc.cpp index 889fd79b4..d43944d9e 100755 --- a/plugins/MacSignedVST/DeRez2/source/DeRez2Proc.cpp +++ b/plugins/MacSignedVST/DeRez2/source/DeRez2Proc.cpp @@ -28,12 +28,12 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -42,8 +42,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -57,8 +57,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; @@ -206,12 +206,12 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -220,8 +220,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -235,8 +235,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; diff --git a/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp b/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp index 6b109e1ed..e7146df5d 100755 --- a/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp +++ b/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp @@ -32,8 +32,8 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -217,8 +217,8 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Density/source/Density.cpp b/plugins/MacSignedVST/Density/source/Density.cpp index bac4fb24b..01ad61f14 100755 --- a/plugins/MacSignedVST/Density/source/Density.cpp +++ b/plugins/MacSignedVST/Density/source/Density.cpp @@ -21,8 +21,8 @@ Density::Density(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Density/source/Density.h b/plugins/MacSignedVST/Density/source/Density.h index b634c4475..0f188b3bb 100755 --- a/plugins/MacSignedVST/Density/source/Density.h +++ b/plugins/MacSignedVST/Density/source/Density.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacSignedVST/Density/source/DensityProc.cpp b/plugins/MacSignedVST/Density/source/DensityProc.cpp index f229a9ded..5db9e5022 100755 --- a/plugins/MacSignedVST/Density/source/DensityProc.cpp +++ b/plugins/MacSignedVST/Density/source/DensityProc.cpp @@ -27,53 +27,17 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -187,53 +151,17 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Density2/source/Density2.h b/plugins/MacSignedVST/Density2/source/Density2.h index cca180d09..eb0ca981c 100755 --- a/plugins/MacSignedVST/Density2/source/Density2.h +++ b/plugins/MacSignedVST/Density2/source/Density2.h @@ -59,25 +59,25 @@ private: uint32_t fpdR; //default stuff - long double last3SampleL; - long double last2SampleL; - long double last1SampleL; - long double ataAL; - long double ataBL; - long double ataCL; - long double lastDiffSampleL; - long double iirSampleAL; - long double iirSampleBL; + double last3SampleL; + double last2SampleL; + double last1SampleL; + double ataAL; + double ataBL; + double ataCL; + double lastDiffSampleL; + double iirSampleAL; + double iirSampleBL; - long double last3SampleR; - long double last2SampleR; - long double last1SampleR; - long double ataAR; - long double ataBR; - long double ataCR; - long double lastDiffSampleR; - long double iirSampleAR; - long double iirSampleBR; + double last3SampleR; + double last2SampleR; + double last1SampleR; + double ataAR; + double ataBR; + double ataCR; + double lastDiffSampleR; + double iirSampleAR; + double iirSampleBR; float A; float B; diff --git a/plugins/MacSignedVST/Density2/source/Density2Proc.cpp b/plugins/MacSignedVST/Density2/source/Density2Proc.cpp index e266cd26a..bd79936ab 100755 --- a/plugins/MacSignedVST/Density2/source/Density2Proc.cpp +++ b/plugins/MacSignedVST/Density2/source/Density2Proc.cpp @@ -27,18 +27,18 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -46,7 +46,7 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -83,12 +83,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -128,12 +128,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -184,18 +184,18 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -203,7 +203,7 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -240,12 +240,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -285,12 +285,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -303,12 +303,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet); //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Desk/source/Desk.cpp b/plugins/MacSignedVST/Desk/source/Desk.cpp index 9582f0459..a23bbc3b5 100755 --- a/plugins/MacSignedVST/Desk/source/Desk.cpp +++ b/plugins/MacSignedVST/Desk/source/Desk.cpp @@ -18,8 +18,8 @@ Desk::Desk(audioMasterCallback audioMaster) : lastSampleR = 0.0; lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Desk/source/Desk.h b/plugins/MacSignedVST/Desk/source/Desk.h index f7f933df0..b33f2bf52 100755 --- a/plugins/MacSignedVST/Desk/source/Desk.h +++ b/plugins/MacSignedVST/Desk/source/Desk.h @@ -51,15 +51,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacSignedVST/Desk/source/DeskProc.cpp b/plugins/MacSignedVST/Desk/source/DeskProc.cpp index d53894b86..328e06643 100755 --- a/plugins/MacSignedVST/Desk/source/DeskProc.cpp +++ b/plugins/MacSignedVST/Desk/source/DeskProc.cpp @@ -30,53 +30,17 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR /= gain; //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -190,53 +154,17 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR /= gain; //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Desk4/source/Desk4.cpp b/plugins/MacSignedVST/Desk4/source/Desk4.cpp index 0a05d870b..ebf1daadb 100755 --- a/plugins/MacSignedVST/Desk4/source/Desk4.cpp +++ b/plugins/MacSignedVST/Desk4/source/Desk4.cpp @@ -30,8 +30,8 @@ Desk4::Desk4(audioMasterCallback audioMaster) : lastSlewR = 0.0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Desk4/source/Desk4.h b/plugins/MacSignedVST/Desk4/source/Desk4.h index 802ee4733..8b1a72406 100755 --- a/plugins/MacSignedVST/Desk4/source/Desk4.h +++ b/plugins/MacSignedVST/Desk4/source/Desk4.h @@ -70,8 +70,8 @@ private: double lastSlewR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Desk4/source/Desk4Proc.cpp b/plugins/MacSignedVST/Desk4/source/Desk4Proc.cpp index fd165b697..0426cc218 100755 --- a/plugins/MacSignedVST/Desk4/source/Desk4Proc.cpp +++ b/plugins/MacSignedVST/Desk4/source/Desk4Proc.cpp @@ -48,51 +48,15 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,14 +190,14 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -286,51 +250,15 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -464,16 +392,14 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DigitalBlack/source/DigitalBlackProc.cpp b/plugins/MacSignedVST/DigitalBlack/source/DigitalBlackProc.cpp index 758a5d899..8caeff273 100755 --- a/plugins/MacSignedVST/DigitalBlack/source/DigitalBlackProc.cpp +++ b/plugins/MacSignedVST/DigitalBlack/source/DigitalBlackProc.cpp @@ -24,12 +24,12 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -67,7 +67,7 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); @@ -125,12 +125,12 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -168,7 +168,7 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/MacSignedVST/Distance/source/Distance.cpp b/plugins/MacSignedVST/Distance/source/Distance.cpp index 7ccd8fba2..ca1806e47 100755 --- a/plugins/MacSignedVST/Distance/source/Distance.cpp +++ b/plugins/MacSignedVST/Distance/source/Distance.cpp @@ -16,8 +16,8 @@ Distance::Distance(audioMasterCallback audioMaster) : B = 1.0; thirdresultL = prevresultL = lastclampL = clampL = changeL = lastL = 0.0; thirdresultR = prevresultR = lastclampR = clampR = changeR = lastR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Distance/source/Distance.h b/plugins/MacSignedVST/Distance/source/Distance.h index 5566f8485..021335d65 100755 --- a/plugins/MacSignedVST/Distance/source/Distance.h +++ b/plugins/MacSignedVST/Distance/source/Distance.h @@ -67,8 +67,8 @@ private: double prevresultR; double lastR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Distance/source/DistanceProc.cpp b/plugins/MacSignedVST/Distance/source/DistanceProc.cpp index 32eb3fa9d..30065e778 100755 --- a/plugins/MacSignedVST/Distance/source/DistanceProc.cpp +++ b/plugins/MacSignedVST/Distance/source/DistanceProc.cpp @@ -28,53 +28,17 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -123,14 +87,14 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -163,53 +127,17 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -258,16 +186,14 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Distance2/source/Distance2.cpp b/plugins/MacSignedVST/Distance2/source/Distance2.cpp index d6e26d85e..8e1e63871 100755 --- a/plugins/MacSignedVST/Distance2/source/Distance2.cpp +++ b/plugins/MacSignedVST/Distance2/source/Distance2.cpp @@ -61,8 +61,8 @@ Distance2::Distance2(audioMasterCallback audioMaster) : thresholdL = 1.763323098246125; thresholdM = 1.939655408070737; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Distance2/source/Distance2.h b/plugins/MacSignedVST/Distance2/source/Distance2.h index dba008f6a..17d29134d 100755 --- a/plugins/MacSignedVST/Distance2/source/Distance2.h +++ b/plugins/MacSignedVST/Distance2/source/Distance2.h @@ -54,51 +54,51 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; double thirdSampleL; double lastSampleL; diff --git a/plugins/MacSignedVST/Distance2/source/Distance2Proc.cpp b/plugins/MacSignedVST/Distance2/source/Distance2Proc.cpp index 473f3c86e..0a92a9268 100755 --- a/plugins/MacSignedVST/Distance2/source/Distance2Proc.cpp +++ b/plugins/MacSignedVST/Distance2/source/Distance2Proc.cpp @@ -43,8 +43,8 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -97,7 +97,7 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -266,14 +266,14 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -321,8 +321,8 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -375,7 +375,7 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -544,16 +544,14 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Distortion/source/Distortion.h b/plugins/MacSignedVST/Distortion/source/Distortion.h index 53ccfde6c..c0f2d7553 100755 --- a/plugins/MacSignedVST/Distortion/source/Distortion.h +++ b/plugins/MacSignedVST/Distortion/source/Distortion.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousInL[9]; - long double previousOutL[9]; - long double previousInR[9]; - long double previousOutR[9]; + double previousInL[9]; + double previousOutL[9]; + double previousInR[9]; + double previousOutR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/Distortion/source/DistortionProc.cpp b/plugins/MacSignedVST/Distortion/source/DistortionProc.cpp index 31b455c6e..8d6a4f8b0 100755 --- a/plugins/MacSignedVST/Distortion/source/DistortionProc.cpp +++ b/plugins/MacSignedVST/Distortion/source/DistortionProc.cpp @@ -23,18 +23,18 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -74,14 +74,14 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -90,7 +90,7 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; @@ -144,18 +144,18 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -195,14 +195,14 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -211,7 +211,7 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; diff --git a/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp b/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp index a7121e8ac..80e204250 100755 --- a/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp +++ b/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp @@ -19,9 +19,9 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -63,8 +63,8 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); @@ -104,9 +104,9 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -148,8 +148,8 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); diff --git a/plugins/MacSignedVST/DitherMeDiskers/source/DitherMeDiskers.h b/plugins/MacSignedVST/DitherMeDiskers/source/DitherMeDiskers.h index 11f769eb2..4ba134f9a 100755 --- a/plugins/MacSignedVST/DitherMeDiskers/source/DitherMeDiskers.h +++ b/plugins/MacSignedVST/DitherMeDiskers/source/DitherMeDiskers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/MacSignedVST/DitherMeTimbers/source/DitherMeTimbers.h b/plugins/MacSignedVST/DitherMeTimbers/source/DitherMeTimbers.h index 58daf0f03..03d712ee0 100755 --- a/plugins/MacSignedVST/DitherMeTimbers/source/DitherMeTimbers.h +++ b/plugins/MacSignedVST/DitherMeTimbers/source/DitherMeTimbers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h b/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h index fa54082b1..164f37bab 100755 --- a/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h +++ b/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h @@ -54,8 +54,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double contingentErrL; double contingentErrR; double currentDitherL; @@ -68,10 +68,10 @@ private: double NSOddR; double prevR; double nsR[16]; - long double lastSampleL; - long double outSampleL; - long double lastSampleR; - long double outSampleR; + double lastSampleL; + double outSampleL; + double lastSampleR; + double outSampleR; double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp b/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp index 4906413e8..8851aeaa0 100755 --- a/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp +++ b/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp @@ -15,31 +15,31 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -48,46 +48,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; float drySampleL = inputSampleL; float drySampleR = inputSampleR; @@ -1020,31 +984,31 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -1053,46 +1017,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; diff --git a/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp b/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp index 66de94f5c..0ba4cae2b 100755 --- a/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp +++ b/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp @@ -17,51 +17,15 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -136,51 +100,15 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacSignedVST/Drive/source/Drive.cpp b/plugins/MacSignedVST/Drive/source/Drive.cpp index ac5f228ae..e88a7b678 100755 --- a/plugins/MacSignedVST/Drive/source/Drive.cpp +++ b/plugins/MacSignedVST/Drive/source/Drive.cpp @@ -21,8 +21,8 @@ Drive::Drive(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Drive/source/Drive.h b/plugins/MacSignedVST/Drive/source/Drive.h index 525a09eb0..5b9bf5910 100755 --- a/plugins/MacSignedVST/Drive/source/Drive.h +++ b/plugins/MacSignedVST/Drive/source/Drive.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacSignedVST/Drive/source/DriveProc.cpp b/plugins/MacSignedVST/Drive/source/DriveProc.cpp index 074ccfd3c..d30635b48 100755 --- a/plugins/MacSignedVST/Drive/source/DriveProc.cpp +++ b/plugins/MacSignedVST/Drive/source/DriveProc.cpp @@ -27,53 +27,17 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -127,14 +91,14 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,53 +130,17 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -266,16 +194,14 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DrumSlam/source/DrumSlam.cpp b/plugins/MacSignedVST/DrumSlam/source/DrumSlam.cpp index 5b8861982..7449845c9 100755 --- a/plugins/MacSignedVST/DrumSlam/source/DrumSlam.cpp +++ b/plugins/MacSignedVST/DrumSlam/source/DrumSlam.cpp @@ -36,8 +36,8 @@ DrumSlam::DrumSlam(audioMasterCallback audioMaster) : iirSampleHR = 0.0; lastSampleR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/DrumSlam/source/DrumSlam.h b/plugins/MacSignedVST/DrumSlam/source/DrumSlam.h index 418282d59..3d83fce09 100755 --- a/plugins/MacSignedVST/DrumSlam/source/DrumSlam.h +++ b/plugins/MacSignedVST/DrumSlam/source/DrumSlam.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/MacSignedVST/DrumSlam/source/DrumSlamProc.cpp b/plugins/MacSignedVST/DrumSlam/source/DrumSlamProc.cpp index 2e86142c7..ab071ac1e 100755 --- a/plugins/MacSignedVST/DrumSlam/source/DrumSlamProc.cpp +++ b/plugins/MacSignedVST/DrumSlam/source/DrumSlamProc.cpp @@ -28,54 +28,18 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -147,10 +111,10 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -219,14 +183,14 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -259,54 +223,18 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -378,10 +306,10 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -450,16 +378,14 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DubCenter/source/DubCenter.cpp b/plugins/MacSignedVST/DubCenter/source/DubCenter.cpp index 098e72313..ed7ff1c06 100755 --- a/plugins/MacSignedVST/DubCenter/source/DubCenter.cpp +++ b/plugins/MacSignedVST/DubCenter/source/DubCenter.cpp @@ -80,8 +80,8 @@ DubCenter::DubCenter(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/DubCenter/source/DubCenter.h b/plugins/MacSignedVST/DubCenter/source/DubCenter.h index 9d7c7e6fb..54b9eeb59 100755 --- a/plugins/MacSignedVST/DubCenter/source/DubCenter.h +++ b/plugins/MacSignedVST/DubCenter/source/DubCenter.h @@ -117,8 +117,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp b/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp index b0c49a397..49806b773 100755 --- a/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp +++ b/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp @@ -49,8 +49,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,8 +88,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -306,14 +306,14 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -366,8 +366,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -405,8 +405,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -623,16 +623,14 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DubSub/source/DubSub.cpp b/plugins/MacSignedVST/DubSub/source/DubSub.cpp index 6dc87fcbe..e53c47dcc 100755 --- a/plugins/MacSignedVST/DubSub/source/DubSub.cpp +++ b/plugins/MacSignedVST/DubSub/source/DubSub.cpp @@ -118,8 +118,8 @@ DubSub::DubSub(audioMasterCallback audioMaster) : oscGateL = 1.0; oscGateR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/DubSub/source/DubSub.h b/plugins/MacSignedVST/DubSub/source/DubSub.h index 0e26cfad4..4f3f6af8c 100755 --- a/plugins/MacSignedVST/DubSub/source/DubSub.h +++ b/plugins/MacSignedVST/DubSub/source/DubSub.h @@ -159,8 +159,8 @@ private: double oscGateR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp b/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp index 7a0349d51..4195d3b38 100755 --- a/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp +++ b/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp @@ -53,8 +53,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -92,8 +92,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aDubSub. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -392,14 +392,14 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -457,8 +457,8 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -795,16 +795,14 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/DustBunny/source/DustBunnyProc.cpp b/plugins/MacSignedVST/DustBunny/source/DustBunnyProc.cpp index 27a8d66c0..d4667fdec 100755 --- a/plugins/MacSignedVST/DustBunny/source/DustBunnyProc.cpp +++ b/plugins/MacSignedVST/DustBunny/source/DustBunnyProc.cpp @@ -25,44 +25,8 @@ void DustBunny::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -144,52 +108,16 @@ void DustBunny::processDoubleReplacing(double **inputs, double **outputs, VstInt unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); bunny = (bunny*bunny); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/MacSignedVST/Dyno/source/DynoProc.cpp b/plugins/MacSignedVST/Dyno/source/DynoProc.cpp index f01381c06..3e9052c73 100755 --- a/plugins/MacSignedVST/Dyno/source/DynoProc.cpp +++ b/plugins/MacSignedVST/Dyno/source/DynoProc.cpp @@ -18,8 +18,8 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); @@ -65,8 +65,8 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); diff --git a/plugins/MacSignedVST/EQ/source/EQ.cpp b/plugins/MacSignedVST/EQ/source/EQ.cpp index f2e4e0134..702dd33d4 100755 --- a/plugins/MacSignedVST/EQ/source/EQ.cpp +++ b/plugins/MacSignedVST/EQ/source/EQ.cpp @@ -111,8 +111,8 @@ EQ::EQ(audioMasterCallback audioMaster) : flip = false; flipthree = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/EQ/source/EQ.h b/plugins/MacSignedVST/EQ/source/EQ.h index 26fade4aa..7d533787f 100755 --- a/plugins/MacSignedVST/EQ/source/EQ.h +++ b/plugins/MacSignedVST/EQ/source/EQ.h @@ -59,8 +59,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/EQ/source/EQProc.cpp b/plugins/MacSignedVST/EQ/source/EQProc.cpp index 917dc7e77..220314936 100755 --- a/plugins/MacSignedVST/EQ/source/EQProc.cpp +++ b/plugins/MacSignedVST/EQ/source/EQProc.cpp @@ -21,8 +21,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -69,44 +69,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -431,14 +395,14 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -464,8 +428,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -512,44 +476,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -874,16 +802,14 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/EdIsDim/source/EdIsDim.cpp b/plugins/MacSignedVST/EdIsDim/source/EdIsDim.cpp index eb6abd32d..8a4f6db6f 100755 --- a/plugins/MacSignedVST/EdIsDim/source/EdIsDim.cpp +++ b/plugins/MacSignedVST/EdIsDim/source/EdIsDim.cpp @@ -13,8 +13,8 @@ EdIsDim::EdIsDim(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/EdIsDim/source/EdIsDim.h b/plugins/MacSignedVST/EdIsDim/source/EdIsDim.h index 4f6270586..7b887d69e 100755 --- a/plugins/MacSignedVST/EdIsDim/source/EdIsDim.h +++ b/plugins/MacSignedVST/EdIsDim/source/EdIsDim.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp b/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp index 0d033eb65..2273bfcaa 100755 --- a/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp +++ b/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp @@ -15,10 +15,10 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -27,44 +27,8 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -74,7 +38,7 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -99,10 +63,10 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -111,44 +75,8 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; @@ -159,7 +87,7 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/MacSignedVST/Elation/source/ElationProc.cpp b/plugins/MacSignedVST/Elation/source/ElationProc.cpp index dd2878dd9..359c931b3 100755 --- a/plugins/MacSignedVST/Elation/source/ElationProc.cpp +++ b/plugins/MacSignedVST/Elation/source/ElationProc.cpp @@ -34,12 +34,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; @@ -314,12 +314,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; diff --git a/plugins/MacSignedVST/ElectroHat/source/ElectroHat.cpp b/plugins/MacSignedVST/ElectroHat/source/ElectroHat.cpp index 6be41e4b1..0ca7bd6c1 100755 --- a/plugins/MacSignedVST/ElectroHat/source/ElectroHat.cpp +++ b/plugins/MacSignedVST/ElectroHat/source/ElectroHat.cpp @@ -25,8 +25,8 @@ ElectroHat::ElectroHat(audioMasterCallback audioMaster) : lok = 0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ElectroHat/source/ElectroHat.h b/plugins/MacSignedVST/ElectroHat/source/ElectroHat.h index 85315cd63..b07061904 100755 --- a/plugins/MacSignedVST/ElectroHat/source/ElectroHat.h +++ b/plugins/MacSignedVST/ElectroHat/source/ElectroHat.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedSampleL; diff --git a/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp b/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp index ee5a3070f..d99dc44ab 100755 --- a/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp +++ b/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp @@ -25,8 +25,8 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -123,14 +123,14 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -160,8 +160,8 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -258,16 +258,14 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Energy/source/Energy.cpp b/plugins/MacSignedVST/Energy/source/Energy.cpp index 8571e56c1..8d8ab6081 100755 --- a/plugins/MacSignedVST/Energy/source/Energy.cpp +++ b/plugins/MacSignedVST/Energy/source/Energy.cpp @@ -160,8 +160,8 @@ Energy::Energy(audioMasterCallback audioMaster) : PrevAR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Energy/source/Energy.h b/plugins/MacSignedVST/Energy/source/Energy.h index b039c608c..0500e8391 100755 --- a/plugins/MacSignedVST/Energy/source/Energy.h +++ b/plugins/MacSignedVST/Energy/source/Energy.h @@ -60,8 +60,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double duoEvenL; diff --git a/plugins/MacSignedVST/Energy/source/EnergyProc.cpp b/plugins/MacSignedVST/Energy/source/EnergyProc.cpp index a0a86f85f..dbe218778 100755 --- a/plugins/MacSignedVST/Energy/source/EnergyProc.cpp +++ b/plugins/MacSignedVST/Energy/source/EnergyProc.cpp @@ -27,8 +27,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -742,14 +742,14 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -781,8 +781,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -821,8 +821,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -1496,16 +1496,14 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp b/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp index cfd7a3ba5..6cdbba15c 100755 --- a/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp +++ b/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp @@ -37,17 +37,17 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -680,17 +680,17 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -1275,12 +1275,12 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Ensemble/source/Ensemble.cpp b/plugins/MacSignedVST/Ensemble/source/Ensemble.cpp index b90bf6e69..1b701ecc2 100755 --- a/plugins/MacSignedVST/Ensemble/source/Ensemble.cpp +++ b/plugins/MacSignedVST/Ensemble/source/Ensemble.cpp @@ -29,8 +29,8 @@ Ensemble::Ensemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Ensemble/source/Ensemble.h b/plugins/MacSignedVST/Ensemble/source/Ensemble.h index 7697d9317..7d0af8926 100755 --- a/plugins/MacSignedVST/Ensemble/source/Ensemble.h +++ b/plugins/MacSignedVST/Ensemble/source/Ensemble.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 65540; float dL[totalsamples]; diff --git a/plugins/MacSignedVST/Ensemble/source/EnsembleProc.cpp b/plugins/MacSignedVST/Ensemble/source/EnsembleProc.cpp index e9a3a4392..ec4b9c8db 100755 --- a/plugins/MacSignedVST/Ensemble/source/EnsembleProc.cpp +++ b/plugins/MacSignedVST/Ensemble/source/EnsembleProc.cpp @@ -38,8 +38,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -56,44 +56,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -153,14 +117,14 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -203,8 +167,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -221,44 +185,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -318,16 +246,14 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/EveryTrim/source/EveryTrim.cpp b/plugins/MacSignedVST/EveryTrim/source/EveryTrim.cpp index b0a98d48c..fcb71bec3 100755 --- a/plugins/MacSignedVST/EveryTrim/source/EveryTrim.cpp +++ b/plugins/MacSignedVST/EveryTrim/source/EveryTrim.cpp @@ -17,8 +17,8 @@ EveryTrim::EveryTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/EveryTrim/source/EveryTrim.h b/plugins/MacSignedVST/EveryTrim/source/EveryTrim.h index 4efc3cd6b..aec024775 100755 --- a/plugins/MacSignedVST/EveryTrim/source/EveryTrim.h +++ b/plugins/MacSignedVST/EveryTrim/source/EveryTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/EveryTrim/source/EveryTrimProc.cpp b/plugins/MacSignedVST/EveryTrim/source/EveryTrimProc.cpp index 3c30eda6b..1bb858da7 100755 --- a/plugins/MacSignedVST/EveryTrim/source/EveryTrimProc.cpp +++ b/plugins/MacSignedVST/EveryTrim/source/EveryTrimProc.cpp @@ -21,10 +21,10 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Facet/source/FacetProc.cpp b/plugins/MacSignedVST/Facet/source/FacetProc.cpp index 53e92ce39..fb5cdbd6e 100755 --- a/plugins/MacSignedVST/Facet/source/FacetProc.cpp +++ b/plugins/MacSignedVST/Facet/source/FacetProc.cpp @@ -18,8 +18,8 @@ void Facet::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Facet::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/FathomFive/source/FathomFiveProc.cpp b/plugins/MacSignedVST/FathomFive/source/FathomFiveProc.cpp index f509c2188..fee6aba1e 100755 --- a/plugins/MacSignedVST/FathomFive/source/FathomFiveProc.cpp +++ b/plugins/MacSignedVST/FathomFive/source/FathomFiveProc.cpp @@ -25,51 +25,15 @@ void FathomFive::processReplacing(float **inputs, float **outputs, VstInt32 samp if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} @@ -143,51 +107,15 @@ void FathomFive::processDoubleReplacing(double **inputs, double **outputs, VstIn if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} diff --git a/plugins/MacSignedVST/Floor/source/Floor.cpp b/plugins/MacSignedVST/Floor/source/Floor.cpp index ff12e691c..7bb4a8ddb 100755 --- a/plugins/MacSignedVST/Floor/source/Floor.cpp +++ b/plugins/MacSignedVST/Floor/source/Floor.cpp @@ -39,8 +39,8 @@ Floor::Floor(audioMasterCallback audioMaster) : iirSample2DR = 0.0; iirSample2ER = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Floor/source/Floor.h b/plugins/MacSignedVST/Floor/source/Floor.h index dc6b58c54..c80bb7c7f 100755 --- a/plugins/MacSignedVST/Floor/source/Floor.h +++ b/plugins/MacSignedVST/Floor/source/Floor.h @@ -78,8 +78,8 @@ private: double iirSample2DR; double iirSample2ER; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Floor/source/FloorProc.cpp b/plugins/MacSignedVST/Floor/source/FloorProc.cpp index 865446b5f..0cfa58c69 100755 --- a/plugins/MacSignedVST/Floor/source/FloorProc.cpp +++ b/plugins/MacSignedVST/Floor/source/FloorProc.cpp @@ -36,8 +36,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,8 +75,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -247,14 +247,14 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -295,8 +295,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -334,8 +334,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -506,16 +506,14 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Focus/source/Focus.h b/plugins/MacSignedVST/Focus/source/Focus.h index cd7e72a97..7b2cf706d 100755 --- a/plugins/MacSignedVST/Focus/source/Focus.h +++ b/plugins/MacSignedVST/Focus/source/Focus.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/Focus/source/FocusProc.cpp b/plugins/MacSignedVST/Focus/source/FocusProc.cpp index f25a32814..9e1c9c070 100755 --- a/plugins/MacSignedVST/Focus/source/FocusProc.cpp +++ b/plugins/MacSignedVST/Focus/source/FocusProc.cpp @@ -32,18 +32,18 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -62,8 +62,8 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -98,14 +98,14 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -170,18 +170,18 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -200,8 +200,8 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -236,14 +236,14 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; diff --git a/plugins/MacSignedVST/Fracture/source/Fracture.cpp b/plugins/MacSignedVST/Fracture/source/Fracture.cpp index 03f3b1968..302b4dc54 100755 --- a/plugins/MacSignedVST/Fracture/source/Fracture.cpp +++ b/plugins/MacSignedVST/Fracture/source/Fracture.cpp @@ -16,8 +16,8 @@ Fracture::Fracture(audioMasterCallback audioMaster) : B = 0.5; //2 from 1 to 3: (B*2.999)+1 C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Fracture/source/Fracture.h b/plugins/MacSignedVST/Fracture/source/Fracture.h index 49d271858..54aac5a86 100755 --- a/plugins/MacSignedVST/Fracture/source/Fracture.h +++ b/plugins/MacSignedVST/Fracture/source/Fracture.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Fracture/source/FractureProc.cpp b/plugins/MacSignedVST/Fracture/source/FractureProc.cpp index 5c1aaa941..e7b6e7225 100755 --- a/plugins/MacSignedVST/Fracture/source/FractureProc.cpp +++ b/plugins/MacSignedVST/Fracture/source/FractureProc.cpp @@ -23,53 +23,17 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -98,14 +62,14 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -136,53 +100,17 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -211,16 +139,14 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/FromTape/source/FromTape.cpp b/plugins/MacSignedVST/FromTape/source/FromTape.cpp index 40b787673..4573e48be 100755 --- a/plugins/MacSignedVST/FromTape/source/FromTape.cpp +++ b/plugins/MacSignedVST/FromTape/source/FromTape.cpp @@ -82,8 +82,8 @@ FromTape::FromTape(audioMasterCallback audioMaster) : flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/FromTape/source/FromTape.h b/plugins/MacSignedVST/FromTape/source/FromTape.h index 40efabc1b..cd63776b9 100755 --- a/plugins/MacSignedVST/FromTape/source/FromTape.h +++ b/plugins/MacSignedVST/FromTape/source/FromTape.h @@ -120,8 +120,8 @@ private: double iirSampleYR; double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp b/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp index 2d268ef27..0f4db6e85 100755 --- a/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp +++ b/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp @@ -37,52 +37,16 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -221,14 +185,14 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -270,51 +234,15 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -454,16 +382,14 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.pbxuser old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/christopherjohnson.perspectivev3 old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.mode1v3 b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.mode1v3 old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.pbxuser b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/spiadmin.pbxuser old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcshareddata/xcschemes/Galactic.xcscheme b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcshareddata/xcschemes/Galactic.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme b/plugins/MacSignedVST/Galactic/Galactic.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Galactic/source/GalacticProc.cpp b/plugins/MacSignedVST/Galactic/source/GalacticProc.cpp index ccb0aef48..19344f0e4 100755 --- a/plugins/MacSignedVST/Galactic/source/GalacticProc.cpp +++ b/plugins/MacSignedVST/Galactic/source/GalacticProc.cpp @@ -47,12 +47,12 @@ void Galactic::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -279,12 +279,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -453,12 +453,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Gatelope/source/Gatelope.cpp b/plugins/MacSignedVST/Gatelope/source/Gatelope.cpp index 41ed2af14..225c337d5 100755 --- a/plugins/MacSignedVST/Gatelope/source/Gatelope.cpp +++ b/plugins/MacSignedVST/Gatelope/source/Gatelope.cpp @@ -28,8 +28,8 @@ Gatelope::Gatelope(audioMasterCallback audioMaster) : treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Gatelope/source/Gatelope.h b/plugins/MacSignedVST/Gatelope/source/Gatelope.h index 06a0c5571..273e19f6f 100755 --- a/plugins/MacSignedVST/Gatelope/source/Gatelope.h +++ b/plugins/MacSignedVST/Gatelope/source/Gatelope.h @@ -67,8 +67,8 @@ private: double treblefreq; double bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Gatelope/source/GatelopeProc.cpp b/plugins/MacSignedVST/Gatelope/source/GatelopeProc.cpp index f42904218..b5f1d67d7 100755 --- a/plugins/MacSignedVST/Gatelope/source/GatelopeProc.cpp +++ b/plugins/MacSignedVST/Gatelope/source/GatelopeProc.cpp @@ -36,8 +36,8 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -196,14 +196,14 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -244,8 +244,8 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -404,16 +404,14 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/GlitchShifter/source/GlitchShifterProc.cpp b/plugins/MacSignedVST/GlitchShifter/source/GlitchShifterProc.cpp index 9059dc5db..852c3bc0f 100755 --- a/plugins/MacSignedVST/GlitchShifter/source/GlitchShifterProc.cpp +++ b/plugins/MacSignedVST/GlitchShifter/source/GlitchShifterProc.cpp @@ -26,12 +26,12 @@ void GlitchShifter::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -343,12 +343,12 @@ void GlitchShifter::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} diff --git a/plugins/MacSignedVST/Golem/source/Golem.cpp b/plugins/MacSignedVST/Golem/source/Golem.cpp index c99c5cd92..22d4cb6f5 100755 --- a/plugins/MacSignedVST/Golem/source/Golem.cpp +++ b/plugins/MacSignedVST/Golem/source/Golem.cpp @@ -17,8 +17,8 @@ Golem::Golem(audioMasterCallback audioMaster) : C = 0.0; for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/Golem/source/Golem.h b/plugins/MacSignedVST/Golem/source/Golem.h index e02ab7822..4416d3463 100755 --- a/plugins/MacSignedVST/Golem/source/Golem.h +++ b/plugins/MacSignedVST/Golem/source/Golem.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff double p[4099]; diff --git a/plugins/MacSignedVST/Golem/source/GolemProc.cpp b/plugins/MacSignedVST/Golem/source/GolemProc.cpp index 1d7e9f5f9..316632391 100755 --- a/plugins/MacSignedVST/Golem/source/GolemProc.cpp +++ b/plugins/MacSignedVST/Golem/source/GolemProc.cpp @@ -33,51 +33,15 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -112,14 +76,14 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = inputSampleL; //the output is totally mono - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -157,51 +121,15 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -236,16 +164,14 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = inputSampleL; //the output is totally mono - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Gringer/source/Gringer.h b/plugins/MacSignedVST/Gringer/source/Gringer.h index 3306f47eb..53d8dce83 100755 --- a/plugins/MacSignedVST/Gringer/source/Gringer.h +++ b/plugins/MacSignedVST/Gringer/source/Gringer.h @@ -54,10 +54,10 @@ private: uint32_t fpd; //default stuff - long double inbandL[9]; - long double outbandL[9]; - long double inbandR[9]; - long double outbandR[9]; + double inbandL[9]; + double outbandL[9]; + double inbandR[9]; + double outbandR[9]; }; diff --git a/plugins/MacSignedVST/Gringer/source/GringerProc.cpp b/plugins/MacSignedVST/Gringer/source/GringerProc.cpp index 2a40f387c..b76693f2e 100755 --- a/plugins/MacSignedVST/Gringer/source/GringerProc.cpp +++ b/plugins/MacSignedVST/Gringer/source/GringerProc.cpp @@ -58,8 +58,8 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -67,7 +67,7 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); @@ -173,8 +173,8 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -182,7 +182,7 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); diff --git a/plugins/MacSignedVST/GrooveWear/source/GrooveWear.cpp b/plugins/MacSignedVST/GrooveWear/source/GrooveWear.cpp index cbe1fc57a..b15478506 100755 --- a/plugins/MacSignedVST/GrooveWear/source/GrooveWear.cpp +++ b/plugins/MacSignedVST/GrooveWear/source/GrooveWear.cpp @@ -36,8 +36,8 @@ GrooveWear::GrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/GrooveWear/source/GrooveWear.h b/plugins/MacSignedVST/GrooveWear/source/GrooveWear.h index 4bf97453c..fe207c7b6 100755 --- a/plugins/MacSignedVST/GrooveWear/source/GrooveWear.h +++ b/plugins/MacSignedVST/GrooveWear/source/GrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/MacSignedVST/GrooveWear/source/GrooveWearProc.cpp b/plugins/MacSignedVST/GrooveWear/source/GrooveWearProc.cpp index e663203a4..98eeec25e 100755 --- a/plugins/MacSignedVST/GrooveWear/source/GrooveWearProc.cpp +++ b/plugins/MacSignedVST/GrooveWear/source/GrooveWearProc.cpp @@ -98,51 +98,15 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -430,14 +394,14 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -540,51 +504,15 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -872,16 +800,14 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.cpp b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.cpp index b0388ab94..309ce7e4e 100755 --- a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.cpp +++ b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new G GuitarConditioner::GuitarConditioner(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; lastSampleTL = 0.0; lastSampleBL = 0.0; //for Slews. T for treble, B for bass diff --git a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.h b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.h index 3be09e141..fca5a3c07 100755 --- a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.h +++ b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditioner.h @@ -49,8 +49,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff bool fpFlip; double lastSampleTL; diff --git a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditionerProc.cpp b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditionerProc.cpp index b25d600d1..6bfd3bbc4 100755 --- a/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditionerProc.cpp +++ b/plugins/MacSignedVST/GuitarConditioner/source/GuitarConditionerProc.cpp @@ -18,12 +18,12 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -40,44 +40,8 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -165,14 +129,14 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -195,12 +159,12 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -218,44 +182,8 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -342,16 +270,14 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs inputSampleR = trebleR + bassR; //final merge fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/HardVacuum/source/HardVacuum.cpp b/plugins/MacSignedVST/HardVacuum/source/HardVacuum.cpp index 9c14f8993..533cb5610 100755 --- a/plugins/MacSignedVST/HardVacuum/source/HardVacuum.cpp +++ b/plugins/MacSignedVST/HardVacuum/source/HardVacuum.cpp @@ -19,8 +19,8 @@ HardVacuum::HardVacuum(audioMasterCallback audioMaster) : E = 1.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/HardVacuum/source/HardVacuum.h b/plugins/MacSignedVST/HardVacuum/source/HardVacuum.h index 7f4c098cb..f159aadb8 100755 --- a/plugins/MacSignedVST/HardVacuum/source/HardVacuum.h +++ b/plugins/MacSignedVST/HardVacuum/source/HardVacuum.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp b/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp index e0e07e2b2..87a1b1edb 100755 --- a/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp +++ b/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp @@ -36,51 +36,15 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -173,14 +137,14 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -221,52 +185,16 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -359,16 +287,14 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/HermeTrim/source/HermeTrim.cpp b/plugins/MacSignedVST/HermeTrim/source/HermeTrim.cpp index 117cc4599..77103be7b 100755 --- a/plugins/MacSignedVST/HermeTrim/source/HermeTrim.cpp +++ b/plugins/MacSignedVST/HermeTrim/source/HermeTrim.cpp @@ -17,8 +17,8 @@ HermeTrim::HermeTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/HermeTrim/source/HermeTrim.h b/plugins/MacSignedVST/HermeTrim/source/HermeTrim.h index f0bc8ed52..6db22a3b5 100755 --- a/plugins/MacSignedVST/HermeTrim/source/HermeTrim.h +++ b/plugins/MacSignedVST/HermeTrim/source/HermeTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/HermeTrim/source/HermeTrimProc.cpp b/plugins/MacSignedVST/HermeTrim/source/HermeTrimProc.cpp index 66d314485..dccb829c6 100755 --- a/plugins/MacSignedVST/HermeTrim/source/HermeTrimProc.cpp +++ b/plugins/MacSignedVST/HermeTrim/source/HermeTrimProc.cpp @@ -21,10 +21,10 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Hermepass/source/Hermepass.cpp b/plugins/MacSignedVST/Hermepass/source/Hermepass.cpp index 4e4a5322e..c18a227be 100755 --- a/plugins/MacSignedVST/Hermepass/source/Hermepass.cpp +++ b/plugins/MacSignedVST/Hermepass/source/Hermepass.cpp @@ -33,8 +33,8 @@ Hermepass::Hermepass(audioMasterCallback audioMaster) : iirGR = 0.0; iirHR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Hermepass/source/Hermepass.h b/plugins/MacSignedVST/Hermepass/source/Hermepass.h index 1000bb9da..d3f2970cc 100755 --- a/plugins/MacSignedVST/Hermepass/source/Hermepass.h +++ b/plugins/MacSignedVST/Hermepass/source/Hermepass.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirAL; double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one diff --git a/plugins/MacSignedVST/Hermepass/source/HermepassProc.cpp b/plugins/MacSignedVST/Hermepass/source/HermepassProc.cpp index fddffe31d..178979fbf 100755 --- a/plugins/MacSignedVST/Hermepass/source/HermepassProc.cpp +++ b/plugins/MacSignedVST/Hermepass/source/HermepassProc.cpp @@ -17,8 +17,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -64,8 +64,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -74,44 +74,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -176,14 +140,14 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -205,8 +169,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -252,8 +216,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -262,44 +226,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -364,16 +292,14 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/HighGlossDither/source/HighGlossDitherProc.cpp b/plugins/MacSignedVST/HighGlossDither/source/HighGlossDitherProc.cpp index 2529939de..fee894a81 100755 --- a/plugins/MacSignedVST/HighGlossDither/source/HighGlossDitherProc.cpp +++ b/plugins/MacSignedVST/HighGlossDither/source/HighGlossDitherProc.cpp @@ -16,51 +16,15 @@ void HighGlossDither::processReplacing(float **inputs, float **outputs, VstInt32 int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -111,51 +75,15 @@ void HighGlossDither::processDoubleReplacing(double **inputs, double **outputs, int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacSignedVST/HighImpact/source/HighImpact.cpp b/plugins/MacSignedVST/HighImpact/source/HighImpact.cpp index 960d80c7b..446f34127 100755 --- a/plugins/MacSignedVST/HighImpact/source/HighImpact.cpp +++ b/plugins/MacSignedVST/HighImpact/source/HighImpact.cpp @@ -17,8 +17,8 @@ HighImpact::HighImpact(audioMasterCallback audioMaster) : C = 0.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/HighImpact/source/HighImpact.h b/plugins/MacSignedVST/HighImpact/source/HighImpact.h index a57230b85..71123e03c 100755 --- a/plugins/MacSignedVST/HighImpact/source/HighImpact.h +++ b/plugins/MacSignedVST/HighImpact/source/HighImpact.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/HighImpact/source/HighImpactProc.cpp b/plugins/MacSignedVST/HighImpact/source/HighImpactProc.cpp index f24804a5e..c6ac619a9 100755 --- a/plugins/MacSignedVST/HighImpact/source/HighImpactProc.cpp +++ b/plugins/MacSignedVST/HighImpact/source/HighImpactProc.cpp @@ -15,10 +15,10 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -35,44 +35,8 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -158,14 +122,14 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,10 +152,10 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -208,44 +172,8 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -331,16 +259,14 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Highpass/source/Highpass.cpp b/plugins/MacSignedVST/Highpass/source/Highpass.cpp index 86ebe241c..a87a3f0ce 100755 --- a/plugins/MacSignedVST/Highpass/source/Highpass.cpp +++ b/plugins/MacSignedVST/Highpass/source/Highpass.cpp @@ -19,8 +19,8 @@ Highpass::Highpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/Highpass/source/Highpass.h b/plugins/MacSignedVST/Highpass/source/Highpass.h index 673f951fe..468baa479 100755 --- a/plugins/MacSignedVST/Highpass/source/Highpass.h +++ b/plugins/MacSignedVST/Highpass/source/Highpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Highpass/source/HighpassProc.cpp b/plugins/MacSignedVST/Highpass/source/HighpassProc.cpp index 371ed57a4..92c60aa8b 100755 --- a/plugins/MacSignedVST/Highpass/source/HighpassProc.cpp +++ b/plugins/MacSignedVST/Highpass/source/HighpassProc.cpp @@ -40,44 +40,8 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -118,14 +82,14 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -170,44 +134,8 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -248,16 +176,14 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/MacSignedVST/Highpass2/source/Highpass2Proc.cpp b/plugins/MacSignedVST/Highpass2/source/Highpass2Proc.cpp index adc3ba169..e5f6a8066 100755 --- a/plugins/MacSignedVST/Highpass2/source/Highpass2Proc.cpp +++ b/plugins/MacSignedVST/Highpass2/source/Highpass2Proc.cpp @@ -38,8 +38,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -208,8 +208,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -247,8 +247,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/MacSignedVST/Holt/source/Holt.h b/plugins/MacSignedVST/Holt/source/Holt.h index bf14fca9d..d9d61e929 100755 --- a/plugins/MacSignedVST/Holt/source/Holt.h +++ b/plugins/MacSignedVST/Holt/source/Holt.h @@ -59,23 +59,23 @@ private: uint32_t fpd; //default stuff - long double previousSampleAL; - long double previousTrendAL; - long double previousSampleBL; - long double previousTrendBL; - long double previousSampleCL; - long double previousTrendCL; - long double previousSampleDL; - long double previousTrendDL; + double previousSampleAL; + double previousTrendAL; + double previousSampleBL; + double previousTrendBL; + double previousSampleCL; + double previousTrendCL; + double previousSampleDL; + double previousTrendDL; - long double previousSampleAR; - long double previousTrendAR; - long double previousSampleBR; - long double previousTrendBR; - long double previousSampleCR; - long double previousTrendCR; - long double previousSampleDR; - long double previousTrendDR; + double previousSampleAR; + double previousTrendAR; + double previousSampleBR; + double previousTrendBR; + double previousSampleCR; + double previousTrendCR; + double previousSampleDR; + double previousTrendDR; float A; diff --git a/plugins/MacSignedVST/Holt/source/HoltProc.cpp b/plugins/MacSignedVST/Holt/source/HoltProc.cpp index efe13495a..ca90811ad 100755 --- a/plugins/MacSignedVST/Holt/source/HoltProc.cpp +++ b/plugins/MacSignedVST/Holt/source/HoltProc.cpp @@ -20,8 +20,8 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -42,14 +42,14 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); @@ -157,8 +157,8 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -179,14 +179,14 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); diff --git a/plugins/MacSignedVST/Hombre/source/Hombre.cpp b/plugins/MacSignedVST/Hombre/source/Hombre.cpp index 8b03ed124..ebf3e4b36 100755 --- a/plugins/MacSignedVST/Hombre/source/Hombre.cpp +++ b/plugins/MacSignedVST/Hombre/source/Hombre.cpp @@ -17,8 +17,8 @@ Hombre::Hombre(audioMasterCallback audioMaster) : for(int count = 0; count < 4000; count++) {pL[count] = 0.0; pR[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Hombre/source/Hombre.h b/plugins/MacSignedVST/Hombre/source/Hombre.h index e23f6f323..af14c14ed 100755 --- a/plugins/MacSignedVST/Hombre/source/Hombre.h +++ b/plugins/MacSignedVST/Hombre/source/Hombre.h @@ -58,8 +58,8 @@ private: double slide; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Hombre/source/HombreProc.cpp b/plugins/MacSignedVST/Hombre/source/HombreProc.cpp index 16bf51377..5a24dde58 100755 --- a/plugins/MacSignedVST/Hombre/source/HombreProc.cpp +++ b/plugins/MacSignedVST/Hombre/source/HombreProc.cpp @@ -29,8 +29,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -38,44 +38,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -131,14 +95,14 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -172,8 +136,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -181,44 +145,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -274,16 +202,14 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Hull/source/Hull.h b/plugins/MacSignedVST/Hull/source/Hull.h index bee68e58b..1d9df9e4d 100755 --- a/plugins/MacSignedVST/Hull/source/Hull.h +++ b/plugins/MacSignedVST/Hull/source/Hull.h @@ -53,11 +53,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bL[4005]; - long double bR[4005]; + double bL[4005]; + double bR[4005]; int bPointer; - long double cL[105]; - long double cR[105]; + double cL[105]; + double cR[105]; int cPointer; uint32_t fpdL; diff --git a/plugins/MacSignedVST/Hull/source/HullProc.cpp b/plugins/MacSignedVST/Hull/source/HullProc.cpp index ed19ddc25..4cdbe2d03 100755 --- a/plugins/MacSignedVST/Hull/source/HullProc.cpp +++ b/plugins/MacSignedVST/Hull/source/HullProc.cpp @@ -21,31 +21,31 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -69,8 +69,8 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -120,31 +120,31 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -168,8 +168,8 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -187,12 +187,12 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/HypersonX/source/HypersonXProc.cpp b/plugins/MacSignedVST/HypersonX/source/HypersonXProc.cpp index 43ed3ec33..bd88aeefa 100755 --- a/plugins/MacSignedVST/HypersonX/source/HypersonXProc.cpp +++ b/plugins/MacSignedVST/HypersonX/source/HypersonXProc.cpp @@ -149,7 +149,7 @@ void HypersonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Hypersonic/source/HypersonicProc.cpp b/plugins/MacSignedVST/Hypersonic/source/HypersonicProc.cpp index 7e914e796..d3361986c 100755 --- a/plugins/MacSignedVST/Hypersonic/source/HypersonicProc.cpp +++ b/plugins/MacSignedVST/Hypersonic/source/HypersonicProc.cpp @@ -319,7 +319,7 @@ void Hypersonic::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Infinity/source/Infinity.h b/plugins/MacSignedVST/Infinity/source/Infinity.h index e17c3a139..6a3a0b593 100755 --- a/plugins/MacSignedVST/Infinity/source/Infinity.h +++ b/plugins/MacSignedVST/Infinity/source/Infinity.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacSignedVST/Infinity/source/InfinityProc.cpp b/plugins/MacSignedVST/Infinity/source/InfinityProc.cpp index 67dce7467..70c57ee1b 100755 --- a/plugins/MacSignedVST/Infinity/source/InfinityProc.cpp +++ b/plugins/MacSignedVST/Infinity/source/InfinityProc.cpp @@ -65,19 +65,19 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -88,15 +88,15 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -350,19 +350,19 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -373,15 +373,15 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -559,12 +559,12 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Infinity2/source/Infinity2.h b/plugins/MacSignedVST/Infinity2/source/Infinity2.h index 2304eb777..60c0f9004 100755 --- a/plugins/MacSignedVST/Infinity2/source/Infinity2.h +++ b/plugins/MacSignedVST/Infinity2/source/Infinity2.h @@ -57,9 +57,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacSignedVST/Infinity2/source/Infinity2Proc.cpp b/plugins/MacSignedVST/Infinity2/source/Infinity2Proc.cpp index 81b745fab..cf8e5f6f8 100755 --- a/plugins/MacSignedVST/Infinity2/source/Infinity2Proc.cpp +++ b/plugins/MacSignedVST/Infinity2/source/Infinity2Proc.cpp @@ -65,32 +65,32 @@ void Infinity2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -366,32 +366,32 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -591,12 +591,12 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Infrasonic/source/Infrasonic.h b/plugins/MacSignedVST/Infrasonic/source/Infrasonic.h index 940f13fc4..ef33b30ed 100755 --- a/plugins/MacSignedVST/Infrasonic/source/Infrasonic.h +++ b/plugins/MacSignedVST/Infrasonic/source/Infrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Infrasonic/source/InfrasonicProc.cpp b/plugins/MacSignedVST/Infrasonic/source/InfrasonicProc.cpp index 0ebfbc7d0..135fd5e33 100755 --- a/plugins/MacSignedVST/Infrasonic/source/InfrasonicProc.cpp +++ b/plugins/MacSignedVST/Infrasonic/source/InfrasonicProc.cpp @@ -63,12 +63,12 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacSignedVST/Interstage/source/Interstage.h b/plugins/MacSignedVST/Interstage/source/Interstage.h index 146b84c0a..bb23c5c57 100755 --- a/plugins/MacSignedVST/Interstage/source/Interstage.h +++ b/plugins/MacSignedVST/Interstage/source/Interstage.h @@ -57,14 +57,14 @@ private: double iirSampleDL; double iirSampleEL; double iirSampleFL; - long double lastSampleL; + double lastSampleL; double iirSampleAR; double iirSampleBR; double iirSampleCR; double iirSampleDR; double iirSampleER; double iirSampleFR; - long double lastSampleR; + double lastSampleR; uint32_t fpd; bool flip; }; diff --git a/plugins/MacSignedVST/Interstage/source/InterstageProc.cpp b/plugins/MacSignedVST/Interstage/source/InterstageProc.cpp index df5bb385c..181983f57 100755 --- a/plugins/MacSignedVST/Interstage/source/InterstageProc.cpp +++ b/plugins/MacSignedVST/Interstage/source/InterstageProc.cpp @@ -24,12 +24,12 @@ void Interstage::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average @@ -111,12 +111,12 @@ void Interstage::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average diff --git a/plugins/MacSignedVST/IronOxide5/source/IronOxide5.cpp b/plugins/MacSignedVST/IronOxide5/source/IronOxide5.cpp index 914f53b5c..9d720380d 100755 --- a/plugins/MacSignedVST/IronOxide5/source/IronOxide5.cpp +++ b/plugins/MacSignedVST/IronOxide5/source/IronOxide5.cpp @@ -45,8 +45,8 @@ IronOxide5::IronOxide5(audioMasterCallback audioMaster) : rateof = 0.5; nextmax = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/IronOxide5/source/IronOxide5.h b/plugins/MacSignedVST/IronOxide5/source/IronOxide5.h index 82d4c9ae3..8e1173796 100755 --- a/plugins/MacSignedVST/IronOxide5/source/IronOxide5.h +++ b/plugins/MacSignedVST/IronOxide5/source/IronOxide5.h @@ -101,8 +101,8 @@ private: double nextmax; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp b/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp index e42d69f49..a79d2d315 100755 --- a/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp +++ b/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp @@ -62,8 +62,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -71,44 +71,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -419,14 +383,14 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp } //end invdrywet block with outputgain - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -493,8 +457,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -502,44 +466,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -850,16 +778,14 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn } //end invdrywet block with outputgain - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.cpp b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.cpp index 8ce7103db..a52227101 100755 --- a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.cpp +++ b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.cpp @@ -23,8 +23,8 @@ IronOxideClassic::IronOxideClassic(audioMasterCallback audioMaster) : fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; iirSampleAR = iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.h b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.h index bafb457f3..118b6fd9d 100755 --- a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.h +++ b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassic.h @@ -72,8 +72,8 @@ private: int gcount; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassicProc.cpp b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassicProc.cpp index 97bbacae1..8f7d52f98 100755 --- a/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassicProc.cpp +++ b/plugins/MacSignedVST/IronOxideClassic/source/IronOxideClassicProc.cpp @@ -41,51 +41,15 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -342,14 +306,14 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,51 +359,15 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -696,16 +624,14 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2.h b/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2.h index 6d0a6b3ae..816678bb0 100755 --- a/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2.h +++ b/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2.h @@ -72,8 +72,8 @@ private: double slowIIRBR; double lastRefR[7]; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; int cycle; int gcount; diff --git a/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp b/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp index 1b4d68ec4..cbd05ac5f 100755 --- a/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp +++ b/plugins/MacSignedVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp @@ -67,11 +67,11 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -107,14 +107,14 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -129,7 +129,7 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -479,11 +479,11 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -519,14 +519,14 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -541,7 +541,7 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -813,12 +813,12 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs flip = !flip; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Isolator/source/Isolator.h b/plugins/MacSignedVST/Isolator/source/Isolator.h index 36bb24290..c353897e0 100755 --- a/plugins/MacSignedVST/Isolator/source/Isolator.h +++ b/plugins/MacSignedVST/Isolator/source/Isolator.h @@ -54,9 +54,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Isolator/source/IsolatorProc.cpp b/plugins/MacSignedVST/Isolator/source/IsolatorProc.cpp index ec083b419..ca777d947 100755 --- a/plugins/MacSignedVST/Isolator/source/IsolatorProc.cpp +++ b/plugins/MacSignedVST/Isolator/source/IsolatorProc.cpp @@ -62,18 +62,18 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -82,7 +82,7 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -182,18 +182,18 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -202,7 +202,7 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser new file mode 100644 index 000000000..64faa7905 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.pbxuser @@ -0,0 +1,108 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Isolator2 */; + codeSenseManager = 8B02375F1D42B1C400E1E8C8 /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 364, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 324, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 667176928; + PBXWorkspaceStateSaveDate = 667176928; + }; + sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; + userBuildSettings = { + }; + }; + 2407DEB6089929BA00EB68BF /* Isolator2.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {948, 2700}}"; + sepNavSelRange = "{5068, 0}"; + sepNavVisRange = "{4105, 1604}"; + sepNavWindowFrame = "{{12, 47}, {895, 831}}"; + }; + }; + 245463B80991757100464AD3 /* Isolator2.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1110, 1890}}"; + sepNavSelRange = "{3077, 0}"; + sepNavVisRange = "{2499, 589}"; + sepNavWindowFrame = "{{20, 47}, {895, 831}}"; + }; + }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {859, 20267}}"; + sepNavSelRange = "{10616, 0}"; + sepNavVisRange = "{9653, 2414}"; + sepNavWindowFrame = "{{15, 42}, {895, 831}}"; + }; + }; + 24D8286F09A914000093AEF8 /* Isolator2Proc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1290, 11034}}"; + sepNavSelRange = "{5511, 0}"; + sepNavVisRange = "{22526, 2316}"; + sepNavWindowFrame = "{{70, 56}, {1267, 819}}"; + }; + }; + 8B02375E1D42B1C400E1E8C8 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 8B02375F1D42B1C400E1E8C8 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D01CCC60486CAD60068D4B7 /* Isolator2 */ = { + activeExec = 0; + }; +} diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 new file mode 100644 index 000000000..ec12bd0c4 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/christopherjohnson.perspectivev3 @@ -0,0 +1,1500 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + AIODescriptionKey + DockingSystemVisible + + Extension + perspectivev3 + FavBarConfig + + PBXProjectModuleGUID + 8B02375D1D42B1C400E1E8C8 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.defaultV3 + MajorVersion + 34 + MinorVersion + 0 + Name + All-In-One + Notifications + + + XCObserverAutoDisconnectKey + + XCObserverDefintionKey + + PBXStatusErrorsKey + 0 + + XCObserverFactoryKey + XCPerspectivesSpecificationIdentifier + XCObserverGUIDKey + XCObserverProjectIdentifier + XCObserverNotificationKey + PBXStatusBuildStateMessageNotification + XCObserverTargetKey + XCMainBuildResultsModuleGUID + XCObserverTriggerKey + awakenModuleWithObserver: + XCObserverValidationKey + + PBXStatusErrorsKey + 2 + + + + OpenEditors + + PerspectiveWidths + + 810 + 810 + + Perspectives + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CA23ED40692098700951B8B + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 185 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77ADFE841716C02AAC07 + 1C37FBAC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 6 + 4 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {185, 428}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {202, 446}} + GroupTreeTableConfiguration + + MainColumn + 185 + + RubberWindowFrame + 34 365 810 487 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 202pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 8B0237581D42B1C400E1E8C8 + PBXProjectModuleLabel + Gain.h + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 8B0237591D42B1C400E1E8C8 + PBXProjectModuleLabel + Gain.h + + SplitCount + 1 + + StatusBarVisibility + + XCSharingToken + com.apple.Xcode.CommonNavigatorGroupSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {603, 0}} + RubberWindowFrame + 34 365 810 487 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + Proportion + 441pt + Tabs + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EDF0692099D00951B8B + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{10, 27}, {603, 414}} + + Module + XCDetailModule + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EE00692099D00951B8B + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXProjectFindModule + + + ContentConfiguration + + PBXCVSModuleFilterTypeKey + 1032 + PBXProjectModuleGUID + 1CA23EE10692099D00951B8B + PBXProjectModuleLabel + SCM Results + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXCVSModule + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1023 + XCBuildResultsTrigger_Open + 1012 + + GeometryConfiguration + + Frame + {{10, 27}, {603, 414}} + RubberWindowFrame + 34 365 810 487 0 0 1440 878 + + Module + PBXBuildResultsModule + + + + + Proportion + 603pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDockableTabModule + XCDetailModule + PBXProjectFindModule + PBXCVSModule + PBXBuildResultsModule + + TableOfContents + + 8B4AFBE427C459AB00664C18 + 1CA23ED40692098700951B8B + 8B4AFBE527C459AB00664C18 + 8B0237581D42B1C400E1E8C8 + 8B4AFBE627C459AB00664C18 + 1CA23EDF0692099D00951B8B + 1CA23EE00692099D00951B8B + 1CA23EE10692099D00951B8B + XCMainBuildResultsModuleGUID + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + debugger-restart-executable + debugger-pause + debugger-step-over + debugger-step-into + debugger-step-out + NSToolbarFlexibleSpaceItem + servicesModulebreakpoints + debugger-show-console-window + + ControllerClassBaseName + PBXDebugSessionModule + IconName + DebugTabIcon + Identifier + perspective.debug + IsVertical + 1 + Layout + + + ContentConfiguration + + PBXProjectModuleGUID + 1CCC7628064C1048000F2A68 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {810, 0}} + + Module + PBXDebugCLIModule + Proportion + 0% + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {395, 213}} + {{395, 0}, {415, 213}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {810, 213}} + {{0, 213}, {810, 225}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1CCC7629064C1048000F2A68 + PBXProjectModuleLabel + Debug + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 7}, {810, 438}} + + Module + PBXDebugSessionModule + Proportion + 443pt + + + Name + Debug + ServiceClasses + + XCModuleDock + XCModuleDock + PBXDebugCLIModule + PBXDebugSessionModule + XCConsole + + TableOfContents + + 1CC8E6A5069209BD00BB180A + 1CC8E6A6069209BD00BB180A + 1CCC7628064C1048000F2A68 + 1CCC7629064C1048000F2A68 + 1CC8E6A7069209BD00BB180A + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' + StatusbarIsVisible + + TimeStamp + 667179435.75699401 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + + WindowJustification + 5 + WindowOrderList + + /Users/christopherjohnson/Desktop/Isolator2/Isolator2.xcodeproj + + WindowString + 34 365 810 487 0 0 1440 878 + WindowToolsV3 + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.build + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {500, 215}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + + GeometryConfiguration + + Frame + {{0, 222}, {500, 236}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 458pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 192 257 500 500 0 0 1280 1002 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {700, 358}} + RubberWindowFrame + 149 87 700 400 0 0 1440 878 + + Module + PBXDebugCLIModule + Proportion + 358pt + + + Proportion + 358pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D5B069F1CE1000CFCEE + 1C530D5C069F1CE1000CFCEE + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 149 87 440 400 0 0 1440 878 + WindowToolGUID + 1C530D5B069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.09500122070312 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scmV3 + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 166pt + + + Proportion + 166pt + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.projectFormatConflicts + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 8BCAE52E1D49920D0047D4BD + + GeometryConfiguration + + Frame + {{0, 0}, {472, 302}} + RubberWindowFrame + 569 378 472 322 0 0 1440 878 + + Module + XCProjectFormatConflictsModule + Proportion + 302pt + + + Proportion + 302pt + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + + TableOfContents + + 8BCAE52F1D49920D0047D4BD + 8BCAE5301D49920D0047D4BD + 8BCAE52E1D49920D0047D4BD + + WindowContentMinSize + 450 300 + WindowString + 569 378 472 322 0 0 1440 878 + WindowToolGUID + 8BCAE52F1D49920D0047D4BD + WindowToolIsVisible + + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {369, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {616, 353}} + MembersFrame + {{0, 105}, {369, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 94 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 597 125 616 374 0 0 1280 1002 + + Module + PBXClassBrowserModule + Proportion + 354pt + + + Proportion + 354pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C78EABA065D492600B07095 + 1C78EABB065D492600B07095 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 597 125 616 374 0 0 1280 1002 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.pbxproj b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.pbxproj new file mode 100755 index 000000000..475cbd2f8 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.pbxproj @@ -0,0 +1,2201 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 2407DEB9089929BA00EB68BF /* Isolator2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2407DEB6089929BA00EB68BF /* Isolator2.cpp */; }; + 245463B90991757100464AD3 /* Isolator2.h in Headers */ = {isa = PBXBuildFile; fileRef = 245463B80991757100464AD3 /* Isolator2.h */; }; + 24A202190F90D1DE003BB5A7 /* aeffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF910F90D1DD003BB5A7 /* aeffect.h */; }; + 24A2021A0F90D1DE003BB5A7 /* aeffectx.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */; }; + 24A2021B0F90D1DE003BB5A7 /* vstfxstore.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */; }; + 24A2021D0F90D1DE003BB5A7 /* adelay.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FF990F90D1DD003BB5A7 /* adelay.h */; }; + 24A202240F90D1DE003BB5A7 /* sdeditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */; }; + 24A202260F90D1DE003BB5A7 /* surrounddelay.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */; }; + 24A2022A0F90D1DE003BB5A7 /* again.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFAB0F90D1DD003BB5A7 /* again.h */; }; + 24A202330F90D1DE003BB5A7 /* gmnames.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */; }; + 24A202350F90D1DE003BB5A7 /* vstxsynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */; }; + 24A202460F90D1DE003BB5A7 /* aeffeditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */; }; + 24A202480F90D1DE003BB5A7 /* audioeffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */; }; + 24A2024A0F90D1DE003BB5A7 /* audioeffectx.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */; }; + 24A2024D0F90D1DE003BB5A7 /* cw_vst_prefix.pch++ in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */; }; + 24A202510F90D1DE003BB5A7 /* xcode_au_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */; }; + 24A202520F90D1DE003BB5A7 /* xcode_vst_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */; }; + 24A202680F90D1DE003BB5A7 /* controlsgui.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200050F90D1DD003BB5A7 /* controlsgui.h */; }; + 24A2026A0F90D1DE003BB5A7 /* pdrawtesteditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */; }; + 24A2026C0F90D1DE003BB5A7 /* pdrawtesteffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */; }; + 24A2026F0F90D1DE003BB5A7 /* pdrawtestview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */; }; + 24A202710F90D1DE003BB5A7 /* pprimitivesviews.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */; }; + 24A202780F90D1DE003BB5A7 /* aeffguieditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */; }; + 24A2027A0F90D1DE003BB5A7 /* cfileselector.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */; }; + 24A2027D0F90D1DE003BB5A7 /* cscrollview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */; }; + 24A2027F0F90D1DE003BB5A7 /* ctabview.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2001F0F90D1DD003BB5A7 /* ctabview.h */; }; + 24A203A50F90D1DE003BB5A7 /* plugguieditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201470F90D1DE003BB5A7 /* plugguieditor.h */; }; + 24A203A70F90D1DE003BB5A7 /* vstcontrols.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201490F90D1DE003BB5A7 /* vstcontrols.h */; }; + 24A203A90F90D1DE003BB5A7 /* vstgui.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014B0F90D1DE003BB5A7 /* vstgui.h */; }; + 24A203AA0F90D1DE003BB5A7 /* vstkeycode.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */; }; + 24A203AB0F90D1DE003BB5A7 /* vstplugscarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */; }; + 24A203AC0F90D1DE003BB5A7 /* vstplugsmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */; }; + 24A203AD0F90D1DE003BB5A7 /* vstplugsmacho.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */; }; + 24A203AE0F90D1DE003BB5A7 /* vstplugsquartz.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */; }; + 24A203CB0F90D251003BB5A7 /* audioeffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */; }; + 24A203CC0F90D251003BB5A7 /* audioeffectx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; }; + 24A203CD0F90D251003BB5A7 /* vstplugmain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */; }; + 24CFB70407E7A0220081BD57 /* PkgInfo in Resources */ = {isa = PBXBuildFile; fileRef = 24CFB70307E7A0220081BD57 /* PkgInfo */; }; + 24D8287009A914000093AEF8 /* Isolator2Proc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24D8286F09A914000093AEF8 /* Isolator2Proc.cpp */; }; + 24D8287F09A9164A0093AEF8 /* xcode_vst_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 24A203D60F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = again; + }; + 24A203D80F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4476974093DAE42008998C4; + remoteInfo = adelay; + }; + 24A203DA0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4FF52220929FBF500DDED7A; + remoteInfo = vstxsynth; + }; + 24A203DC0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4476A10093DCAF9008998C4; + remoteInfo = surrounddelay; + }; + 24A203DE0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4FF52F3092A312800DDED7A; + remoteInfo = minihost; + }; + 24A203E40F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = AudioUnit; + }; + 24A203E60F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + proxyType = 2; + remoteGlobalIDString = F4C9F1D407B2320800010DAD; + remoteInfo = VST; + }; + 24A203EC0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; + remoteInfo = AudioUnit; + }; + 24A203EE0F90D272003BB5A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F4C9F1D407B2320800010DAD; + remoteInfo = VST; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 2407DE920899296600EB68BF /* Isolator2.vst */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Isolator2.vst; sourceTree = BUILT_PRODUCTS_DIR; }; + 2407DEB6089929BA00EB68BF /* Isolator2.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Isolator2.cpp; path = source/Isolator2.cpp; sourceTree = ""; }; + 2434720A098313350063BBF1 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + 245463B80991757100464AD3 /* Isolator2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Isolator2.h; path = source/Isolator2.h; sourceTree = ""; }; + 24A200000F90D1DD003BB5A7 /* bmp10014.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10014.bmp; sourceTree = ""; }; + 24A200010F90D1DD003BB5A7 /* bmp10015.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10015.bmp; sourceTree = ""; }; + 24A200020F90D1DD003BB5A7 /* bmp10016.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10016.bmp; sourceTree = ""; }; + 24A200040F90D1DD003BB5A7 /* controlsgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controlsgui.cpp; sourceTree = ""; }; + 24A200050F90D1DD003BB5A7 /* controlsgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controlsgui.h; sourceTree = ""; }; + 24A200060F90D1DD003BB5A7 /* pdrawtesteditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtesteditor.cpp; sourceTree = ""; }; + 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtesteditor.h; sourceTree = ""; }; + 24A200080F90D1DD003BB5A7 /* pdrawtesteffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtesteffect.cpp; sourceTree = ""; }; + 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtesteffect.h; sourceTree = ""; }; + 24A2000A0F90D1DD003BB5A7 /* pdrawtestmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtestmain.cpp; sourceTree = ""; }; + 24A2000B0F90D1DD003BB5A7 /* pdrawtestview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pdrawtestview.cpp; sourceTree = ""; }; + 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdrawtestview.h; sourceTree = ""; }; + 24A2000D0F90D1DD003BB5A7 /* pprimitivesviews.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pprimitivesviews.cpp; sourceTree = ""; }; + 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pprimitivesviews.h; sourceTree = ""; }; + 24A200100F90D1DD003BB5A7 /* drawtest.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.def; sourceTree = ""; }; + 24A200110F90D1DD003BB5A7 /* drawtest.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.rc; sourceTree = ""; }; + 24A200120F90D1DD003BB5A7 /* drawtest.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = drawtest.vcproj; sourceTree = ""; }; + 24A200140F90D1DD003BB5A7 /* drawtest.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.dsp; sourceTree = ""; }; + 24A200150F90D1DD003BB5A7 /* drawtest.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.dsw; sourceTree = ""; }; + 24A200170F90D1DD003BB5A7 /* aeffguieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aeffguieditor.cpp; sourceTree = ""; }; + 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffguieditor.h; sourceTree = ""; }; + 24A200190F90D1DD003BB5A7 /* cfileselector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cfileselector.cpp; sourceTree = ""; }; + 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfileselector.h; sourceTree = ""; }; + 24A2001B0F90D1DD003BB5A7 /* Changelog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changelog; sourceTree = ""; }; + 24A2001C0F90D1DD003BB5A7 /* cscrollview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cscrollview.cpp; sourceTree = ""; }; + 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cscrollview.h; sourceTree = ""; }; + 24A2001E0F90D1DD003BB5A7 /* ctabview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctabview.cpp; sourceTree = ""; }; + 24A2001F0F90D1DD003BB5A7 /* ctabview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctabview.h; sourceTree = ""; }; + 24A200220F90D1DD003BB5A7 /* aeffguieditor_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = aeffguieditor_8cpp.html; sourceTree = ""; }; + 24A200230F90D1DD003BB5A7 /* aeffguieditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = aeffguieditor_8h.html; sourceTree = ""; }; + 24A200240F90D1DD003BB5A7 /* annotated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = annotated.html; sourceTree = ""; }; + 24A200250F90D1DD003BB5A7 /* cfileselector_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cfileselector_8cpp.html; sourceTree = ""; }; + 24A200260F90D1DD003BB5A7 /* cfileselector_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cfileselector_8h.html; sourceTree = ""; }; + 24A200270F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_a_eff_g_u_i_editor-members.html"; sourceTree = ""; }; + 24A200280F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_a_eff_g_u_i_editor.html; sourceTree = ""; }; + 24A200290F90D1DD003BB5A7 /* class_c_anim_knob-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_anim_knob-members.html"; sourceTree = ""; }; + 24A2002A0F90D1DD003BB5A7 /* class_c_anim_knob.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_anim_knob.html; sourceTree = ""; }; + 24A2002B0F90D1DD003BB5A7 /* class_c_anim_knob.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_anim_knob.png; sourceTree = ""; }; + 24A2002C0F90D1DD003BB5A7 /* class_c_attribute_list_entry-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_attribute_list_entry-members.html"; sourceTree = ""; }; + 24A2002D0F90D1DD003BB5A7 /* class_c_attribute_list_entry.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_attribute_list_entry.html; sourceTree = ""; }; + 24A2002E0F90D1DD003BB5A7 /* class_c_auto_animation-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_auto_animation-members.html"; sourceTree = ""; }; + 24A2002F0F90D1DD003BB5A7 /* class_c_auto_animation.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_auto_animation.html; sourceTree = ""; }; + 24A200300F90D1DD003BB5A7 /* class_c_auto_animation.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_auto_animation.png; sourceTree = ""; }; + 24A200310F90D1DD003BB5A7 /* class_c_bitmap-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_bitmap-members.html"; sourceTree = ""; }; + 24A200320F90D1DD003BB5A7 /* class_c_bitmap.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_bitmap.html; sourceTree = ""; }; + 24A200330F90D1DD003BB5A7 /* class_c_bitmap.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_bitmap.png; sourceTree = ""; }; + 24A200340F90D1DD003BB5A7 /* class_c_c_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_c_view-members.html"; sourceTree = ""; }; + 24A200350F90D1DD003BB5A7 /* class_c_c_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_c_view.html; sourceTree = ""; }; + 24A200360F90D1DD003BB5A7 /* class_c_control-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_control-members.html"; sourceTree = ""; }; + 24A200370F90D1DD003BB5A7 /* class_c_control.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_control.html; sourceTree = ""; }; + 24A200380F90D1DD003BB5A7 /* class_c_control.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_control.png; sourceTree = ""; }; + 24A200390F90D1DD003BB5A7 /* class_c_control_listener-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_control_listener-members.html"; sourceTree = ""; }; + 24A2003A0F90D1DD003BB5A7 /* class_c_control_listener.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_control_listener.html; sourceTree = ""; }; + 24A2003B0F90D1DD003BB5A7 /* class_c_control_listener.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_control_listener.png; sourceTree = ""; }; + 24A2003C0F90D1DD003BB5A7 /* class_c_drag_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_drag_container-members.html"; sourceTree = ""; }; + 24A2003D0F90D1DD003BB5A7 /* class_c_drag_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_drag_container.html; sourceTree = ""; }; + 24A2003E0F90D1DD003BB5A7 /* class_c_drag_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_drag_container.png; sourceTree = ""; }; + 24A2003F0F90D1DD003BB5A7 /* class_c_draw_context-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_draw_context-members.html"; sourceTree = ""; }; + 24A200400F90D1DD003BB5A7 /* class_c_draw_context.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_draw_context.html; sourceTree = ""; }; + 24A200410F90D1DD003BB5A7 /* class_c_draw_context.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_draw_context.png; sourceTree = ""; }; + 24A200420F90D1DD003BB5A7 /* class_c_file_selector-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_file_selector-members.html"; sourceTree = ""; }; + 24A200430F90D1DD003BB5A7 /* class_c_file_selector.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_file_selector.html; sourceTree = ""; }; + 24A200440F90D1DD003BB5A7 /* class_c_frame-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_frame-members.html"; sourceTree = ""; }; + 24A200450F90D1DD003BB5A7 /* class_c_frame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_frame.html; sourceTree = ""; }; + 24A200460F90D1DD003BB5A7 /* class_c_frame.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_frame.png; sourceTree = ""; }; + 24A200470F90D1DD003BB5A7 /* class_c_horizontal_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_horizontal_slider-members.html"; sourceTree = ""; }; + 24A200480F90D1DD003BB5A7 /* class_c_horizontal_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_horizontal_slider.html; sourceTree = ""; }; + 24A200490F90D1DD003BB5A7 /* class_c_horizontal_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_horizontal_slider.png; sourceTree = ""; }; + 24A2004A0F90D1DD003BB5A7 /* class_c_horizontal_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_horizontal_switch-members.html"; sourceTree = ""; }; + 24A2004B0F90D1DD003BB5A7 /* class_c_horizontal_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_horizontal_switch.html; sourceTree = ""; }; + 24A2004C0F90D1DD003BB5A7 /* class_c_horizontal_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_horizontal_switch.png; sourceTree = ""; }; + 24A2004D0F90D1DD003BB5A7 /* class_c_kick_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_kick_button-members.html"; sourceTree = ""; }; + 24A2004E0F90D1DD003BB5A7 /* class_c_kick_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_kick_button.html; sourceTree = ""; }; + 24A2004F0F90D1DD003BB5A7 /* class_c_kick_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_kick_button.png; sourceTree = ""; }; + 24A200500F90D1DD003BB5A7 /* class_c_knob-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_knob-members.html"; sourceTree = ""; }; + 24A200510F90D1DD003BB5A7 /* class_c_knob.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_knob.html; sourceTree = ""; }; + 24A200520F90D1DD003BB5A7 /* class_c_knob.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_knob.png; sourceTree = ""; }; + 24A200530F90D1DD003BB5A7 /* class_c_movie_bitmap-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_movie_bitmap-members.html"; sourceTree = ""; }; + 24A200540F90D1DD003BB5A7 /* class_c_movie_bitmap.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_movie_bitmap.html; sourceTree = ""; }; + 24A200550F90D1DD003BB5A7 /* class_c_movie_bitmap.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_movie_bitmap.png; sourceTree = ""; }; + 24A200560F90D1DD003BB5A7 /* class_c_movie_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_movie_button-members.html"; sourceTree = ""; }; + 24A200570F90D1DD003BB5A7 /* class_c_movie_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_movie_button.html; sourceTree = ""; }; + 24A200580F90D1DD003BB5A7 /* class_c_movie_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_movie_button.png; sourceTree = ""; }; + 24A200590F90D1DD003BB5A7 /* class_c_offscreen_context-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_offscreen_context-members.html"; sourceTree = ""; }; + 24A2005A0F90D1DD003BB5A7 /* class_c_offscreen_context.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_offscreen_context.html; sourceTree = ""; }; + 24A2005B0F90D1DD003BB5A7 /* class_c_offscreen_context.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_offscreen_context.png; sourceTree = ""; }; + 24A2005C0F90D1DD003BB5A7 /* class_c_on_off_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_on_off_button-members.html"; sourceTree = ""; }; + 24A2005D0F90D1DD003BB5A7 /* class_c_on_off_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_on_off_button.html; sourceTree = ""; }; + 24A2005E0F90D1DD003BB5A7 /* class_c_on_off_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_on_off_button.png; sourceTree = ""; }; + 24A2005F0F90D1DD003BB5A7 /* class_c_option_menu-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_option_menu-members.html"; sourceTree = ""; }; + 24A200600F90D1DD003BB5A7 /* class_c_option_menu.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_option_menu.html; sourceTree = ""; }; + 24A200610F90D1DD003BB5A7 /* class_c_option_menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_option_menu.png; sourceTree = ""; }; + 24A200620F90D1DD003BB5A7 /* class_c_option_menu_scheme-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_option_menu_scheme-members.html"; sourceTree = ""; }; + 24A200630F90D1DD003BB5A7 /* class_c_option_menu_scheme.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_option_menu_scheme.html; sourceTree = ""; }; + 24A200640F90D1DD003BB5A7 /* class_c_option_menu_scheme.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_option_menu_scheme.png; sourceTree = ""; }; + 24A200650F90D1DD003BB5A7 /* class_c_param_display-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_param_display-members.html"; sourceTree = ""; }; + 24A200660F90D1DD003BB5A7 /* class_c_param_display.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_param_display.html; sourceTree = ""; }; + 24A200670F90D1DD003BB5A7 /* class_c_param_display.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_param_display.png; sourceTree = ""; }; + 24A200680F90D1DD003BB5A7 /* class_c_reference_counter-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_reference_counter-members.html"; sourceTree = ""; }; + 24A200690F90D1DD003BB5A7 /* class_c_reference_counter.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_reference_counter.html; sourceTree = ""; }; + 24A2006A0F90D1DD003BB5A7 /* class_c_reference_counter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_reference_counter.png; sourceTree = ""; }; + 24A2006B0F90D1DD003BB5A7 /* class_c_rocker_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_rocker_switch-members.html"; sourceTree = ""; }; + 24A2006C0F90D1DD003BB5A7 /* class_c_rocker_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_rocker_switch.html; sourceTree = ""; }; + 24A2006D0F90D1DD003BB5A7 /* class_c_rocker_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_rocker_switch.png; sourceTree = ""; }; + 24A2006E0F90D1DD003BB5A7 /* class_c_scroll_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scroll_container-members.html"; sourceTree = ""; }; + 24A2006F0F90D1DD003BB5A7 /* class_c_scroll_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scroll_container.html; sourceTree = ""; }; + 24A200700F90D1DD003BB5A7 /* class_c_scroll_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scroll_container.png; sourceTree = ""; }; + 24A200710F90D1DD003BB5A7 /* class_c_scroll_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scroll_view-members.html"; sourceTree = ""; }; + 24A200720F90D1DD003BB5A7 /* class_c_scroll_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scroll_view.html; sourceTree = ""; }; + 24A200730F90D1DD003BB5A7 /* class_c_scroll_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scroll_view.png; sourceTree = ""; }; + 24A200740F90D1DD003BB5A7 /* class_c_scrollbar-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_scrollbar-members.html"; sourceTree = ""; }; + 24A200750F90D1DD003BB5A7 /* class_c_scrollbar.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_scrollbar.html; sourceTree = ""; }; + 24A200760F90D1DD003BB5A7 /* class_c_scrollbar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_scrollbar.png; sourceTree = ""; }; + 24A200770F90D1DD003BB5A7 /* class_c_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_slider-members.html"; sourceTree = ""; }; + 24A200780F90D1DD003BB5A7 /* class_c_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_slider.html; sourceTree = ""; }; + 24A200790F90D1DD003BB5A7 /* class_c_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_slider.png; sourceTree = ""; }; + 24A2007A0F90D1DD003BB5A7 /* class_c_special_digit-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_special_digit-members.html"; sourceTree = ""; }; + 24A2007B0F90D1DD003BB5A7 /* class_c_special_digit.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_special_digit.html; sourceTree = ""; }; + 24A2007C0F90D1DD003BB5A7 /* class_c_special_digit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_special_digit.png; sourceTree = ""; }; + 24A2007D0F90D1DD003BB5A7 /* class_c_splash_screen-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_splash_screen-members.html"; sourceTree = ""; }; + 24A2007E0F90D1DD003BB5A7 /* class_c_splash_screen.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_splash_screen.html; sourceTree = ""; }; + 24A2007F0F90D1DD003BB5A7 /* class_c_splash_screen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_splash_screen.png; sourceTree = ""; }; + 24A200800F90D1DD003BB5A7 /* class_c_splash_screen_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_splash_screen_view-members.html"; sourceTree = ""; }; + 24A200810F90D1DD003BB5A7 /* class_c_splash_screen_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_splash_screen_view.html; sourceTree = ""; }; + 24A200820F90D1DD003BB5A7 /* class_c_splash_screen_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_splash_screen_view.png; sourceTree = ""; }; + 24A200830F90D1DD003BB5A7 /* class_c_tab_button-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_button-members.html"; sourceTree = ""; }; + 24A200840F90D1DD003BB5A7 /* class_c_tab_button.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_button.html; sourceTree = ""; }; + 24A200850F90D1DD003BB5A7 /* class_c_tab_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_button.png; sourceTree = ""; }; + 24A200860F90D1DD003BB5A7 /* class_c_tab_child_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_child_view-members.html"; sourceTree = ""; }; + 24A200870F90D1DD003BB5A7 /* class_c_tab_child_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_child_view.html; sourceTree = ""; }; + 24A200880F90D1DD003BB5A7 /* class_c_tab_child_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_child_view.png; sourceTree = ""; }; + 24A200890F90D1DD003BB5A7 /* class_c_tab_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_tab_view-members.html"; sourceTree = ""; }; + 24A2008A0F90D1DD003BB5A7 /* class_c_tab_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_tab_view.html; sourceTree = ""; }; + 24A2008B0F90D1DD003BB5A7 /* class_c_tab_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_tab_view.png; sourceTree = ""; }; + 24A2008C0F90D1DD003BB5A7 /* class_c_text_edit-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_text_edit-members.html"; sourceTree = ""; }; + 24A2008D0F90D1DD003BB5A7 /* class_c_text_edit.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_text_edit.html; sourceTree = ""; }; + 24A2008E0F90D1DD003BB5A7 /* class_c_text_edit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_text_edit.png; sourceTree = ""; }; + 24A2008F0F90D1DD003BB5A7 /* class_c_text_label-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_text_label-members.html"; sourceTree = ""; }; + 24A200900F90D1DD003BB5A7 /* class_c_text_label.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_text_label.html; sourceTree = ""; }; + 24A200910F90D1DD003BB5A7 /* class_c_text_label.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_text_label.png; sourceTree = ""; }; + 24A200920F90D1DD003BB5A7 /* class_c_vertical_slider-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vertical_slider-members.html"; sourceTree = ""; }; + 24A200930F90D1DD003BB5A7 /* class_c_vertical_slider.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vertical_slider.html; sourceTree = ""; }; + 24A200940F90D1DD003BB5A7 /* class_c_vertical_slider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vertical_slider.png; sourceTree = ""; }; + 24A200950F90D1DD003BB5A7 /* class_c_vertical_switch-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vertical_switch-members.html"; sourceTree = ""; }; + 24A200960F90D1DD003BB5A7 /* class_c_vertical_switch.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vertical_switch.html; sourceTree = ""; }; + 24A200970F90D1DD003BB5A7 /* class_c_vertical_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vertical_switch.png; sourceTree = ""; }; + 24A200980F90D1DD003BB5A7 /* class_c_view-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_view-members.html"; sourceTree = ""; }; + 24A200990F90D1DD003BB5A7 /* class_c_view.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_view.html; sourceTree = ""; }; + 24A2009A0F90D1DD003BB5A7 /* class_c_view.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_view.png; sourceTree = ""; }; + 24A2009B0F90D1DD003BB5A7 /* class_c_view_container-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_view_container-members.html"; sourceTree = ""; }; + 24A2009C0F90D1DD003BB5A7 /* class_c_view_container.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_view_container.html; sourceTree = ""; }; + 24A2009D0F90D1DD003BB5A7 /* class_c_view_container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_view_container.png; sourceTree = ""; }; + 24A2009E0F90D1DD003BB5A7 /* class_c_vu_meter-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_c_vu_meter-members.html"; sourceTree = ""; }; + 24A2009F0F90D1DD003BB5A7 /* class_c_vu_meter.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_c_vu_meter.html; sourceTree = ""; }; + 24A200A00F90D1DD003BB5A7 /* class_c_vu_meter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_c_vu_meter.png; sourceTree = ""; }; + 24A200A10F90D1DD003BB5A7 /* class_i_scrollbar_drawer-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_i_scrollbar_drawer-members.html"; sourceTree = ""; }; + 24A200A20F90D1DD003BB5A7 /* class_i_scrollbar_drawer.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_i_scrollbar_drawer.html; sourceTree = ""; }; + 24A200A30F90D1DD003BB5A7 /* class_plugin_g_u_i_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "class_plugin_g_u_i_editor-members.html"; sourceTree = ""; }; + 24A200A40F90D1DD003BB5A7 /* class_plugin_g_u_i_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = class_plugin_g_u_i_editor.html; sourceTree = ""; }; + 24A200A50F90D1DD003BB5A7 /* cscrollview_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cscrollview_8cpp.html; sourceTree = ""; }; + 24A200A60F90D1DD003BB5A7 /* cscrollview_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = cscrollview_8h.html; sourceTree = ""; }; + 24A200A70F90D1DD003BB5A7 /* ctabview_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = ctabview_8cpp.html; sourceTree = ""; }; + 24A200A80F90D1DD003BB5A7 /* ctabview_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = ctabview_8h.html; sourceTree = ""; }; + 24A200A90F90D1DD003BB5A7 /* deprecated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = deprecated.html; sourceTree = ""; }; + 24A200AA0F90D1DD003BB5A7 /* doc_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = doc_8h.html; sourceTree = ""; }; + 24A200AB0F90D1DD003BB5A7 /* doxygen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = doxygen.css; sourceTree = ""; }; + 24A200AC0F90D1DD003BB5A7 /* doxygen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doxygen.png; sourceTree = ""; }; + 24A200AD0F90D1DD003BB5A7 /* files.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = files.html; sourceTree = ""; }; + 24A200AE0F90D1DD003BB5A7 /* ftv2blank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2blank.png; sourceTree = ""; }; + 24A200AF0F90D1DD003BB5A7 /* ftv2doc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2doc.png; sourceTree = ""; }; + 24A200B00F90D1DD003BB5A7 /* ftv2folderclosed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderclosed.png; sourceTree = ""; }; + 24A200B10F90D1DE003BB5A7 /* ftv2folderopen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderopen.png; sourceTree = ""; }; + 24A200B20F90D1DE003BB5A7 /* ftv2lastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2lastnode.png; sourceTree = ""; }; + 24A200B30F90D1DE003BB5A7 /* ftv2link.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2link.png; sourceTree = ""; }; + 24A200B40F90D1DE003BB5A7 /* ftv2mlastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mlastnode.png; sourceTree = ""; }; + 24A200B50F90D1DE003BB5A7 /* ftv2mnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mnode.png; sourceTree = ""; }; + 24A200B60F90D1DE003BB5A7 /* ftv2node.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2node.png; sourceTree = ""; }; + 24A200B70F90D1DE003BB5A7 /* ftv2plastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2plastnode.png; sourceTree = ""; }; + 24A200B80F90D1DE003BB5A7 /* ftv2pnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2pnode.png; sourceTree = ""; }; + 24A200B90F90D1DE003BB5A7 /* ftv2vertline.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2vertline.png; sourceTree = ""; }; + 24A200BA0F90D1DE003BB5A7 /* functions.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions.html; sourceTree = ""; }; + 24A200BB0F90D1DE003BB5A7 /* functions_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x62.html; sourceTree = ""; }; + 24A200BC0F90D1DE003BB5A7 /* functions_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x63.html; sourceTree = ""; }; + 24A200BD0F90D1DE003BB5A7 /* functions_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x64.html; sourceTree = ""; }; + 24A200BE0F90D1DE003BB5A7 /* functions_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x65.html; sourceTree = ""; }; + 24A200BF0F90D1DE003BB5A7 /* functions_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x66.html; sourceTree = ""; }; + 24A200C00F90D1DE003BB5A7 /* functions_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x67.html; sourceTree = ""; }; + 24A200C10F90D1DE003BB5A7 /* functions_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x68.html; sourceTree = ""; }; + 24A200C20F90D1DE003BB5A7 /* functions_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x69.html; sourceTree = ""; }; + 24A200C30F90D1DE003BB5A7 /* functions_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6b.html; sourceTree = ""; }; + 24A200C40F90D1DE003BB5A7 /* functions_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6c.html; sourceTree = ""; }; + 24A200C50F90D1DE003BB5A7 /* functions_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6d.html; sourceTree = ""; }; + 24A200C60F90D1DE003BB5A7 /* functions_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6e.html; sourceTree = ""; }; + 24A200C70F90D1DE003BB5A7 /* functions_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x6f.html; sourceTree = ""; }; + 24A200C80F90D1DE003BB5A7 /* functions_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x70.html; sourceTree = ""; }; + 24A200C90F90D1DE003BB5A7 /* functions_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x72.html; sourceTree = ""; }; + 24A200CA0F90D1DE003BB5A7 /* functions_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x73.html; sourceTree = ""; }; + 24A200CB0F90D1DE003BB5A7 /* functions_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x74.html; sourceTree = ""; }; + 24A200CC0F90D1DE003BB5A7 /* functions_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x75.html; sourceTree = ""; }; + 24A200CD0F90D1DE003BB5A7 /* functions_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x76.html; sourceTree = ""; }; + 24A200CE0F90D1DE003BB5A7 /* functions_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x77.html; sourceTree = ""; }; + 24A200CF0F90D1DE003BB5A7 /* functions_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x78.html; sourceTree = ""; }; + 24A200D00F90D1DE003BB5A7 /* functions_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x79.html; sourceTree = ""; }; + 24A200D10F90D1DE003BB5A7 /* functions_0x7a.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x7a.html; sourceTree = ""; }; + 24A200D20F90D1DE003BB5A7 /* functions_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_0x7e.html; sourceTree = ""; }; + 24A200D30F90D1DE003BB5A7 /* functions_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_eval.html; sourceTree = ""; }; + 24A200D40F90D1DE003BB5A7 /* functions_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func.html; sourceTree = ""; }; + 24A200D50F90D1DE003BB5A7 /* functions_func_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x62.html; sourceTree = ""; }; + 24A200D60F90D1DE003BB5A7 /* functions_func_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x63.html; sourceTree = ""; }; + 24A200D70F90D1DE003BB5A7 /* functions_func_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x64.html; sourceTree = ""; }; + 24A200D80F90D1DE003BB5A7 /* functions_func_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x65.html; sourceTree = ""; }; + 24A200D90F90D1DE003BB5A7 /* functions_func_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x66.html; sourceTree = ""; }; + 24A200DA0F90D1DE003BB5A7 /* functions_func_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x67.html; sourceTree = ""; }; + 24A200DB0F90D1DE003BB5A7 /* functions_func_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x68.html; sourceTree = ""; }; + 24A200DC0F90D1DE003BB5A7 /* functions_func_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x69.html; sourceTree = ""; }; + 24A200DD0F90D1DE003BB5A7 /* functions_func_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6c.html; sourceTree = ""; }; + 24A200DE0F90D1DE003BB5A7 /* functions_func_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6d.html; sourceTree = ""; }; + 24A200DF0F90D1DE003BB5A7 /* functions_func_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6e.html; sourceTree = ""; }; + 24A200E00F90D1DE003BB5A7 /* functions_func_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x6f.html; sourceTree = ""; }; + 24A200E10F90D1DE003BB5A7 /* functions_func_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x70.html; sourceTree = ""; }; + 24A200E20F90D1DE003BB5A7 /* functions_func_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x72.html; sourceTree = ""; }; + 24A200E30F90D1DE003BB5A7 /* functions_func_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x73.html; sourceTree = ""; }; + 24A200E40F90D1DE003BB5A7 /* functions_func_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x74.html; sourceTree = ""; }; + 24A200E50F90D1DE003BB5A7 /* functions_func_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x75.html; sourceTree = ""; }; + 24A200E60F90D1DE003BB5A7 /* functions_func_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x76.html; sourceTree = ""; }; + 24A200E70F90D1DE003BB5A7 /* functions_func_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x77.html; sourceTree = ""; }; + 24A200E80F90D1DE003BB5A7 /* functions_func_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_func_0x7e.html; sourceTree = ""; }; + 24A200E90F90D1DE003BB5A7 /* functions_rela.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_rela.html; sourceTree = ""; }; + 24A200EA0F90D1DE003BB5A7 /* functions_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars.html; sourceTree = ""; }; + 24A200EB0F90D1DE003BB5A7 /* functions_vars_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x62.html; sourceTree = ""; }; + 24A200EC0F90D1DE003BB5A7 /* functions_vars_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x63.html; sourceTree = ""; }; + 24A200ED0F90D1DE003BB5A7 /* functions_vars_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x64.html; sourceTree = ""; }; + 24A200EE0F90D1DE003BB5A7 /* functions_vars_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x65.html; sourceTree = ""; }; + 24A200EF0F90D1DE003BB5A7 /* functions_vars_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x66.html; sourceTree = ""; }; + 24A200F00F90D1DE003BB5A7 /* functions_vars_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x67.html; sourceTree = ""; }; + 24A200F10F90D1DE003BB5A7 /* functions_vars_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x68.html; sourceTree = ""; }; + 24A200F20F90D1DE003BB5A7 /* functions_vars_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x69.html; sourceTree = ""; }; + 24A200F30F90D1DE003BB5A7 /* functions_vars_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6b.html; sourceTree = ""; }; + 24A200F40F90D1DE003BB5A7 /* functions_vars_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6c.html; sourceTree = ""; }; + 24A200F50F90D1DE003BB5A7 /* functions_vars_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6d.html; sourceTree = ""; }; + 24A200F60F90D1DE003BB5A7 /* functions_vars_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6e.html; sourceTree = ""; }; + 24A200F70F90D1DE003BB5A7 /* functions_vars_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x6f.html; sourceTree = ""; }; + 24A200F80F90D1DE003BB5A7 /* functions_vars_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x70.html; sourceTree = ""; }; + 24A200F90F90D1DE003BB5A7 /* functions_vars_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x72.html; sourceTree = ""; }; + 24A200FA0F90D1DE003BB5A7 /* functions_vars_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x73.html; sourceTree = ""; }; + 24A200FB0F90D1DE003BB5A7 /* functions_vars_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x74.html; sourceTree = ""; }; + 24A200FC0F90D1DE003BB5A7 /* functions_vars_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x75.html; sourceTree = ""; }; + 24A200FD0F90D1DE003BB5A7 /* functions_vars_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x76.html; sourceTree = ""; }; + 24A200FE0F90D1DE003BB5A7 /* functions_vars_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x77.html; sourceTree = ""; }; + 24A200FF0F90D1DE003BB5A7 /* functions_vars_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x78.html; sourceTree = ""; }; + 24A201000F90D1DE003BB5A7 /* functions_vars_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x79.html; sourceTree = ""; }; + 24A201010F90D1DE003BB5A7 /* functions_vars_0x7a.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = functions_vars_0x7a.html; sourceTree = ""; }; + 24A201020F90D1DE003BB5A7 /* globals.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals.html; sourceTree = ""; }; + 24A201030F90D1DE003BB5A7 /* globals_0x61.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x61.html; sourceTree = ""; }; + 24A201040F90D1DE003BB5A7 /* globals_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x62.html; sourceTree = ""; }; + 24A201050F90D1DE003BB5A7 /* globals_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x63.html; sourceTree = ""; }; + 24A201060F90D1DE003BB5A7 /* globals_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x65.html; sourceTree = ""; }; + 24A201070F90D1DE003BB5A7 /* globals_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x66.html; sourceTree = ""; }; + 24A201080F90D1DE003BB5A7 /* globals_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x67.html; sourceTree = ""; }; + 24A201090F90D1DE003BB5A7 /* globals_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6b.html; sourceTree = ""; }; + 24A2010A0F90D1DE003BB5A7 /* globals_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6d.html; sourceTree = ""; }; + 24A2010B0F90D1DE003BB5A7 /* globals_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6e.html; sourceTree = ""; }; + 24A2010C0F90D1DE003BB5A7 /* globals_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x6f.html; sourceTree = ""; }; + 24A2010D0F90D1DE003BB5A7 /* globals_0x71.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x71.html; sourceTree = ""; }; + 24A2010E0F90D1DE003BB5A7 /* globals_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x72.html; sourceTree = ""; }; + 24A2010F0F90D1DE003BB5A7 /* globals_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x73.html; sourceTree = ""; }; + 24A201100F90D1DE003BB5A7 /* globals_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x74.html; sourceTree = ""; }; + 24A201110F90D1DE003BB5A7 /* globals_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x75.html; sourceTree = ""; }; + 24A201120F90D1DE003BB5A7 /* globals_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x76.html; sourceTree = ""; }; + 24A201130F90D1DE003BB5A7 /* globals_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_0x77.html; sourceTree = ""; }; + 24A201140F90D1DE003BB5A7 /* globals_defs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_defs.html; sourceTree = ""; }; + 24A201150F90D1DE003BB5A7 /* globals_enum.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_enum.html; sourceTree = ""; }; + 24A201160F90D1DE003BB5A7 /* globals_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_eval.html; sourceTree = ""; }; + 24A201170F90D1DE003BB5A7 /* globals_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_type.html; sourceTree = ""; }; + 24A201180F90D1DE003BB5A7 /* globals_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = globals_vars.html; sourceTree = ""; }; + 24A201190F90D1DE003BB5A7 /* hierarchy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = hierarchy.html; sourceTree = ""; }; + 24A2011A0F90D1DE003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = index.html; sourceTree = ""; }; + 24A2011B0F90D1DE003BB5A7 /* intro.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = intro.html; sourceTree = ""; }; + 24A2011C0F90D1DE003BB5A7 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = license.html; sourceTree = ""; }; + 24A2011D0F90D1DE003BB5A7 /* maceditor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = maceditor.html; sourceTree = ""; }; + 24A2011E0F90D1DE003BB5A7 /* main.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = main.html; sourceTree = ""; }; + 24A2011F0F90D1DE003BB5A7 /* others.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = others.html; sourceTree = ""; }; + 24A201200F90D1DE003BB5A7 /* pages.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = pages.html; sourceTree = ""; }; + 24A201210F90D1DE003BB5A7 /* plugguieditor_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = plugguieditor_8cpp.html; sourceTree = ""; }; + 24A201220F90D1DE003BB5A7 /* plugguieditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = plugguieditor_8h.html; sourceTree = ""; }; + 24A201230F90D1DE003BB5A7 /* sequences.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = sequences.html; sourceTree = ""; }; + 24A201240F90D1DE003BB5A7 /* struct_c_color-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_color-members.html"; sourceTree = ""; }; + 24A201250F90D1DE003BB5A7 /* struct_c_color.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_color.html; sourceTree = ""; }; + 24A201260F90D1DE003BB5A7 /* struct_c_point-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_point-members.html"; sourceTree = ""; }; + 24A201270F90D1DE003BB5A7 /* struct_c_point.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_point.html; sourceTree = ""; }; + 24A201280F90D1DE003BB5A7 /* struct_c_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_c_rect-members.html"; sourceTree = ""; }; + 24A201290F90D1DE003BB5A7 /* struct_c_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_c_rect.html; sourceTree = ""; }; + 24A2012A0F90D1DE003BB5A7 /* struct_e_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_e_rect-members.html"; sourceTree = ""; }; + 24A2012B0F90D1DE003BB5A7 /* struct_e_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_e_rect.html; sourceTree = ""; }; + 24A2012C0F90D1DE003BB5A7 /* struct_vst_file_select-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_file_select-members.html"; sourceTree = ""; }; + 24A2012D0F90D1DE003BB5A7 /* struct_vst_file_select.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_file_select.html; sourceTree = ""; }; + 24A2012E0F90D1DE003BB5A7 /* struct_vst_file_type-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_file_type-members.html"; sourceTree = ""; }; + 24A2012F0F90D1DE003BB5A7 /* struct_vst_file_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_file_type.html; sourceTree = ""; }; + 24A201300F90D1DE003BB5A7 /* struct_vst_key_code-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = "struct_vst_key_code-members.html"; sourceTree = ""; }; + 24A201310F90D1DE003BB5A7 /* struct_vst_key_code.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = struct_vst_key_code.html; sourceTree = ""; }; + 24A201320F90D1DE003BB5A7 /* tab_b.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_b.gif; sourceTree = ""; }; + 24A201330F90D1DE003BB5A7 /* tab_l.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_l.gif; sourceTree = ""; }; + 24A201340F90D1DE003BB5A7 /* tab_r.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_r.gif; sourceTree = ""; }; + 24A201350F90D1DE003BB5A7 /* tabs.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = tabs.css; sourceTree = ""; }; + 24A201360F90D1DE003BB5A7 /* thanks.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = thanks.html; sourceTree = ""; }; + 24A201370F90D1DE003BB5A7 /* tree.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = tree.html; sourceTree = ""; }; + 24A201380F90D1DE003BB5A7 /* vstcontrols_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstcontrols_8cpp.html; sourceTree = ""; }; + 24A201390F90D1DE003BB5A7 /* vstcontrols_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstcontrols_8h.html; sourceTree = ""; }; + 24A2013A0F90D1DE003BB5A7 /* vstgui_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstgui_8cpp.html; sourceTree = ""; }; + 24A2013B0F90D1DE003BB5A7 /* vstgui_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstgui_8h.html; sourceTree = ""; }; + 24A2013C0F90D1DE003BB5A7 /* vstkeycode_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstkeycode_8h.html; sourceTree = ""; }; + 24A2013D0F90D1DE003BB5A7 /* vstoffline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstoffline.html; sourceTree = ""; }; + 24A2013E0F90D1DE003BB5A7 /* vstparamstruct.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstparamstruct.html; sourceTree = ""; }; + 24A2013F0F90D1DE003BB5A7 /* vstplugscarbon_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugscarbon_8h.html; sourceTree = ""; }; + 24A201400F90D1DE003BB5A7 /* vstplugsmac_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsmac_8h.html; sourceTree = ""; }; + 24A201410F90D1DE003BB5A7 /* vstplugsmacho_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsmacho_8h.html; sourceTree = ""; }; + 24A201420F90D1DE003BB5A7 /* vstplugsquartz_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = vstplugsquartz_8h.html; sourceTree = ""; }; + 24A201430F90D1DE003BB5A7 /* whatsnew.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = whatsnew.html; sourceTree = ""; }; + 24A201440F90D1DE003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = index.html; sourceTree = ""; }; + 24A201450F90D1DE003BB5A7 /* Migrating from 2.3.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Migrating from 2.3.rtf"; sourceTree = ""; }; + 24A201460F90D1DE003BB5A7 /* plugguieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plugguieditor.cpp; sourceTree = ""; }; + 24A201470F90D1DE003BB5A7 /* plugguieditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plugguieditor.h; sourceTree = ""; }; + 24A201480F90D1DE003BB5A7 /* vstcontrols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstcontrols.cpp; sourceTree = ""; }; + 24A201490F90D1DE003BB5A7 /* vstcontrols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstcontrols.h; sourceTree = ""; }; + 24A2014A0F90D1DE003BB5A7 /* vstgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstgui.cpp; sourceTree = ""; }; + 24A2014B0F90D1DE003BB5A7 /* vstgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstgui.h; sourceTree = ""; }; + 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstkeycode.h; sourceTree = ""; }; + 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugscarbon.h; sourceTree = ""; }; + 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsmac.h; sourceTree = ""; }; + 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsmacho.h; sourceTree = ""; }; + 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstplugsquartz.h; sourceTree = ""; }; + 24A2FEBD0F90D1DC003BB5A7 /* Thumbs.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = Thumbs.db; sourceTree = ""; }; + 24A2FEBE0F90D1DC003BB5A7 /* VST_Logo_Usage_Guideline.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = VST_Logo_Usage_Guideline.pdf; sourceTree = ""; }; + 24A2FEBF0F90D1DC003BB5A7 /* VSTLogoAlpha.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VSTLogoAlpha.png; sourceTree = ""; }; + 24A2FEC00F90D1DC003BB5A7 /* VSTLogoBlack.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = VSTLogoBlack.jpg; sourceTree = ""; }; + 24A2FEC10F90D1DC003BB5A7 /* VSTLogoWhite.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = VSTLogoWhite.jpg; sourceTree = ""; }; + 24A2FEC60F90D1DC003BB5A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 24A2FEC80F90D1DC003BB5A7 /* VSTMonitor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = VSTMonitor; sourceTree = ""; }; + 24A2FEC90F90D1DC003BB5A7 /* PkgInfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PkgInfo; sourceTree = ""; }; + 24A2FECB0F90D1DC003BB5A7 /* bmp50000.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50000.bmp; sourceTree = ""; }; + 24A2FECC0F90D1DC003BB5A7 /* bmp50001.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50001.bmp; sourceTree = ""; }; + 24A2FECD0F90D1DC003BB5A7 /* bmp50002.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50002.bmp; sourceTree = ""; }; + 24A2FECE0F90D1DC003BB5A7 /* bmp50003.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50003.bmp; sourceTree = ""; }; + 24A2FECF0F90D1DC003BB5A7 /* bmp50004.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50004.bmp; sourceTree = ""; }; + 24A2FED00F90D1DC003BB5A7 /* bmp50005.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50005.bmp; sourceTree = ""; }; + 24A2FED10F90D1DC003BB5A7 /* bmp50006.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50006.bmp; sourceTree = ""; }; + 24A2FED20F90D1DC003BB5A7 /* bmp50007.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50007.bmp; sourceTree = ""; }; + 24A2FED30F90D1DC003BB5A7 /* bmp50008.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp50008.bmp; sourceTree = ""; }; + 24A2FED40F90D1DC003BB5A7 /* VSTParamTool.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = VSTParamTool.app; sourceTree = ""; }; + 24A2FED60F90D1DC003BB5A7 /* vstmonitor.dll */ = {isa = PBXFileReference; lastKnownFileType = file; path = vstmonitor.dll; sourceTree = ""; }; + 24A2FED70F90D1DC003BB5A7 /* vstparamtool.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = vstparamtool.exe; sourceTree = ""; }; + 24A2FEDA0F90D1DC003BB5A7 /* folder.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = folder.gif; sourceTree = ""; }; + 24A2FEDB0F90D1DC003BB5A7 /* mac.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = mac.gif; sourceTree = ""; }; + 24A2FEDC0F90D1DC003BB5A7 /* vstpluglogo_small.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = vstpluglogo_small.jpg; sourceTree = ""; }; + 24A2FEDD0F90D1DC003BB5A7 /* win.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = win.gif; sourceTree = ""; }; + 24A2FEDF0F90D1DC003BB5A7 /* aeffect_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffect_8h.html; sourceTree = ""; }; + 24A2FEE00F90D1DC003BB5A7 /* aeffectx_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffectx_8h.html; sourceTree = ""; }; + 24A2FEE10F90D1DC003BB5A7 /* aeffeditor_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = aeffeditor_8h.html; sourceTree = ""; }; + 24A2FEE20F90D1DC003BB5A7 /* annotated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = annotated.html; sourceTree = ""; }; + 24A2FEE30F90D1DC003BB5A7 /* audioeffect_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffect_8cpp.html; sourceTree = ""; }; + 24A2FEE40F90D1DC003BB5A7 /* audioeffect_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffect_8h.html; sourceTree = ""; }; + 24A2FEE50F90D1DC003BB5A7 /* audioeffectx_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffectx_8cpp.html; sourceTree = ""; }; + 24A2FEE60F90D1DC003BB5A7 /* audioeffectx_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = audioeffectx_8h.html; sourceTree = ""; }; + 24A2FEE70F90D1DC003BB5A7 /* Blocksizechange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Blocksizechange.gif; sourceTree = ""; }; + 24A2FEE80F90D1DC003BB5A7 /* class_a_eff_editor-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_a_eff_editor-members.html"; sourceTree = ""; }; + 24A2FEE90F90D1DC003BB5A7 /* class_a_eff_editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_a_eff_editor.html; sourceTree = ""; }; + 24A2FEEA0F90D1DC003BB5A7 /* class_audio_effect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_audio_effect-members.html"; sourceTree = ""; }; + 24A2FEEB0F90D1DC003BB5A7 /* class_audio_effect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_audio_effect.html; sourceTree = ""; }; + 24A2FEEC0F90D1DC003BB5A7 /* class_audio_effect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_audio_effect.png; sourceTree = ""; }; + 24A2FEED0F90D1DC003BB5A7 /* class_audio_effect_x-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "class_audio_effect_x-members.html"; sourceTree = ""; }; + 24A2FEEE0F90D1DC003BB5A7 /* class_audio_effect_x.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = class_audio_effect_x.html; sourceTree = ""; }; + 24A2FEEF0F90D1DC003BB5A7 /* class_audio_effect_x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = class_audio_effect_x.png; sourceTree = ""; }; + 24A2FEF00F90D1DC003BB5A7 /* ControlChanged.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = ControlChanged.gif; sourceTree = ""; }; + 24A2FEF10F90D1DC003BB5A7 /* deprecated.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = deprecated.html; sourceTree = ""; }; + 24A2FEF20F90D1DC003BB5A7 /* dir_2d3252dd12c84c66c1d25b26bb45a1f5.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_2d3252dd12c84c66c1d25b26bb45a1f5.html; sourceTree = ""; }; + 24A2FEF30F90D1DC003BB5A7 /* dir_77c628dfee72e555f82d5ef53b733f38.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_77c628dfee72e555f82d5ef53b733f38.html; sourceTree = ""; }; + 24A2FEF40F90D1DC003BB5A7 /* dir_f81105d3b854bea570aaf3bae5cb64c1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_f81105d3b854bea570aaf3bae5cb64c1.html; sourceTree = ""; }; + 24A2FEF50F90D1DC003BB5A7 /* dir_fa0454ab79b4262333bf837ea3d765e9.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dir_fa0454ab79b4262333bf837ea3d765e9.html; sourceTree = ""; }; + 24A2FEF60F90D1DC003BB5A7 /* dirs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = dirs.html; sourceTree = ""; }; + 24A2FEF70F90D1DC003BB5A7 /* doc_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = doc_8h.html; sourceTree = ""; }; + 24A2FEF80F90D1DC003BB5A7 /* doxygen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = doxygen.css; sourceTree = ""; }; + 24A2FEF90F90D1DC003BB5A7 /* doxygen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doxygen.png; sourceTree = ""; }; + 24A2FEFA0F90D1DC003BB5A7 /* files.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = files.html; sourceTree = ""; }; + 24A2FEFB0F90D1DC003BB5A7 /* ftv2blank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2blank.png; sourceTree = ""; }; + 24A2FEFC0F90D1DC003BB5A7 /* ftv2doc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2doc.png; sourceTree = ""; }; + 24A2FEFD0F90D1DC003BB5A7 /* ftv2folderclosed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderclosed.png; sourceTree = ""; }; + 24A2FEFE0F90D1DC003BB5A7 /* ftv2folderopen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2folderopen.png; sourceTree = ""; }; + 24A2FEFF0F90D1DC003BB5A7 /* ftv2lastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2lastnode.png; sourceTree = ""; }; + 24A2FF000F90D1DC003BB5A7 /* ftv2link.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2link.png; sourceTree = ""; }; + 24A2FF010F90D1DC003BB5A7 /* ftv2mlastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mlastnode.png; sourceTree = ""; }; + 24A2FF020F90D1DC003BB5A7 /* ftv2mnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2mnode.png; sourceTree = ""; }; + 24A2FF030F90D1DC003BB5A7 /* ftv2node.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2node.png; sourceTree = ""; }; + 24A2FF040F90D1DC003BB5A7 /* ftv2plastnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2plastnode.png; sourceTree = ""; }; + 24A2FF050F90D1DC003BB5A7 /* ftv2pnode.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2pnode.png; sourceTree = ""; }; + 24A2FF060F90D1DC003BB5A7 /* ftv2vertline.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ftv2vertline.png; sourceTree = ""; }; + 24A2FF070F90D1DC003BB5A7 /* functions.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions.html; sourceTree = ""; }; + 24A2FF080F90D1DC003BB5A7 /* functions_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x62.html; sourceTree = ""; }; + 24A2FF090F90D1DC003BB5A7 /* functions_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x63.html; sourceTree = ""; }; + 24A2FF0A0F90D1DC003BB5A7 /* functions_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x64.html; sourceTree = ""; }; + 24A2FF0B0F90D1DC003BB5A7 /* functions_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x65.html; sourceTree = ""; }; + 24A2FF0C0F90D1DC003BB5A7 /* functions_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x66.html; sourceTree = ""; }; + 24A2FF0D0F90D1DC003BB5A7 /* functions_0x67.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x67.html; sourceTree = ""; }; + 24A2FF0E0F90D1DC003BB5A7 /* functions_0x68.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x68.html; sourceTree = ""; }; + 24A2FF0F0F90D1DC003BB5A7 /* functions_0x69.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x69.html; sourceTree = ""; }; + 24A2FF100F90D1DC003BB5A7 /* functions_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6b.html; sourceTree = ""; }; + 24A2FF110F90D1DC003BB5A7 /* functions_0x6c.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6c.html; sourceTree = ""; }; + 24A2FF120F90D1DC003BB5A7 /* functions_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6d.html; sourceTree = ""; }; + 24A2FF130F90D1DC003BB5A7 /* functions_0x6e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6e.html; sourceTree = ""; }; + 24A2FF140F90D1DC003BB5A7 /* functions_0x6f.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x6f.html; sourceTree = ""; }; + 24A2FF150F90D1DC003BB5A7 /* functions_0x70.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x70.html; sourceTree = ""; }; + 24A2FF160F90D1DC003BB5A7 /* functions_0x72.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x72.html; sourceTree = ""; }; + 24A2FF170F90D1DC003BB5A7 /* functions_0x73.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x73.html; sourceTree = ""; }; + 24A2FF180F90D1DC003BB5A7 /* functions_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x74.html; sourceTree = ""; }; + 24A2FF190F90D1DC003BB5A7 /* functions_0x75.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x75.html; sourceTree = ""; }; + 24A2FF1A0F90D1DC003BB5A7 /* functions_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x76.html; sourceTree = ""; }; + 24A2FF1B0F90D1DC003BB5A7 /* functions_0x77.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x77.html; sourceTree = ""; }; + 24A2FF1C0F90D1DC003BB5A7 /* functions_0x78.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x78.html; sourceTree = ""; }; + 24A2FF1D0F90D1DC003BB5A7 /* functions_0x79.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x79.html; sourceTree = ""; }; + 24A2FF1E0F90D1DC003BB5A7 /* functions_0x7e.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_0x7e.html; sourceTree = ""; }; + 24A2FF1F0F90D1DC003BB5A7 /* functions_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_func.html; sourceTree = ""; }; + 24A2FF200F90D1DC003BB5A7 /* functions_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = functions_vars.html; sourceTree = ""; }; + 24A2FF210F90D1DC003BB5A7 /* globals.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals.html; sourceTree = ""; }; + 24A2FF220F90D1DC003BB5A7 /* globals_0x62.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x62.html; sourceTree = ""; }; + 24A2FF230F90D1DC003BB5A7 /* globals_0x63.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x63.html; sourceTree = ""; }; + 24A2FF240F90D1DC003BB5A7 /* globals_0x64.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x64.html; sourceTree = ""; }; + 24A2FF250F90D1DC003BB5A7 /* globals_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x65.html; sourceTree = ""; }; + 24A2FF260F90D1DC003BB5A7 /* globals_0x66.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x66.html; sourceTree = ""; }; + 24A2FF270F90D1DC003BB5A7 /* globals_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x6b.html; sourceTree = ""; }; + 24A2FF280F90D1DC003BB5A7 /* globals_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x6d.html; sourceTree = ""; }; + 24A2FF290F90D1DC003BB5A7 /* globals_0x74.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x74.html; sourceTree = ""; }; + 24A2FF2A0F90D1DC003BB5A7 /* globals_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_0x76.html; sourceTree = ""; }; + 24A2FF2B0F90D1DC003BB5A7 /* globals_defs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_defs.html; sourceTree = ""; }; + 24A2FF2C0F90D1DC003BB5A7 /* globals_enum.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_enum.html; sourceTree = ""; }; + 24A2FF2D0F90D1DC003BB5A7 /* globals_eval.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval.html; sourceTree = ""; }; + 24A2FF2E0F90D1DC003BB5A7 /* globals_eval_0x65.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x65.html; sourceTree = ""; }; + 24A2FF2F0F90D1DC003BB5A7 /* globals_eval_0x6b.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x6b.html; sourceTree = ""; }; + 24A2FF300F90D1DC003BB5A7 /* globals_eval_0x6d.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x6d.html; sourceTree = ""; }; + 24A2FF310F90D1DC003BB5A7 /* globals_eval_0x76.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_eval_0x76.html; sourceTree = ""; }; + 24A2FF320F90D1DC003BB5A7 /* globals_func.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_func.html; sourceTree = ""; }; + 24A2FF330F90D1DC003BB5A7 /* globals_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_type.html; sourceTree = ""; }; + 24A2FF340F90D1DC003BB5A7 /* globals_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = globals_vars.html; sourceTree = ""; }; + 24A2FF350F90D1DC003BB5A7 /* hierarchy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = hierarchy.html; sourceTree = ""; }; + 24A2FF360F90D1DC003BB5A7 /* history.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = history.html; sourceTree = ""; }; + 24A2FF370F90D1DC003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; + 24A2FF380F90D1DC003BB5A7 /* Initialisation.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Initialisation.gif; sourceTree = ""; }; + 24A2FF390F90D1DC003BB5A7 /* intro.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = intro.html; sourceTree = ""; }; + 24A2FF3A0F90D1DC003BB5A7 /* IOchange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = IOchange.gif; sourceTree = ""; }; + 24A2FF3B0F90D1DC003BB5A7 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = license.html; sourceTree = ""; }; + 24A2FF3C0F90D1DC003BB5A7 /* maceditor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = maceditor.html; sourceTree = ""; }; + 24A2FF3D0F90D1DC003BB5A7 /* main.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = main.html; sourceTree = ""; }; + 24A2FF3E0F90D1DC003BB5A7 /* namespace_host_can_dos.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespace_host_can_dos.html; sourceTree = ""; }; + 24A2FF3F0F90D1DC003BB5A7 /* namespace_plug_can_dos.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespace_plug_can_dos.html; sourceTree = ""; }; + 24A2FF400F90D1DC003BB5A7 /* namespacemembers.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespacemembers.html; sourceTree = ""; }; + 24A2FF410F90D1DC003BB5A7 /* namespacemembers_vars.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespacemembers_vars.html; sourceTree = ""; }; + 24A2FF420F90D1DC003BB5A7 /* namespaces.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = namespaces.html; sourceTree = ""; }; + 24A2FF430F90D1DC003BB5A7 /* Offlineprocessing.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Offlineprocessing.gif; sourceTree = ""; }; + 24A2FF440F90D1DC003BB5A7 /* others.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = others.html; sourceTree = ""; }; + 24A2FF450F90D1DC003BB5A7 /* pages.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = pages.html; sourceTree = ""; }; + 24A2FF460F90D1DC003BB5A7 /* Sampleratechange.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Sampleratechange.gif; sourceTree = ""; }; + 24A2FF470F90D1DC003BB5A7 /* sequences.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sequences.html; sourceTree = ""; }; + 24A2FF480F90D1DC003BB5A7 /* SpeakerarrangementnegotiationforVSTfx.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = SpeakerarrangementnegotiationforVSTfx.gif; sourceTree = ""; }; + 24A2FF490F90D1DC003BB5A7 /* struct_a_effect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_a_effect-members.html"; sourceTree = ""; }; + 24A2FF4A0F90D1DC003BB5A7 /* struct_a_effect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_a_effect.html; sourceTree = ""; }; + 24A2FF4B0F90D1DC003BB5A7 /* struct_e_rect-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_e_rect-members.html"; sourceTree = ""; }; + 24A2FF4C0F90D1DC003BB5A7 /* struct_e_rect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_e_rect.html; sourceTree = ""; }; + 24A2FF4D0F90D1DC003BB5A7 /* struct_midi_key_name-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_key_name-members.html"; sourceTree = ""; }; + 24A2FF4E0F90D1DC003BB5A7 /* struct_midi_key_name.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_key_name.html; sourceTree = ""; }; + 24A2FF4F0F90D1DC003BB5A7 /* struct_midi_program_category-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_program_category-members.html"; sourceTree = ""; }; + 24A2FF500F90D1DC003BB5A7 /* struct_midi_program_category.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_program_category.html; sourceTree = ""; }; + 24A2FF510F90D1DC003BB5A7 /* struct_midi_program_name-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_midi_program_name-members.html"; sourceTree = ""; }; + 24A2FF520F90D1DC003BB5A7 /* struct_midi_program_name.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_midi_program_name.html; sourceTree = ""; }; + 24A2FF530F90D1DC003BB5A7 /* struct_vst_audio_file-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_audio_file-members.html"; sourceTree = ""; }; + 24A2FF540F90D1DC003BB5A7 /* struct_vst_audio_file.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_audio_file.html; sourceTree = ""; }; + 24A2FF550F90D1DC003BB5A7 /* struct_vst_audio_file_marker-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_audio_file_marker-members.html"; sourceTree = ""; }; + 24A2FF560F90D1DC003BB5A7 /* struct_vst_audio_file_marker.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_audio_file_marker.html; sourceTree = ""; }; + 24A2FF570F90D1DC003BB5A7 /* struct_vst_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_event-members.html"; sourceTree = ""; }; + 24A2FF580F90D1DC003BB5A7 /* struct_vst_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_event.html; sourceTree = ""; }; + 24A2FF590F90D1DD003BB5A7 /* struct_vst_events-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_events-members.html"; sourceTree = ""; }; + 24A2FF5A0F90D1DD003BB5A7 /* struct_vst_events.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_events.html; sourceTree = ""; }; + 24A2FF5B0F90D1DD003BB5A7 /* struct_vst_file_select-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_file_select-members.html"; sourceTree = ""; }; + 24A2FF5C0F90D1DD003BB5A7 /* struct_vst_file_select.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_file_select.html; sourceTree = ""; }; + 24A2FF5D0F90D1DD003BB5A7 /* struct_vst_file_type-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_file_type-members.html"; sourceTree = ""; }; + 24A2FF5E0F90D1DD003BB5A7 /* struct_vst_file_type.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_file_type.html; sourceTree = ""; }; + 24A2FF5F0F90D1DD003BB5A7 /* struct_vst_key_code-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_key_code-members.html"; sourceTree = ""; }; + 24A2FF600F90D1DD003BB5A7 /* struct_vst_key_code.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_key_code.html; sourceTree = ""; }; + 24A2FF610F90D1DD003BB5A7 /* struct_vst_midi_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_midi_event-members.html"; sourceTree = ""; }; + 24A2FF620F90D1DD003BB5A7 /* struct_vst_midi_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_midi_event.html; sourceTree = ""; }; + 24A2FF630F90D1DD003BB5A7 /* struct_vst_midi_sysex_event-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_midi_sysex_event-members.html"; sourceTree = ""; }; + 24A2FF640F90D1DD003BB5A7 /* struct_vst_midi_sysex_event.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_midi_sysex_event.html; sourceTree = ""; }; + 24A2FF650F90D1DD003BB5A7 /* struct_vst_offline_task-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_offline_task-members.html"; sourceTree = ""; }; + 24A2FF660F90D1DD003BB5A7 /* struct_vst_offline_task.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_offline_task.html; sourceTree = ""; }; + 24A2FF670F90D1DD003BB5A7 /* struct_vst_parameter_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_parameter_properties-members.html"; sourceTree = ""; }; + 24A2FF680F90D1DD003BB5A7 /* struct_vst_parameter_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_parameter_properties.html; sourceTree = ""; }; + 24A2FF690F90D1DD003BB5A7 /* struct_vst_patch_chunk_info-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_patch_chunk_info-members.html"; sourceTree = ""; }; + 24A2FF6A0F90D1DD003BB5A7 /* struct_vst_patch_chunk_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_patch_chunk_info.html; sourceTree = ""; }; + 24A2FF6B0F90D1DD003BB5A7 /* struct_vst_pin_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_pin_properties-members.html"; sourceTree = ""; }; + 24A2FF6C0F90D1DD003BB5A7 /* struct_vst_pin_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_pin_properties.html; sourceTree = ""; }; + 24A2FF6D0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_speaker_arrangement-members.html"; sourceTree = ""; }; + 24A2FF6E0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_speaker_arrangement.html; sourceTree = ""; }; + 24A2FF6F0F90D1DD003BB5A7 /* struct_vst_speaker_properties-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_speaker_properties-members.html"; sourceTree = ""; }; + 24A2FF700F90D1DD003BB5A7 /* struct_vst_speaker_properties.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_speaker_properties.html; sourceTree = ""; }; + 24A2FF710F90D1DD003BB5A7 /* struct_vst_time_info-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_time_info-members.html"; sourceTree = ""; }; + 24A2FF720F90D1DD003BB5A7 /* struct_vst_time_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_time_info.html; sourceTree = ""; }; + 24A2FF730F90D1DD003BB5A7 /* struct_vst_variable_io-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_variable_io-members.html"; sourceTree = ""; }; + 24A2FF740F90D1DD003BB5A7 /* struct_vst_variable_io.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_variable_io.html; sourceTree = ""; }; + 24A2FF750F90D1DD003BB5A7 /* struct_vst_window-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "struct_vst_window-members.html"; sourceTree = ""; }; + 24A2FF760F90D1DD003BB5A7 /* struct_vst_window.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = struct_vst_window.html; sourceTree = ""; }; + 24A2FF770F90D1DD003BB5A7 /* structfx_bank-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "structfx_bank-members.html"; sourceTree = ""; }; + 24A2FF780F90D1DD003BB5A7 /* structfx_bank.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = structfx_bank.html; sourceTree = ""; }; + 24A2FF790F90D1DD003BB5A7 /* structfx_program-members.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "structfx_program-members.html"; sourceTree = ""; }; + 24A2FF7A0F90D1DD003BB5A7 /* structfx_program.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = structfx_program.html; sourceTree = ""; }; + 24A2FF7B0F90D1DD003BB5A7 /* tab_b.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_b.gif; sourceTree = ""; }; + 24A2FF7C0F90D1DD003BB5A7 /* tab_l.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_l.gif; sourceTree = ""; }; + 24A2FF7D0F90D1DD003BB5A7 /* tab_r.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tab_r.gif; sourceTree = ""; }; + 24A2FF7E0F90D1DD003BB5A7 /* tabs.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = tabs.css; sourceTree = ""; }; + 24A2FF7F0F90D1DD003BB5A7 /* Termination.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Termination.gif; sourceTree = ""; }; + 24A2FF800F90D1DD003BB5A7 /* thanks.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = thanks.html; sourceTree = ""; }; + 24A2FF810F90D1DD003BB5A7 /* tree.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = tree.html; sourceTree = ""; }; + 24A2FF820F90D1DD003BB5A7 /* TurnOff.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = TurnOff.gif; sourceTree = ""; }; + 24A2FF830F90D1DD003BB5A7 /* TurnOn.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = TurnOn.gif; sourceTree = ""; }; + 24A2FF840F90D1DD003BB5A7 /* vstfxstore_8h.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstfxstore_8h.html; sourceTree = ""; }; + 24A2FF850F90D1DD003BB5A7 /* vstoffline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstoffline.html; sourceTree = ""; }; + 24A2FF860F90D1DD003BB5A7 /* vstparamstruct.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstparamstruct.html; sourceTree = ""; }; + 24A2FF870F90D1DD003BB5A7 /* vstpluglogo.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = vstpluglogo.jpg; sourceTree = ""; }; + 24A2FF880F90D1DD003BB5A7 /* vstplugmain_8cpp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = vstplugmain_8cpp.html; sourceTree = ""; }; + 24A2FF890F90D1DD003BB5A7 /* whatsnew.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = whatsnew.html; sourceTree = ""; }; + 24A2FF8A0F90D1DD003BB5A7 /* sdk.menu.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sdk.menu.html; sourceTree = ""; }; + 24A2FF8B0F90D1DD003BB5A7 /* sdk.overview.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = sdk.overview.html; sourceTree = ""; }; + 24A2FF8C0F90D1DD003BB5A7 /* sdkdoc.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = sdkdoc.css; sourceTree = ""; }; + 24A2FF8D0F90D1DD003BB5A7 /* VST Licensing Agreement.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "VST Licensing Agreement.rtf"; sourceTree = ""; }; + 24A2FF8E0F90D1DD003BB5A7 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; + 24A2FF910F90D1DD003BB5A7 /* aeffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffect.h; sourceTree = ""; }; + 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffectx.h; sourceTree = ""; }; + 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstfxstore.h; sourceTree = ""; }; + 24A2FF980F90D1DD003BB5A7 /* adelay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adelay.cpp; sourceTree = ""; }; + 24A2FF990F90D1DD003BB5A7 /* adelay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adelay.h; sourceTree = ""; }; + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adelaymain.cpp; sourceTree = ""; }; + 24A2FF9D0F90D1DD003BB5A7 /* bmp00128.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00128.bmp; sourceTree = ""; }; + 24A2FF9E0F90D1DD003BB5A7 /* bmp00129.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00129.bmp; sourceTree = ""; }; + 24A2FF9F0F90D1DD003BB5A7 /* bmp00130.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp00130.bmp; sourceTree = ""; }; + 24A2FFA00F90D1DD003BB5A7 /* surrounddelay.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = surrounddelay.rc; sourceTree = ""; }; + 24A2FFA10F90D1DD003BB5A7 /* sdeditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sdeditor.cpp; sourceTree = ""; }; + 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdeditor.h; sourceTree = ""; }; + 24A2FFA30F90D1DD003BB5A7 /* surrounddelay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = surrounddelay.cpp; sourceTree = ""; }; + 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surrounddelay.h; sourceTree = ""; }; + 24A2FFA60F90D1DD003BB5A7 /* adelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = adelay.vcproj; sourceTree = ""; }; + 24A2FFA70F90D1DD003BB5A7 /* surrounddelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = surrounddelay.vcproj; sourceTree = ""; }; + 24A2FFAA0F90D1DD003BB5A7 /* again.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = again.cpp; sourceTree = ""; }; + 24A2FFAB0F90D1DD003BB5A7 /* again.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = again.h; sourceTree = ""; }; + 24A2FFAD0F90D1DD003BB5A7 /* again.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = again.vcproj; sourceTree = ""; }; + 24A2FFAF0F90D1DD003BB5A7 /* minihost-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "minihost-Info.plist"; sourceTree = ""; }; + 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "vst 2.4 examples.xcodeproj"; sourceTree = ""; }; + 24A2FFB30F90D1DD003BB5A7 /* vst2.4Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = vst2.4Info.plist; sourceTree = ""; }; + 24A2FFB60F90D1DD003BB5A7 /* minieditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minieditor.cpp; sourceTree = ""; }; + 24A2FFB70F90D1DD003BB5A7 /* minihost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minihost.cpp; sourceTree = ""; }; + 24A2FFB90F90D1DD003BB5A7 /* minihost.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = minihost.vcproj; sourceTree = ""; }; + 24A2FFBC0F90D1DD003BB5A7 /* vstxsynth.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.rc; sourceTree = ""; }; + 24A2FFBD0F90D1DD003BB5A7 /* vstxsynth.vstxml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.vstxml; sourceTree = ""; }; + 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gmnames.h; sourceTree = ""; }; + 24A2FFC00F90D1DD003BB5A7 /* vstxsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstxsynth.cpp; sourceTree = ""; }; + 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vstxsynth.h; sourceTree = ""; }; + 24A2FFC20F90D1DD003BB5A7 /* vstxsynthproc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstxsynthproc.cpp; sourceTree = ""; }; + 24A2FFC40F90D1DD003BB5A7 /* vstxsynth.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = vstxsynth.vcproj; sourceTree = ""; }; + 24A2FFC60F90D1DD003BB5A7 /* samples.sln */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.sln; sourceTree = ""; }; + 24A2FFC70F90D1DD003BB5A7 /* vstplug.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstplug.def; sourceTree = ""; }; + 24A2FFC90F90D1DD003BB5A7 /* adelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = adelay.vcproj; sourceTree = ""; }; + 24A2FFCA0F90D1DD003BB5A7 /* again.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = again.vcproj; sourceTree = ""; }; + 24A2FFCB0F90D1DD003BB5A7 /* minihost.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = minihost.vcproj; sourceTree = ""; }; + 24A2FFCC0F90D1DD003BB5A7 /* samples.sln */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.sln; sourceTree = ""; }; + 24A2FFCD0F90D1DD003BB5A7 /* surrounddelay.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = surrounddelay.vcproj; sourceTree = ""; }; + 24A2FFCE0F90D1DD003BB5A7 /* vstxsynth.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = vstxsynth.vcproj; sourceTree = ""; }; + 24A2FFD00F90D1DD003BB5A7 /* adelay.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = adelay.dsp; sourceTree = ""; }; + 24A2FFD10F90D1DD003BB5A7 /* again.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = again.dsp; sourceTree = ""; }; + 24A2FFD20F90D1DD003BB5A7 /* minihost.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = minihost.dsp; sourceTree = ""; }; + 24A2FFD30F90D1DD003BB5A7 /* samples.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = samples.dsw; sourceTree = ""; }; + 24A2FFD40F90D1DD003BB5A7 /* surrounddelay.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = surrounddelay.dsp; sourceTree = ""; }; + 24A2FFD50F90D1DD003BB5A7 /* vstxsynth.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vstxsynth.dsp; sourceTree = ""; }; + 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aeffeditor.h; sourceTree = ""; }; + 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioeffect.cpp; sourceTree = ""; }; + 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioeffect.h; sourceTree = ""; }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioeffectx.cpp; sourceTree = ""; }; + 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioeffectx.h; sourceTree = ""; }; + 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vstplugmain.cpp; sourceTree = ""; }; + 24A2FFE10F90D1DD003BB5A7 /* audiounit.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = audiounit.exp; sourceTree = ""; }; + 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "cw_vst_prefix.pch++"; sourceTree = ""; }; + 24A2FFE30F90D1DD003BB5A7 /* drawtest.cw9prj */ = {isa = PBXFileReference; lastKnownFileType = file; path = drawtest.cw9prj; sourceTree = ""; }; + 24A2FFE40F90D1DD003BB5A7 /* drawtest.plc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = drawtest.plc; sourceTree = ""; }; + 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = drawtest.xcode; sourceTree = ""; }; + 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = drawtest.xcodeproj; sourceTree = ""; }; + 24A2FFEB0F90D1DD003BB5A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xcode_au_prefix.h; sourceTree = ""; }; + 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xcode_vst_prefix.h; sourceTree = ""; }; + 24A2FFEF0F90D1DD003BB5A7 /* audiounit.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; path = audiounit.r; sourceTree = ""; }; + 24A2FFF00F90D1DD003BB5A7 /* bmp00001.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp00001.png; sourceTree = ""; }; + 24A2FFF10F90D1DD003BB5A7 /* bmp00100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp00100.png; sourceTree = ""; }; + 24A2FFF20F90D1DD003BB5A7 /* bmp01000.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bmp01000.png; sourceTree = ""; }; + 24A2FFF30F90D1DD003BB5A7 /* bmp10001.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10001.bmp; sourceTree = ""; }; + 24A2FFF40F90D1DD003BB5A7 /* bmp10002.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10002.bmp; sourceTree = ""; }; + 24A2FFF50F90D1DD003BB5A7 /* bmp10003.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10003.bmp; sourceTree = ""; }; + 24A2FFF60F90D1DD003BB5A7 /* bmp10004.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10004.bmp; sourceTree = ""; }; + 24A2FFF70F90D1DD003BB5A7 /* bmp10005.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10005.bmp; sourceTree = ""; }; + 24A2FFF80F90D1DD003BB5A7 /* bmp10006.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10006.bmp; sourceTree = ""; }; + 24A2FFF90F90D1DD003BB5A7 /* bmp10007.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10007.bmp; sourceTree = ""; }; + 24A2FFFA0F90D1DD003BB5A7 /* bmp10008.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10008.bmp; sourceTree = ""; }; + 24A2FFFB0F90D1DD003BB5A7 /* bmp10009.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10009.bmp; sourceTree = ""; }; + 24A2FFFC0F90D1DD003BB5A7 /* bmp10010.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10010.bmp; sourceTree = ""; }; + 24A2FFFD0F90D1DD003BB5A7 /* bmp10011.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10011.bmp; sourceTree = ""; }; + 24A2FFFE0F90D1DD003BB5A7 /* bmp10012.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10012.bmp; sourceTree = ""; }; + 24A2FFFF0F90D1DD003BB5A7 /* bmp10013.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = bmp10013.bmp; sourceTree = ""; }; + 24CFB70307E7A0220081BD57 /* PkgInfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PkgInfo; path = mac/PkgInfo; sourceTree = ""; }; + 24D8286F09A914000093AEF8 /* Isolator2Proc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Isolator2Proc.cpp; path = source/Isolator2Proc.cpp; sourceTree = ""; }; + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = xcode_vst_prefix.h; path = mac/xcode_vst_prefix.h; sourceTree = SOURCE_ROOT; }; + 8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* FM-Chopper */ = { + isa = PBXGroup; + children = ( + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + 089C167CFE841241C02AAC07 /* Resources */, + 08FB77ADFE841716C02AAC07 /* Source */, + 24A2FEBB0F90D1DB003BB5A7 /* vstsdk2.4 */, + ); + name = "FM-Chopper"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 2434720A098313350063BBF1 /* QuickTime.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */, + 24CFB70307E7A0220081BD57 /* PkgInfo */, + 8D01CCD10486CAD60068D4B7 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 2407DEB6089929BA00EB68BF /* Isolator2.cpp */, + 24D8286F09A914000093AEF8 /* Isolator2Proc.cpp */, + 245463B80991757100464AD3 /* Isolator2.h */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2407DE920899296600EB68BF /* Isolator2.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A200030F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A200040F90D1DD003BB5A7 /* controlsgui.cpp */, + 24A200050F90D1DD003BB5A7 /* controlsgui.h */, + 24A200060F90D1DD003BB5A7 /* pdrawtesteditor.cpp */, + 24A200070F90D1DD003BB5A7 /* pdrawtesteditor.h */, + 24A200080F90D1DD003BB5A7 /* pdrawtesteffect.cpp */, + 24A200090F90D1DD003BB5A7 /* pdrawtesteffect.h */, + 24A2000A0F90D1DD003BB5A7 /* pdrawtestmain.cpp */, + 24A2000B0F90D1DD003BB5A7 /* pdrawtestview.cpp */, + 24A2000C0F90D1DD003BB5A7 /* pdrawtestview.h */, + 24A2000D0F90D1DD003BB5A7 /* pprimitivesviews.cpp */, + 24A2000E0F90D1DD003BB5A7 /* pprimitivesviews.h */, + ); + name = source; + path = /vstsdk2.4/vstgui.sf/drawtest/source; + sourceTree = ""; + }; + 24A2000F0F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A200100F90D1DD003BB5A7 /* drawtest.def */, + 24A200110F90D1DD003BB5A7 /* drawtest.rc */, + 24A200120F90D1DD003BB5A7 /* drawtest.vcproj */, + ); + name = win; + path = /vstsdk2.4/vstgui.sf/drawtest/win; + sourceTree = ""; + }; + 24A200130F90D1DD003BB5A7 /* win.vc6 */ = { + isa = PBXGroup; + children = ( + 24A200140F90D1DD003BB5A7 /* drawtest.dsp */, + 24A200150F90D1DD003BB5A7 /* drawtest.dsw */, + ); + name = win.vc6; + path = /vstsdk2.4/vstgui.sf/drawtest/win.vc6; + sourceTree = ""; + }; + 24A200160F90D1DD003BB5A7 /* vstgui */ = { + isa = PBXGroup; + children = ( + 24A200170F90D1DD003BB5A7 /* aeffguieditor.cpp */, + 24A200180F90D1DD003BB5A7 /* aeffguieditor.h */, + 24A200190F90D1DD003BB5A7 /* cfileselector.cpp */, + 24A2001A0F90D1DD003BB5A7 /* cfileselector.h */, + 24A2001B0F90D1DD003BB5A7 /* Changelog */, + 24A2001C0F90D1DD003BB5A7 /* cscrollview.cpp */, + 24A2001D0F90D1DD003BB5A7 /* cscrollview.h */, + 24A2001E0F90D1DD003BB5A7 /* ctabview.cpp */, + 24A2001F0F90D1DD003BB5A7 /* ctabview.h */, + 24A200200F90D1DD003BB5A7 /* Documentation */, + 24A201460F90D1DE003BB5A7 /* plugguieditor.cpp */, + 24A201470F90D1DE003BB5A7 /* plugguieditor.h */, + 24A201480F90D1DE003BB5A7 /* vstcontrols.cpp */, + 24A201490F90D1DE003BB5A7 /* vstcontrols.h */, + 24A2014A0F90D1DE003BB5A7 /* vstgui.cpp */, + 24A2014B0F90D1DE003BB5A7 /* vstgui.h */, + 24A2014C0F90D1DE003BB5A7 /* vstkeycode.h */, + 24A2014D0F90D1DE003BB5A7 /* vstplugscarbon.h */, + 24A2014E0F90D1DE003BB5A7 /* vstplugsmac.h */, + 24A2014F0F90D1DE003BB5A7 /* vstplugsmacho.h */, + 24A201500F90D1DE003BB5A7 /* vstplugsquartz.h */, + ); + name = vstgui; + path = /vstsdk2.4/vstgui.sf/vstgui; + sourceTree = ""; + }; + 24A200200F90D1DD003BB5A7 /* Documentation */ = { + isa = PBXGroup; + children = ( + 24A200210F90D1DD003BB5A7 /* html */, + 24A201440F90D1DE003BB5A7 /* index.html */, + 24A201450F90D1DE003BB5A7 /* Migrating from 2.3.rtf */, + ); + name = Documentation; + path = /vstsdk2.4/vstgui.sf/vstgui/Documentation; + sourceTree = ""; + }; + 24A200210F90D1DD003BB5A7 /* html */ = { + isa = PBXGroup; + children = ( + 24A200220F90D1DD003BB5A7 /* aeffguieditor_8cpp.html */, + 24A200230F90D1DD003BB5A7 /* aeffguieditor_8h.html */, + 24A200240F90D1DD003BB5A7 /* annotated.html */, + 24A200250F90D1DD003BB5A7 /* cfileselector_8cpp.html */, + 24A200260F90D1DD003BB5A7 /* cfileselector_8h.html */, + 24A200270F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor-members.html */, + 24A200280F90D1DD003BB5A7 /* class_a_eff_g_u_i_editor.html */, + 24A200290F90D1DD003BB5A7 /* class_c_anim_knob-members.html */, + 24A2002A0F90D1DD003BB5A7 /* class_c_anim_knob.html */, + 24A2002B0F90D1DD003BB5A7 /* class_c_anim_knob.png */, + 24A2002C0F90D1DD003BB5A7 /* class_c_attribute_list_entry-members.html */, + 24A2002D0F90D1DD003BB5A7 /* class_c_attribute_list_entry.html */, + 24A2002E0F90D1DD003BB5A7 /* class_c_auto_animation-members.html */, + 24A2002F0F90D1DD003BB5A7 /* class_c_auto_animation.html */, + 24A200300F90D1DD003BB5A7 /* class_c_auto_animation.png */, + 24A200310F90D1DD003BB5A7 /* class_c_bitmap-members.html */, + 24A200320F90D1DD003BB5A7 /* class_c_bitmap.html */, + 24A200330F90D1DD003BB5A7 /* class_c_bitmap.png */, + 24A200340F90D1DD003BB5A7 /* class_c_c_view-members.html */, + 24A200350F90D1DD003BB5A7 /* class_c_c_view.html */, + 24A200360F90D1DD003BB5A7 /* class_c_control-members.html */, + 24A200370F90D1DD003BB5A7 /* class_c_control.html */, + 24A200380F90D1DD003BB5A7 /* class_c_control.png */, + 24A200390F90D1DD003BB5A7 /* class_c_control_listener-members.html */, + 24A2003A0F90D1DD003BB5A7 /* class_c_control_listener.html */, + 24A2003B0F90D1DD003BB5A7 /* class_c_control_listener.png */, + 24A2003C0F90D1DD003BB5A7 /* class_c_drag_container-members.html */, + 24A2003D0F90D1DD003BB5A7 /* class_c_drag_container.html */, + 24A2003E0F90D1DD003BB5A7 /* class_c_drag_container.png */, + 24A2003F0F90D1DD003BB5A7 /* class_c_draw_context-members.html */, + 24A200400F90D1DD003BB5A7 /* class_c_draw_context.html */, + 24A200410F90D1DD003BB5A7 /* class_c_draw_context.png */, + 24A200420F90D1DD003BB5A7 /* class_c_file_selector-members.html */, + 24A200430F90D1DD003BB5A7 /* class_c_file_selector.html */, + 24A200440F90D1DD003BB5A7 /* class_c_frame-members.html */, + 24A200450F90D1DD003BB5A7 /* class_c_frame.html */, + 24A200460F90D1DD003BB5A7 /* class_c_frame.png */, + 24A200470F90D1DD003BB5A7 /* class_c_horizontal_slider-members.html */, + 24A200480F90D1DD003BB5A7 /* class_c_horizontal_slider.html */, + 24A200490F90D1DD003BB5A7 /* class_c_horizontal_slider.png */, + 24A2004A0F90D1DD003BB5A7 /* class_c_horizontal_switch-members.html */, + 24A2004B0F90D1DD003BB5A7 /* class_c_horizontal_switch.html */, + 24A2004C0F90D1DD003BB5A7 /* class_c_horizontal_switch.png */, + 24A2004D0F90D1DD003BB5A7 /* class_c_kick_button-members.html */, + 24A2004E0F90D1DD003BB5A7 /* class_c_kick_button.html */, + 24A2004F0F90D1DD003BB5A7 /* class_c_kick_button.png */, + 24A200500F90D1DD003BB5A7 /* class_c_knob-members.html */, + 24A200510F90D1DD003BB5A7 /* class_c_knob.html */, + 24A200520F90D1DD003BB5A7 /* class_c_knob.png */, + 24A200530F90D1DD003BB5A7 /* class_c_movie_bitmap-members.html */, + 24A200540F90D1DD003BB5A7 /* class_c_movie_bitmap.html */, + 24A200550F90D1DD003BB5A7 /* class_c_movie_bitmap.png */, + 24A200560F90D1DD003BB5A7 /* class_c_movie_button-members.html */, + 24A200570F90D1DD003BB5A7 /* class_c_movie_button.html */, + 24A200580F90D1DD003BB5A7 /* class_c_movie_button.png */, + 24A200590F90D1DD003BB5A7 /* class_c_offscreen_context-members.html */, + 24A2005A0F90D1DD003BB5A7 /* class_c_offscreen_context.html */, + 24A2005B0F90D1DD003BB5A7 /* class_c_offscreen_context.png */, + 24A2005C0F90D1DD003BB5A7 /* class_c_on_off_button-members.html */, + 24A2005D0F90D1DD003BB5A7 /* class_c_on_off_button.html */, + 24A2005E0F90D1DD003BB5A7 /* class_c_on_off_button.png */, + 24A2005F0F90D1DD003BB5A7 /* class_c_option_menu-members.html */, + 24A200600F90D1DD003BB5A7 /* class_c_option_menu.html */, + 24A200610F90D1DD003BB5A7 /* class_c_option_menu.png */, + 24A200620F90D1DD003BB5A7 /* class_c_option_menu_scheme-members.html */, + 24A200630F90D1DD003BB5A7 /* class_c_option_menu_scheme.html */, + 24A200640F90D1DD003BB5A7 /* class_c_option_menu_scheme.png */, + 24A200650F90D1DD003BB5A7 /* class_c_param_display-members.html */, + 24A200660F90D1DD003BB5A7 /* class_c_param_display.html */, + 24A200670F90D1DD003BB5A7 /* class_c_param_display.png */, + 24A200680F90D1DD003BB5A7 /* class_c_reference_counter-members.html */, + 24A200690F90D1DD003BB5A7 /* class_c_reference_counter.html */, + 24A2006A0F90D1DD003BB5A7 /* class_c_reference_counter.png */, + 24A2006B0F90D1DD003BB5A7 /* class_c_rocker_switch-members.html */, + 24A2006C0F90D1DD003BB5A7 /* class_c_rocker_switch.html */, + 24A2006D0F90D1DD003BB5A7 /* class_c_rocker_switch.png */, + 24A2006E0F90D1DD003BB5A7 /* class_c_scroll_container-members.html */, + 24A2006F0F90D1DD003BB5A7 /* class_c_scroll_container.html */, + 24A200700F90D1DD003BB5A7 /* class_c_scroll_container.png */, + 24A200710F90D1DD003BB5A7 /* class_c_scroll_view-members.html */, + 24A200720F90D1DD003BB5A7 /* class_c_scroll_view.html */, + 24A200730F90D1DD003BB5A7 /* class_c_scroll_view.png */, + 24A200740F90D1DD003BB5A7 /* class_c_scrollbar-members.html */, + 24A200750F90D1DD003BB5A7 /* class_c_scrollbar.html */, + 24A200760F90D1DD003BB5A7 /* class_c_scrollbar.png */, + 24A200770F90D1DD003BB5A7 /* class_c_slider-members.html */, + 24A200780F90D1DD003BB5A7 /* class_c_slider.html */, + 24A200790F90D1DD003BB5A7 /* class_c_slider.png */, + 24A2007A0F90D1DD003BB5A7 /* class_c_special_digit-members.html */, + 24A2007B0F90D1DD003BB5A7 /* class_c_special_digit.html */, + 24A2007C0F90D1DD003BB5A7 /* class_c_special_digit.png */, + 24A2007D0F90D1DD003BB5A7 /* class_c_splash_screen-members.html */, + 24A2007E0F90D1DD003BB5A7 /* class_c_splash_screen.html */, + 24A2007F0F90D1DD003BB5A7 /* class_c_splash_screen.png */, + 24A200800F90D1DD003BB5A7 /* class_c_splash_screen_view-members.html */, + 24A200810F90D1DD003BB5A7 /* class_c_splash_screen_view.html */, + 24A200820F90D1DD003BB5A7 /* class_c_splash_screen_view.png */, + 24A200830F90D1DD003BB5A7 /* class_c_tab_button-members.html */, + 24A200840F90D1DD003BB5A7 /* class_c_tab_button.html */, + 24A200850F90D1DD003BB5A7 /* class_c_tab_button.png */, + 24A200860F90D1DD003BB5A7 /* class_c_tab_child_view-members.html */, + 24A200870F90D1DD003BB5A7 /* class_c_tab_child_view.html */, + 24A200880F90D1DD003BB5A7 /* class_c_tab_child_view.png */, + 24A200890F90D1DD003BB5A7 /* class_c_tab_view-members.html */, + 24A2008A0F90D1DD003BB5A7 /* class_c_tab_view.html */, + 24A2008B0F90D1DD003BB5A7 /* class_c_tab_view.png */, + 24A2008C0F90D1DD003BB5A7 /* class_c_text_edit-members.html */, + 24A2008D0F90D1DD003BB5A7 /* class_c_text_edit.html */, + 24A2008E0F90D1DD003BB5A7 /* class_c_text_edit.png */, + 24A2008F0F90D1DD003BB5A7 /* class_c_text_label-members.html */, + 24A200900F90D1DD003BB5A7 /* class_c_text_label.html */, + 24A200910F90D1DD003BB5A7 /* class_c_text_label.png */, + 24A200920F90D1DD003BB5A7 /* class_c_vertical_slider-members.html */, + 24A200930F90D1DD003BB5A7 /* class_c_vertical_slider.html */, + 24A200940F90D1DD003BB5A7 /* class_c_vertical_slider.png */, + 24A200950F90D1DD003BB5A7 /* class_c_vertical_switch-members.html */, + 24A200960F90D1DD003BB5A7 /* class_c_vertical_switch.html */, + 24A200970F90D1DD003BB5A7 /* class_c_vertical_switch.png */, + 24A200980F90D1DD003BB5A7 /* class_c_view-members.html */, + 24A200990F90D1DD003BB5A7 /* class_c_view.html */, + 24A2009A0F90D1DD003BB5A7 /* class_c_view.png */, + 24A2009B0F90D1DD003BB5A7 /* class_c_view_container-members.html */, + 24A2009C0F90D1DD003BB5A7 /* class_c_view_container.html */, + 24A2009D0F90D1DD003BB5A7 /* class_c_view_container.png */, + 24A2009E0F90D1DD003BB5A7 /* class_c_vu_meter-members.html */, + 24A2009F0F90D1DD003BB5A7 /* class_c_vu_meter.html */, + 24A200A00F90D1DD003BB5A7 /* class_c_vu_meter.png */, + 24A200A10F90D1DD003BB5A7 /* class_i_scrollbar_drawer-members.html */, + 24A200A20F90D1DD003BB5A7 /* class_i_scrollbar_drawer.html */, + 24A200A30F90D1DD003BB5A7 /* class_plugin_g_u_i_editor-members.html */, + 24A200A40F90D1DD003BB5A7 /* class_plugin_g_u_i_editor.html */, + 24A200A50F90D1DD003BB5A7 /* cscrollview_8cpp.html */, + 24A200A60F90D1DD003BB5A7 /* cscrollview_8h.html */, + 24A200A70F90D1DD003BB5A7 /* ctabview_8cpp.html */, + 24A200A80F90D1DD003BB5A7 /* ctabview_8h.html */, + 24A200A90F90D1DD003BB5A7 /* deprecated.html */, + 24A200AA0F90D1DD003BB5A7 /* doc_8h.html */, + 24A200AB0F90D1DD003BB5A7 /* doxygen.css */, + 24A200AC0F90D1DD003BB5A7 /* doxygen.png */, + 24A200AD0F90D1DD003BB5A7 /* files.html */, + 24A200AE0F90D1DD003BB5A7 /* ftv2blank.png */, + 24A200AF0F90D1DD003BB5A7 /* ftv2doc.png */, + 24A200B00F90D1DD003BB5A7 /* ftv2folderclosed.png */, + 24A200B10F90D1DE003BB5A7 /* ftv2folderopen.png */, + 24A200B20F90D1DE003BB5A7 /* ftv2lastnode.png */, + 24A200B30F90D1DE003BB5A7 /* ftv2link.png */, + 24A200B40F90D1DE003BB5A7 /* ftv2mlastnode.png */, + 24A200B50F90D1DE003BB5A7 /* ftv2mnode.png */, + 24A200B60F90D1DE003BB5A7 /* ftv2node.png */, + 24A200B70F90D1DE003BB5A7 /* ftv2plastnode.png */, + 24A200B80F90D1DE003BB5A7 /* ftv2pnode.png */, + 24A200B90F90D1DE003BB5A7 /* ftv2vertline.png */, + 24A200BA0F90D1DE003BB5A7 /* functions.html */, + 24A200BB0F90D1DE003BB5A7 /* functions_0x62.html */, + 24A200BC0F90D1DE003BB5A7 /* functions_0x63.html */, + 24A200BD0F90D1DE003BB5A7 /* functions_0x64.html */, + 24A200BE0F90D1DE003BB5A7 /* functions_0x65.html */, + 24A200BF0F90D1DE003BB5A7 /* functions_0x66.html */, + 24A200C00F90D1DE003BB5A7 /* functions_0x67.html */, + 24A200C10F90D1DE003BB5A7 /* functions_0x68.html */, + 24A200C20F90D1DE003BB5A7 /* functions_0x69.html */, + 24A200C30F90D1DE003BB5A7 /* functions_0x6b.html */, + 24A200C40F90D1DE003BB5A7 /* functions_0x6c.html */, + 24A200C50F90D1DE003BB5A7 /* functions_0x6d.html */, + 24A200C60F90D1DE003BB5A7 /* functions_0x6e.html */, + 24A200C70F90D1DE003BB5A7 /* functions_0x6f.html */, + 24A200C80F90D1DE003BB5A7 /* functions_0x70.html */, + 24A200C90F90D1DE003BB5A7 /* functions_0x72.html */, + 24A200CA0F90D1DE003BB5A7 /* functions_0x73.html */, + 24A200CB0F90D1DE003BB5A7 /* functions_0x74.html */, + 24A200CC0F90D1DE003BB5A7 /* functions_0x75.html */, + 24A200CD0F90D1DE003BB5A7 /* functions_0x76.html */, + 24A200CE0F90D1DE003BB5A7 /* functions_0x77.html */, + 24A200CF0F90D1DE003BB5A7 /* functions_0x78.html */, + 24A200D00F90D1DE003BB5A7 /* functions_0x79.html */, + 24A200D10F90D1DE003BB5A7 /* functions_0x7a.html */, + 24A200D20F90D1DE003BB5A7 /* functions_0x7e.html */, + 24A200D30F90D1DE003BB5A7 /* functions_eval.html */, + 24A200D40F90D1DE003BB5A7 /* functions_func.html */, + 24A200D50F90D1DE003BB5A7 /* functions_func_0x62.html */, + 24A200D60F90D1DE003BB5A7 /* functions_func_0x63.html */, + 24A200D70F90D1DE003BB5A7 /* functions_func_0x64.html */, + 24A200D80F90D1DE003BB5A7 /* functions_func_0x65.html */, + 24A200D90F90D1DE003BB5A7 /* functions_func_0x66.html */, + 24A200DA0F90D1DE003BB5A7 /* functions_func_0x67.html */, + 24A200DB0F90D1DE003BB5A7 /* functions_func_0x68.html */, + 24A200DC0F90D1DE003BB5A7 /* functions_func_0x69.html */, + 24A200DD0F90D1DE003BB5A7 /* functions_func_0x6c.html */, + 24A200DE0F90D1DE003BB5A7 /* functions_func_0x6d.html */, + 24A200DF0F90D1DE003BB5A7 /* functions_func_0x6e.html */, + 24A200E00F90D1DE003BB5A7 /* functions_func_0x6f.html */, + 24A200E10F90D1DE003BB5A7 /* functions_func_0x70.html */, + 24A200E20F90D1DE003BB5A7 /* functions_func_0x72.html */, + 24A200E30F90D1DE003BB5A7 /* functions_func_0x73.html */, + 24A200E40F90D1DE003BB5A7 /* functions_func_0x74.html */, + 24A200E50F90D1DE003BB5A7 /* functions_func_0x75.html */, + 24A200E60F90D1DE003BB5A7 /* functions_func_0x76.html */, + 24A200E70F90D1DE003BB5A7 /* functions_func_0x77.html */, + 24A200E80F90D1DE003BB5A7 /* functions_func_0x7e.html */, + 24A200E90F90D1DE003BB5A7 /* functions_rela.html */, + 24A200EA0F90D1DE003BB5A7 /* functions_vars.html */, + 24A200EB0F90D1DE003BB5A7 /* functions_vars_0x62.html */, + 24A200EC0F90D1DE003BB5A7 /* functions_vars_0x63.html */, + 24A200ED0F90D1DE003BB5A7 /* functions_vars_0x64.html */, + 24A200EE0F90D1DE003BB5A7 /* functions_vars_0x65.html */, + 24A200EF0F90D1DE003BB5A7 /* functions_vars_0x66.html */, + 24A200F00F90D1DE003BB5A7 /* functions_vars_0x67.html */, + 24A200F10F90D1DE003BB5A7 /* functions_vars_0x68.html */, + 24A200F20F90D1DE003BB5A7 /* functions_vars_0x69.html */, + 24A200F30F90D1DE003BB5A7 /* functions_vars_0x6b.html */, + 24A200F40F90D1DE003BB5A7 /* functions_vars_0x6c.html */, + 24A200F50F90D1DE003BB5A7 /* functions_vars_0x6d.html */, + 24A200F60F90D1DE003BB5A7 /* functions_vars_0x6e.html */, + 24A200F70F90D1DE003BB5A7 /* functions_vars_0x6f.html */, + 24A200F80F90D1DE003BB5A7 /* functions_vars_0x70.html */, + 24A200F90F90D1DE003BB5A7 /* functions_vars_0x72.html */, + 24A200FA0F90D1DE003BB5A7 /* functions_vars_0x73.html */, + 24A200FB0F90D1DE003BB5A7 /* functions_vars_0x74.html */, + 24A200FC0F90D1DE003BB5A7 /* functions_vars_0x75.html */, + 24A200FD0F90D1DE003BB5A7 /* functions_vars_0x76.html */, + 24A200FE0F90D1DE003BB5A7 /* functions_vars_0x77.html */, + 24A200FF0F90D1DE003BB5A7 /* functions_vars_0x78.html */, + 24A201000F90D1DE003BB5A7 /* functions_vars_0x79.html */, + 24A201010F90D1DE003BB5A7 /* functions_vars_0x7a.html */, + 24A201020F90D1DE003BB5A7 /* globals.html */, + 24A201030F90D1DE003BB5A7 /* globals_0x61.html */, + 24A201040F90D1DE003BB5A7 /* globals_0x62.html */, + 24A201050F90D1DE003BB5A7 /* globals_0x63.html */, + 24A201060F90D1DE003BB5A7 /* globals_0x65.html */, + 24A201070F90D1DE003BB5A7 /* globals_0x66.html */, + 24A201080F90D1DE003BB5A7 /* globals_0x67.html */, + 24A201090F90D1DE003BB5A7 /* globals_0x6b.html */, + 24A2010A0F90D1DE003BB5A7 /* globals_0x6d.html */, + 24A2010B0F90D1DE003BB5A7 /* globals_0x6e.html */, + 24A2010C0F90D1DE003BB5A7 /* globals_0x6f.html */, + 24A2010D0F90D1DE003BB5A7 /* globals_0x71.html */, + 24A2010E0F90D1DE003BB5A7 /* globals_0x72.html */, + 24A2010F0F90D1DE003BB5A7 /* globals_0x73.html */, + 24A201100F90D1DE003BB5A7 /* globals_0x74.html */, + 24A201110F90D1DE003BB5A7 /* globals_0x75.html */, + 24A201120F90D1DE003BB5A7 /* globals_0x76.html */, + 24A201130F90D1DE003BB5A7 /* globals_0x77.html */, + 24A201140F90D1DE003BB5A7 /* globals_defs.html */, + 24A201150F90D1DE003BB5A7 /* globals_enum.html */, + 24A201160F90D1DE003BB5A7 /* globals_eval.html */, + 24A201170F90D1DE003BB5A7 /* globals_type.html */, + 24A201180F90D1DE003BB5A7 /* globals_vars.html */, + 24A201190F90D1DE003BB5A7 /* hierarchy.html */, + 24A2011A0F90D1DE003BB5A7 /* index.html */, + 24A2011B0F90D1DE003BB5A7 /* intro.html */, + 24A2011C0F90D1DE003BB5A7 /* license.html */, + 24A2011D0F90D1DE003BB5A7 /* maceditor.html */, + 24A2011E0F90D1DE003BB5A7 /* main.html */, + 24A2011F0F90D1DE003BB5A7 /* others.html */, + 24A201200F90D1DE003BB5A7 /* pages.html */, + 24A201210F90D1DE003BB5A7 /* plugguieditor_8cpp.html */, + 24A201220F90D1DE003BB5A7 /* plugguieditor_8h.html */, + 24A201230F90D1DE003BB5A7 /* sequences.html */, + 24A201240F90D1DE003BB5A7 /* struct_c_color-members.html */, + 24A201250F90D1DE003BB5A7 /* struct_c_color.html */, + 24A201260F90D1DE003BB5A7 /* struct_c_point-members.html */, + 24A201270F90D1DE003BB5A7 /* struct_c_point.html */, + 24A201280F90D1DE003BB5A7 /* struct_c_rect-members.html */, + 24A201290F90D1DE003BB5A7 /* struct_c_rect.html */, + 24A2012A0F90D1DE003BB5A7 /* struct_e_rect-members.html */, + 24A2012B0F90D1DE003BB5A7 /* struct_e_rect.html */, + 24A2012C0F90D1DE003BB5A7 /* struct_vst_file_select-members.html */, + 24A2012D0F90D1DE003BB5A7 /* struct_vst_file_select.html */, + 24A2012E0F90D1DE003BB5A7 /* struct_vst_file_type-members.html */, + 24A2012F0F90D1DE003BB5A7 /* struct_vst_file_type.html */, + 24A201300F90D1DE003BB5A7 /* struct_vst_key_code-members.html */, + 24A201310F90D1DE003BB5A7 /* struct_vst_key_code.html */, + 24A201320F90D1DE003BB5A7 /* tab_b.gif */, + 24A201330F90D1DE003BB5A7 /* tab_l.gif */, + 24A201340F90D1DE003BB5A7 /* tab_r.gif */, + 24A201350F90D1DE003BB5A7 /* tabs.css */, + 24A201360F90D1DE003BB5A7 /* thanks.html */, + 24A201370F90D1DE003BB5A7 /* tree.html */, + 24A201380F90D1DE003BB5A7 /* vstcontrols_8cpp.html */, + 24A201390F90D1DE003BB5A7 /* vstcontrols_8h.html */, + 24A2013A0F90D1DE003BB5A7 /* vstgui_8cpp.html */, + 24A2013B0F90D1DE003BB5A7 /* vstgui_8h.html */, + 24A2013C0F90D1DE003BB5A7 /* vstkeycode_8h.html */, + 24A2013D0F90D1DE003BB5A7 /* vstoffline.html */, + 24A2013E0F90D1DE003BB5A7 /* vstparamstruct.html */, + 24A2013F0F90D1DE003BB5A7 /* vstplugscarbon_8h.html */, + 24A201400F90D1DE003BB5A7 /* vstplugsmac_8h.html */, + 24A201410F90D1DE003BB5A7 /* vstplugsmacho_8h.html */, + 24A201420F90D1DE003BB5A7 /* vstplugsquartz_8h.html */, + 24A201430F90D1DE003BB5A7 /* whatsnew.html */, + ); + name = html; + path = /vstsdk2.4/vstgui.sf/vstgui/Documentation/html; + sourceTree = ""; + }; + 24A203CE0F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203D70F90D272003BB5A7 /* again.vst */, + 24A203D90F90D272003BB5A7 /* adelay.vst */, + 24A203DB0F90D272003BB5A7 /* vstxsynth.vst */, + 24A203DD0F90D272003BB5A7 /* surrounddelay.vst */, + 24A203DF0F90D272003BB5A7 /* minihost.app */, + ); + name = Products; + sourceTree = ""; + }; + 24A203E00F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203E50F90D272003BB5A7 /* drawtest.component */, + 24A203E70F90D272003BB5A7 /* drawtest.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A203E80F90D272003BB5A7 /* Products */ = { + isa = PBXGroup; + children = ( + 24A203ED0F90D272003BB5A7 /* drawtest.component */, + 24A203EF0F90D272003BB5A7 /* drawtest.vst */, + ); + name = Products; + sourceTree = ""; + }; + 24A2FEBB0F90D1DB003BB5A7 /* vstsdk2.4 */ = { + isa = PBXGroup; + children = ( + 24A2FEBC0F90D1DC003BB5A7 /* artwork */, + 24A2FEC20F90D1DC003BB5A7 /* bin */, + 24A2FED80F90D1DC003BB5A7 /* doc */, + 24A2FF8E0F90D1DD003BB5A7 /* index.html */, + 24A2FF8F0F90D1DD003BB5A7 /* pluginterfaces */, + 24A2FF940F90D1DD003BB5A7 /* public.sdk */, + 24A2FFDE0F90D1DD003BB5A7 /* vstgui.sf */, + ); + name = vstsdk2.4; + path = /vstsdk2.4; + sourceTree = ""; + }; + 24A2FEBC0F90D1DC003BB5A7 /* artwork */ = { + isa = PBXGroup; + children = ( + 24A2FEBD0F90D1DC003BB5A7 /* Thumbs.db */, + 24A2FEBE0F90D1DC003BB5A7 /* VST_Logo_Usage_Guideline.pdf */, + 24A2FEBF0F90D1DC003BB5A7 /* VSTLogoAlpha.png */, + 24A2FEC00F90D1DC003BB5A7 /* VSTLogoBlack.jpg */, + 24A2FEC10F90D1DC003BB5A7 /* VSTLogoWhite.jpg */, + ); + name = artwork; + path = /vstsdk2.4/artwork; + sourceTree = ""; + }; + 24A2FEC20F90D1DC003BB5A7 /* bin */ = { + isa = PBXGroup; + children = ( + 24A2FEC30F90D1DC003BB5A7 /* mac */, + 24A2FED50F90D1DC003BB5A7 /* win */, + ); + name = bin; + path = /vstsdk2.4/bin; + sourceTree = ""; + }; + 24A2FEC30F90D1DC003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FEC40F90D1DC003BB5A7 /* VSTMonitor.vst */, + 24A2FED40F90D1DC003BB5A7 /* VSTParamTool.app */, + ); + name = mac; + path = /vstsdk2.4/bin/mac; + sourceTree = ""; + }; + 24A2FEC40F90D1DC003BB5A7 /* VSTMonitor.vst */ = { + isa = PBXGroup; + children = ( + 24A2FEC50F90D1DC003BB5A7 /* Contents */, + ); + name = VSTMonitor.vst; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst; + sourceTree = ""; + }; + 24A2FEC50F90D1DC003BB5A7 /* Contents */ = { + isa = PBXGroup; + children = ( + 24A2FEC60F90D1DC003BB5A7 /* Info.plist */, + 24A2FEC70F90D1DC003BB5A7 /* MacOS */, + 24A2FEC90F90D1DC003BB5A7 /* PkgInfo */, + 24A2FECA0F90D1DC003BB5A7 /* Resources */, + ); + name = Contents; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents; + sourceTree = ""; + }; + 24A2FEC70F90D1DC003BB5A7 /* MacOS */ = { + isa = PBXGroup; + children = ( + 24A2FEC80F90D1DC003BB5A7 /* VSTMonitor */, + ); + name = MacOS; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents/MacOS; + sourceTree = ""; + }; + 24A2FECA0F90D1DC003BB5A7 /* Resources */ = { + isa = PBXGroup; + children = ( + 24A2FECB0F90D1DC003BB5A7 /* bmp50000.bmp */, + 24A2FECC0F90D1DC003BB5A7 /* bmp50001.bmp */, + 24A2FECD0F90D1DC003BB5A7 /* bmp50002.bmp */, + 24A2FECE0F90D1DC003BB5A7 /* bmp50003.bmp */, + 24A2FECF0F90D1DC003BB5A7 /* bmp50004.bmp */, + 24A2FED00F90D1DC003BB5A7 /* bmp50005.bmp */, + 24A2FED10F90D1DC003BB5A7 /* bmp50006.bmp */, + 24A2FED20F90D1DC003BB5A7 /* bmp50007.bmp */, + 24A2FED30F90D1DC003BB5A7 /* bmp50008.bmp */, + ); + name = Resources; + path = /vstsdk2.4/bin/mac/VSTMonitor.vst/Contents/Resources; + sourceTree = ""; + }; + 24A2FED50F90D1DC003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FED60F90D1DC003BB5A7 /* vstmonitor.dll */, + 24A2FED70F90D1DC003BB5A7 /* vstparamtool.exe */, + ); + name = win; + path = /vstsdk2.4/bin/win; + sourceTree = ""; + }; + 24A2FED80F90D1DC003BB5A7 /* doc */ = { + isa = PBXGroup; + children = ( + 24A2FED90F90D1DC003BB5A7 /* gfx */, + 24A2FEDE0F90D1DC003BB5A7 /* html */, + 24A2FF8A0F90D1DD003BB5A7 /* sdk.menu.html */, + 24A2FF8B0F90D1DD003BB5A7 /* sdk.overview.html */, + 24A2FF8C0F90D1DD003BB5A7 /* sdkdoc.css */, + 24A2FF8D0F90D1DD003BB5A7 /* VST Licensing Agreement.rtf */, + ); + name = doc; + path = /vstsdk2.4/doc; + sourceTree = ""; + }; + 24A2FED90F90D1DC003BB5A7 /* gfx */ = { + isa = PBXGroup; + children = ( + 24A2FEDA0F90D1DC003BB5A7 /* folder.gif */, + 24A2FEDB0F90D1DC003BB5A7 /* mac.gif */, + 24A2FEDC0F90D1DC003BB5A7 /* vstpluglogo_small.jpg */, + 24A2FEDD0F90D1DC003BB5A7 /* win.gif */, + ); + name = gfx; + path = /vstsdk2.4/doc/gfx; + sourceTree = ""; + }; + 24A2FEDE0F90D1DC003BB5A7 /* html */ = { + isa = PBXGroup; + children = ( + 24A2FEDF0F90D1DC003BB5A7 /* aeffect_8h.html */, + 24A2FEE00F90D1DC003BB5A7 /* aeffectx_8h.html */, + 24A2FEE10F90D1DC003BB5A7 /* aeffeditor_8h.html */, + 24A2FEE20F90D1DC003BB5A7 /* annotated.html */, + 24A2FEE30F90D1DC003BB5A7 /* audioeffect_8cpp.html */, + 24A2FEE40F90D1DC003BB5A7 /* audioeffect_8h.html */, + 24A2FEE50F90D1DC003BB5A7 /* audioeffectx_8cpp.html */, + 24A2FEE60F90D1DC003BB5A7 /* audioeffectx_8h.html */, + 24A2FEE70F90D1DC003BB5A7 /* Blocksizechange.gif */, + 24A2FEE80F90D1DC003BB5A7 /* class_a_eff_editor-members.html */, + 24A2FEE90F90D1DC003BB5A7 /* class_a_eff_editor.html */, + 24A2FEEA0F90D1DC003BB5A7 /* class_audio_effect-members.html */, + 24A2FEEB0F90D1DC003BB5A7 /* class_audio_effect.html */, + 24A2FEEC0F90D1DC003BB5A7 /* class_audio_effect.png */, + 24A2FEED0F90D1DC003BB5A7 /* class_audio_effect_x-members.html */, + 24A2FEEE0F90D1DC003BB5A7 /* class_audio_effect_x.html */, + 24A2FEEF0F90D1DC003BB5A7 /* class_audio_effect_x.png */, + 24A2FEF00F90D1DC003BB5A7 /* ControlChanged.gif */, + 24A2FEF10F90D1DC003BB5A7 /* deprecated.html */, + 24A2FEF20F90D1DC003BB5A7 /* dir_2d3252dd12c84c66c1d25b26bb45a1f5.html */, + 24A2FEF30F90D1DC003BB5A7 /* dir_77c628dfee72e555f82d5ef53b733f38.html */, + 24A2FEF40F90D1DC003BB5A7 /* dir_f81105d3b854bea570aaf3bae5cb64c1.html */, + 24A2FEF50F90D1DC003BB5A7 /* dir_fa0454ab79b4262333bf837ea3d765e9.html */, + 24A2FEF60F90D1DC003BB5A7 /* dirs.html */, + 24A2FEF70F90D1DC003BB5A7 /* doc_8h.html */, + 24A2FEF80F90D1DC003BB5A7 /* doxygen.css */, + 24A2FEF90F90D1DC003BB5A7 /* doxygen.png */, + 24A2FEFA0F90D1DC003BB5A7 /* files.html */, + 24A2FEFB0F90D1DC003BB5A7 /* ftv2blank.png */, + 24A2FEFC0F90D1DC003BB5A7 /* ftv2doc.png */, + 24A2FEFD0F90D1DC003BB5A7 /* ftv2folderclosed.png */, + 24A2FEFE0F90D1DC003BB5A7 /* ftv2folderopen.png */, + 24A2FEFF0F90D1DC003BB5A7 /* ftv2lastnode.png */, + 24A2FF000F90D1DC003BB5A7 /* ftv2link.png */, + 24A2FF010F90D1DC003BB5A7 /* ftv2mlastnode.png */, + 24A2FF020F90D1DC003BB5A7 /* ftv2mnode.png */, + 24A2FF030F90D1DC003BB5A7 /* ftv2node.png */, + 24A2FF040F90D1DC003BB5A7 /* ftv2plastnode.png */, + 24A2FF050F90D1DC003BB5A7 /* ftv2pnode.png */, + 24A2FF060F90D1DC003BB5A7 /* ftv2vertline.png */, + 24A2FF070F90D1DC003BB5A7 /* functions.html */, + 24A2FF080F90D1DC003BB5A7 /* functions_0x62.html */, + 24A2FF090F90D1DC003BB5A7 /* functions_0x63.html */, + 24A2FF0A0F90D1DC003BB5A7 /* functions_0x64.html */, + 24A2FF0B0F90D1DC003BB5A7 /* functions_0x65.html */, + 24A2FF0C0F90D1DC003BB5A7 /* functions_0x66.html */, + 24A2FF0D0F90D1DC003BB5A7 /* functions_0x67.html */, + 24A2FF0E0F90D1DC003BB5A7 /* functions_0x68.html */, + 24A2FF0F0F90D1DC003BB5A7 /* functions_0x69.html */, + 24A2FF100F90D1DC003BB5A7 /* functions_0x6b.html */, + 24A2FF110F90D1DC003BB5A7 /* functions_0x6c.html */, + 24A2FF120F90D1DC003BB5A7 /* functions_0x6d.html */, + 24A2FF130F90D1DC003BB5A7 /* functions_0x6e.html */, + 24A2FF140F90D1DC003BB5A7 /* functions_0x6f.html */, + 24A2FF150F90D1DC003BB5A7 /* functions_0x70.html */, + 24A2FF160F90D1DC003BB5A7 /* functions_0x72.html */, + 24A2FF170F90D1DC003BB5A7 /* functions_0x73.html */, + 24A2FF180F90D1DC003BB5A7 /* functions_0x74.html */, + 24A2FF190F90D1DC003BB5A7 /* functions_0x75.html */, + 24A2FF1A0F90D1DC003BB5A7 /* functions_0x76.html */, + 24A2FF1B0F90D1DC003BB5A7 /* functions_0x77.html */, + 24A2FF1C0F90D1DC003BB5A7 /* functions_0x78.html */, + 24A2FF1D0F90D1DC003BB5A7 /* functions_0x79.html */, + 24A2FF1E0F90D1DC003BB5A7 /* functions_0x7e.html */, + 24A2FF1F0F90D1DC003BB5A7 /* functions_func.html */, + 24A2FF200F90D1DC003BB5A7 /* functions_vars.html */, + 24A2FF210F90D1DC003BB5A7 /* globals.html */, + 24A2FF220F90D1DC003BB5A7 /* globals_0x62.html */, + 24A2FF230F90D1DC003BB5A7 /* globals_0x63.html */, + 24A2FF240F90D1DC003BB5A7 /* globals_0x64.html */, + 24A2FF250F90D1DC003BB5A7 /* globals_0x65.html */, + 24A2FF260F90D1DC003BB5A7 /* globals_0x66.html */, + 24A2FF270F90D1DC003BB5A7 /* globals_0x6b.html */, + 24A2FF280F90D1DC003BB5A7 /* globals_0x6d.html */, + 24A2FF290F90D1DC003BB5A7 /* globals_0x74.html */, + 24A2FF2A0F90D1DC003BB5A7 /* globals_0x76.html */, + 24A2FF2B0F90D1DC003BB5A7 /* globals_defs.html */, + 24A2FF2C0F90D1DC003BB5A7 /* globals_enum.html */, + 24A2FF2D0F90D1DC003BB5A7 /* globals_eval.html */, + 24A2FF2E0F90D1DC003BB5A7 /* globals_eval_0x65.html */, + 24A2FF2F0F90D1DC003BB5A7 /* globals_eval_0x6b.html */, + 24A2FF300F90D1DC003BB5A7 /* globals_eval_0x6d.html */, + 24A2FF310F90D1DC003BB5A7 /* globals_eval_0x76.html */, + 24A2FF320F90D1DC003BB5A7 /* globals_func.html */, + 24A2FF330F90D1DC003BB5A7 /* globals_type.html */, + 24A2FF340F90D1DC003BB5A7 /* globals_vars.html */, + 24A2FF350F90D1DC003BB5A7 /* hierarchy.html */, + 24A2FF360F90D1DC003BB5A7 /* history.html */, + 24A2FF370F90D1DC003BB5A7 /* index.html */, + 24A2FF380F90D1DC003BB5A7 /* Initialisation.gif */, + 24A2FF390F90D1DC003BB5A7 /* intro.html */, + 24A2FF3A0F90D1DC003BB5A7 /* IOchange.gif */, + 24A2FF3B0F90D1DC003BB5A7 /* license.html */, + 24A2FF3C0F90D1DC003BB5A7 /* maceditor.html */, + 24A2FF3D0F90D1DC003BB5A7 /* main.html */, + 24A2FF3E0F90D1DC003BB5A7 /* namespace_host_can_dos.html */, + 24A2FF3F0F90D1DC003BB5A7 /* namespace_plug_can_dos.html */, + 24A2FF400F90D1DC003BB5A7 /* namespacemembers.html */, + 24A2FF410F90D1DC003BB5A7 /* namespacemembers_vars.html */, + 24A2FF420F90D1DC003BB5A7 /* namespaces.html */, + 24A2FF430F90D1DC003BB5A7 /* Offlineprocessing.gif */, + 24A2FF440F90D1DC003BB5A7 /* others.html */, + 24A2FF450F90D1DC003BB5A7 /* pages.html */, + 24A2FF460F90D1DC003BB5A7 /* Sampleratechange.gif */, + 24A2FF470F90D1DC003BB5A7 /* sequences.html */, + 24A2FF480F90D1DC003BB5A7 /* SpeakerarrangementnegotiationforVSTfx.gif */, + 24A2FF490F90D1DC003BB5A7 /* struct_a_effect-members.html */, + 24A2FF4A0F90D1DC003BB5A7 /* struct_a_effect.html */, + 24A2FF4B0F90D1DC003BB5A7 /* struct_e_rect-members.html */, + 24A2FF4C0F90D1DC003BB5A7 /* struct_e_rect.html */, + 24A2FF4D0F90D1DC003BB5A7 /* struct_midi_key_name-members.html */, + 24A2FF4E0F90D1DC003BB5A7 /* struct_midi_key_name.html */, + 24A2FF4F0F90D1DC003BB5A7 /* struct_midi_program_category-members.html */, + 24A2FF500F90D1DC003BB5A7 /* struct_midi_program_category.html */, + 24A2FF510F90D1DC003BB5A7 /* struct_midi_program_name-members.html */, + 24A2FF520F90D1DC003BB5A7 /* struct_midi_program_name.html */, + 24A2FF530F90D1DC003BB5A7 /* struct_vst_audio_file-members.html */, + 24A2FF540F90D1DC003BB5A7 /* struct_vst_audio_file.html */, + 24A2FF550F90D1DC003BB5A7 /* struct_vst_audio_file_marker-members.html */, + 24A2FF560F90D1DC003BB5A7 /* struct_vst_audio_file_marker.html */, + 24A2FF570F90D1DC003BB5A7 /* struct_vst_event-members.html */, + 24A2FF580F90D1DC003BB5A7 /* struct_vst_event.html */, + 24A2FF590F90D1DD003BB5A7 /* struct_vst_events-members.html */, + 24A2FF5A0F90D1DD003BB5A7 /* struct_vst_events.html */, + 24A2FF5B0F90D1DD003BB5A7 /* struct_vst_file_select-members.html */, + 24A2FF5C0F90D1DD003BB5A7 /* struct_vst_file_select.html */, + 24A2FF5D0F90D1DD003BB5A7 /* struct_vst_file_type-members.html */, + 24A2FF5E0F90D1DD003BB5A7 /* struct_vst_file_type.html */, + 24A2FF5F0F90D1DD003BB5A7 /* struct_vst_key_code-members.html */, + 24A2FF600F90D1DD003BB5A7 /* struct_vst_key_code.html */, + 24A2FF610F90D1DD003BB5A7 /* struct_vst_midi_event-members.html */, + 24A2FF620F90D1DD003BB5A7 /* struct_vst_midi_event.html */, + 24A2FF630F90D1DD003BB5A7 /* struct_vst_midi_sysex_event-members.html */, + 24A2FF640F90D1DD003BB5A7 /* struct_vst_midi_sysex_event.html */, + 24A2FF650F90D1DD003BB5A7 /* struct_vst_offline_task-members.html */, + 24A2FF660F90D1DD003BB5A7 /* struct_vst_offline_task.html */, + 24A2FF670F90D1DD003BB5A7 /* struct_vst_parameter_properties-members.html */, + 24A2FF680F90D1DD003BB5A7 /* struct_vst_parameter_properties.html */, + 24A2FF690F90D1DD003BB5A7 /* struct_vst_patch_chunk_info-members.html */, + 24A2FF6A0F90D1DD003BB5A7 /* struct_vst_patch_chunk_info.html */, + 24A2FF6B0F90D1DD003BB5A7 /* struct_vst_pin_properties-members.html */, + 24A2FF6C0F90D1DD003BB5A7 /* struct_vst_pin_properties.html */, + 24A2FF6D0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement-members.html */, + 24A2FF6E0F90D1DD003BB5A7 /* struct_vst_speaker_arrangement.html */, + 24A2FF6F0F90D1DD003BB5A7 /* struct_vst_speaker_properties-members.html */, + 24A2FF700F90D1DD003BB5A7 /* struct_vst_speaker_properties.html */, + 24A2FF710F90D1DD003BB5A7 /* struct_vst_time_info-members.html */, + 24A2FF720F90D1DD003BB5A7 /* struct_vst_time_info.html */, + 24A2FF730F90D1DD003BB5A7 /* struct_vst_variable_io-members.html */, + 24A2FF740F90D1DD003BB5A7 /* struct_vst_variable_io.html */, + 24A2FF750F90D1DD003BB5A7 /* struct_vst_window-members.html */, + 24A2FF760F90D1DD003BB5A7 /* struct_vst_window.html */, + 24A2FF770F90D1DD003BB5A7 /* structfx_bank-members.html */, + 24A2FF780F90D1DD003BB5A7 /* structfx_bank.html */, + 24A2FF790F90D1DD003BB5A7 /* structfx_program-members.html */, + 24A2FF7A0F90D1DD003BB5A7 /* structfx_program.html */, + 24A2FF7B0F90D1DD003BB5A7 /* tab_b.gif */, + 24A2FF7C0F90D1DD003BB5A7 /* tab_l.gif */, + 24A2FF7D0F90D1DD003BB5A7 /* tab_r.gif */, + 24A2FF7E0F90D1DD003BB5A7 /* tabs.css */, + 24A2FF7F0F90D1DD003BB5A7 /* Termination.gif */, + 24A2FF800F90D1DD003BB5A7 /* thanks.html */, + 24A2FF810F90D1DD003BB5A7 /* tree.html */, + 24A2FF820F90D1DD003BB5A7 /* TurnOff.gif */, + 24A2FF830F90D1DD003BB5A7 /* TurnOn.gif */, + 24A2FF840F90D1DD003BB5A7 /* vstfxstore_8h.html */, + 24A2FF850F90D1DD003BB5A7 /* vstoffline.html */, + 24A2FF860F90D1DD003BB5A7 /* vstparamstruct.html */, + 24A2FF870F90D1DD003BB5A7 /* vstpluglogo.jpg */, + 24A2FF880F90D1DD003BB5A7 /* vstplugmain_8cpp.html */, + 24A2FF890F90D1DD003BB5A7 /* whatsnew.html */, + ); + name = html; + path = /vstsdk2.4/doc/html; + sourceTree = ""; + }; + 24A2FF8F0F90D1DD003BB5A7 /* pluginterfaces */ = { + isa = PBXGroup; + children = ( + 24A2FF900F90D1DD003BB5A7 /* vst2.x */, + ); + name = pluginterfaces; + path = /vstsdk2.4/pluginterfaces; + sourceTree = ""; + }; + 24A2FF900F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FF910F90D1DD003BB5A7 /* aeffect.h */, + 24A2FF920F90D1DD003BB5A7 /* aeffectx.h */, + 24A2FF930F90D1DD003BB5A7 /* vstfxstore.h */, + ); + name = vst2.x; + path = /vstsdk2.4/pluginterfaces/vst2.x; + sourceTree = ""; + }; + 24A2FF940F90D1DD003BB5A7 /* public.sdk */ = { + isa = PBXGroup; + children = ( + 24A2FF950F90D1DD003BB5A7 /* samples */, + 24A2FFD60F90D1DD003BB5A7 /* source */, + ); + name = public.sdk; + path = /vstsdk2.4/public.sdk; + sourceTree = ""; + }; + 24A2FF950F90D1DD003BB5A7 /* samples */ = { + isa = PBXGroup; + children = ( + 24A2FF960F90D1DD003BB5A7 /* vst2.x */, + ); + name = samples; + path = /vstsdk2.4/public.sdk/samples; + sourceTree = ""; + }; + 24A2FF960F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FF970F90D1DD003BB5A7 /* adelay */, + 24A2FFA80F90D1DD003BB5A7 /* again */, + 24A2FFAE0F90D1DD003BB5A7 /* mac */, + 24A2FFB40F90D1DD003BB5A7 /* minihost */, + 24A2FFBA0F90D1DD003BB5A7 /* vstxsynth */, + 24A2FFC50F90D1DD003BB5A7 /* win */, + 24A2FFC80F90D1DD003BB5A7 /* win.vc2003 */, + 24A2FFCF0F90D1DD003BB5A7 /* win.vc6 */, + ); + name = vst2.x; + path = /vstsdk2.4/public.sdk/samples/vst2.x; + sourceTree = ""; + }; + 24A2FF970F90D1DD003BB5A7 /* adelay */ = { + isa = PBXGroup; + children = ( + 24A2FF980F90D1DD003BB5A7 /* adelay.cpp */, + 24A2FF990F90D1DD003BB5A7 /* adelay.h */, + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */, + 24A2FF9B0F90D1DD003BB5A7 /* editor */, + 24A2FFA30F90D1DD003BB5A7 /* surrounddelay.cpp */, + 24A2FFA40F90D1DD003BB5A7 /* surrounddelay.h */, + 24A2FFA50F90D1DD003BB5A7 /* win */, + ); + name = adelay; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay; + sourceTree = ""; + }; + 24A2FF9B0F90D1DD003BB5A7 /* editor */ = { + isa = PBXGroup; + children = ( + 24A2FF9C0F90D1DD003BB5A7 /* resources */, + 24A2FFA10F90D1DD003BB5A7 /* sdeditor.cpp */, + 24A2FFA20F90D1DD003BB5A7 /* sdeditor.h */, + ); + name = editor; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/editor; + sourceTree = ""; + }; + 24A2FF9C0F90D1DD003BB5A7 /* resources */ = { + isa = PBXGroup; + children = ( + 24A2FF9D0F90D1DD003BB5A7 /* bmp00128.bmp */, + 24A2FF9E0F90D1DD003BB5A7 /* bmp00129.bmp */, + 24A2FF9F0F90D1DD003BB5A7 /* bmp00130.bmp */, + 24A2FFA00F90D1DD003BB5A7 /* surrounddelay.rc */, + ); + name = resources; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/editor/resources; + sourceTree = ""; + }; + 24A2FFA50F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFA60F90D1DD003BB5A7 /* adelay.vcproj */, + 24A2FFA70F90D1DD003BB5A7 /* surrounddelay.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/adelay/win; + sourceTree = ""; + }; + 24A2FFA80F90D1DD003BB5A7 /* again */ = { + isa = PBXGroup; + children = ( + 24A2FFA90F90D1DD003BB5A7 /* source */, + 24A2FFAC0F90D1DD003BB5A7 /* win */, + ); + name = again; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again; + sourceTree = ""; + }; + 24A2FFA90F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFAA0F90D1DD003BB5A7 /* again.cpp */, + 24A2FFAB0F90D1DD003BB5A7 /* again.h */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again/source; + sourceTree = ""; + }; + 24A2FFAC0F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFAD0F90D1DD003BB5A7 /* again.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/again/win; + sourceTree = ""; + }; + 24A2FFAE0F90D1DD003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FFAF0F90D1DD003BB5A7 /* minihost-Info.plist */, + 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */, + 24A2FFB30F90D1DD003BB5A7 /* vst2.4Info.plist */, + ); + name = mac; + path = /vstsdk2.4/public.sdk/samples/vst2.x/mac; + sourceTree = ""; + }; + 24A2FFB40F90D1DD003BB5A7 /* minihost */ = { + isa = PBXGroup; + children = ( + 24A2FFB50F90D1DD003BB5A7 /* source */, + 24A2FFB80F90D1DD003BB5A7 /* win */, + ); + name = minihost; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost; + sourceTree = ""; + }; + 24A2FFB50F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFB60F90D1DD003BB5A7 /* minieditor.cpp */, + 24A2FFB70F90D1DD003BB5A7 /* minihost.cpp */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost/source; + sourceTree = ""; + }; + 24A2FFB80F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFB90F90D1DD003BB5A7 /* minihost.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/minihost/win; + sourceTree = ""; + }; + 24A2FFBA0F90D1DD003BB5A7 /* vstxsynth */ = { + isa = PBXGroup; + children = ( + 24A2FFBB0F90D1DD003BB5A7 /* resource */, + 24A2FFBE0F90D1DD003BB5A7 /* source */, + 24A2FFC30F90D1DD003BB5A7 /* win */, + ); + name = vstxsynth; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth; + sourceTree = ""; + }; + 24A2FFBB0F90D1DD003BB5A7 /* resource */ = { + isa = PBXGroup; + children = ( + 24A2FFBC0F90D1DD003BB5A7 /* vstxsynth.rc */, + 24A2FFBD0F90D1DD003BB5A7 /* vstxsynth.vstxml */, + ); + name = resource; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/resource; + sourceTree = ""; + }; + 24A2FFBE0F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFBF0F90D1DD003BB5A7 /* gmnames.h */, + 24A2FFC00F90D1DD003BB5A7 /* vstxsynth.cpp */, + 24A2FFC10F90D1DD003BB5A7 /* vstxsynth.h */, + 24A2FFC20F90D1DD003BB5A7 /* vstxsynthproc.cpp */, + ); + name = source; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/source; + sourceTree = ""; + }; + 24A2FFC30F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFC40F90D1DD003BB5A7 /* vstxsynth.vcproj */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/vstxsynth/win; + sourceTree = ""; + }; + 24A2FFC50F90D1DD003BB5A7 /* win */ = { + isa = PBXGroup; + children = ( + 24A2FFC60F90D1DD003BB5A7 /* samples.sln */, + 24A2FFC70F90D1DD003BB5A7 /* vstplug.def */, + ); + name = win; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win; + sourceTree = ""; + }; + 24A2FFC80F90D1DD003BB5A7 /* win.vc2003 */ = { + isa = PBXGroup; + children = ( + 24A2FFC90F90D1DD003BB5A7 /* adelay.vcproj */, + 24A2FFCA0F90D1DD003BB5A7 /* again.vcproj */, + 24A2FFCB0F90D1DD003BB5A7 /* minihost.vcproj */, + 24A2FFCC0F90D1DD003BB5A7 /* samples.sln */, + 24A2FFCD0F90D1DD003BB5A7 /* surrounddelay.vcproj */, + 24A2FFCE0F90D1DD003BB5A7 /* vstxsynth.vcproj */, + ); + name = win.vc2003; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win.vc2003; + sourceTree = ""; + }; + 24A2FFCF0F90D1DD003BB5A7 /* win.vc6 */ = { + isa = PBXGroup; + children = ( + 24A2FFD00F90D1DD003BB5A7 /* adelay.dsp */, + 24A2FFD10F90D1DD003BB5A7 /* again.dsp */, + 24A2FFD20F90D1DD003BB5A7 /* minihost.dsp */, + 24A2FFD30F90D1DD003BB5A7 /* samples.dsw */, + 24A2FFD40F90D1DD003BB5A7 /* surrounddelay.dsp */, + 24A2FFD50F90D1DD003BB5A7 /* vstxsynth.dsp */, + ); + name = win.vc6; + path = /vstsdk2.4/public.sdk/samples/vst2.x/win.vc6; + sourceTree = ""; + }; + 24A2FFD60F90D1DD003BB5A7 /* source */ = { + isa = PBXGroup; + children = ( + 24A2FFD70F90D1DD003BB5A7 /* vst2.x */, + ); + name = source; + path = /vstsdk2.4/public.sdk/source; + sourceTree = ""; + }; + 24A2FFD70F90D1DD003BB5A7 /* vst2.x */ = { + isa = PBXGroup; + children = ( + 24A2FFD80F90D1DD003BB5A7 /* aeffeditor.h */, + 24A2FFD90F90D1DD003BB5A7 /* audioeffect.cpp */, + 24A2FFDA0F90D1DD003BB5A7 /* audioeffect.h */, + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */, + 24A2FFDC0F90D1DD003BB5A7 /* audioeffectx.h */, + 24A2FFDD0F90D1DD003BB5A7 /* vstplugmain.cpp */, + ); + name = vst2.x; + path = /vstsdk2.4/public.sdk/source/vst2.x; + sourceTree = ""; + }; + 24A2FFDE0F90D1DD003BB5A7 /* vstgui.sf */ = { + isa = PBXGroup; + children = ( + 24A2FFDF0F90D1DD003BB5A7 /* drawtest */, + 24A200160F90D1DD003BB5A7 /* vstgui */, + ); + name = vstgui.sf; + path = /vstsdk2.4/vstgui.sf; + sourceTree = ""; + }; + 24A2FFDF0F90D1DD003BB5A7 /* drawtest */ = { + isa = PBXGroup; + children = ( + 24A2FFE00F90D1DD003BB5A7 /* mac */, + 24A2FFEE0F90D1DD003BB5A7 /* resources */, + 24A200030F90D1DD003BB5A7 /* source */, + 24A2000F0F90D1DD003BB5A7 /* win */, + 24A200130F90D1DD003BB5A7 /* win.vc6 */, + ); + name = drawtest; + path = /vstsdk2.4/vstgui.sf/drawtest; + sourceTree = ""; + }; + 24A2FFE00F90D1DD003BB5A7 /* mac */ = { + isa = PBXGroup; + children = ( + 24A2FFE10F90D1DD003BB5A7 /* audiounit.exp */, + 24A2FFE20F90D1DD003BB5A7 /* cw_vst_prefix.pch++ */, + 24A2FFE30F90D1DD003BB5A7 /* drawtest.cw9prj */, + 24A2FFE40F90D1DD003BB5A7 /* drawtest.plc */, + 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */, + 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */, + 24A2FFEB0F90D1DD003BB5A7 /* Info.plist */, + 24A2FFEC0F90D1DD003BB5A7 /* xcode_au_prefix.h */, + 24A2FFED0F90D1DD003BB5A7 /* xcode_vst_prefix.h */, + ); + name = mac; + path = /vstsdk2.4/vstgui.sf/drawtest/mac; + sourceTree = ""; + }; + 24A2FFEE0F90D1DD003BB5A7 /* resources */ = { + isa = PBXGroup; + children = ( + 24A2FFEF0F90D1DD003BB5A7 /* audiounit.r */, + 24A2FFF00F90D1DD003BB5A7 /* bmp00001.png */, + 24A2FFF10F90D1DD003BB5A7 /* bmp00100.png */, + 24A2FFF20F90D1DD003BB5A7 /* bmp01000.png */, + 24A2FFF30F90D1DD003BB5A7 /* bmp10001.bmp */, + 24A2FFF40F90D1DD003BB5A7 /* bmp10002.bmp */, + 24A2FFF50F90D1DD003BB5A7 /* bmp10003.bmp */, + 24A2FFF60F90D1DD003BB5A7 /* bmp10004.bmp */, + 24A2FFF70F90D1DD003BB5A7 /* bmp10005.bmp */, + 24A2FFF80F90D1DD003BB5A7 /* bmp10006.bmp */, + 24A2FFF90F90D1DD003BB5A7 /* bmp10007.bmp */, + 24A2FFFA0F90D1DD003BB5A7 /* bmp10008.bmp */, + 24A2FFFB0F90D1DD003BB5A7 /* bmp10009.bmp */, + 24A2FFFC0F90D1DD003BB5A7 /* bmp10010.bmp */, + 24A2FFFD0F90D1DD003BB5A7 /* bmp10011.bmp */, + 24A2FFFE0F90D1DD003BB5A7 /* bmp10012.bmp */, + 24A2FFFF0F90D1DD003BB5A7 /* bmp10013.bmp */, + 24A200000F90D1DD003BB5A7 /* bmp10014.bmp */, + 24A200010F90D1DD003BB5A7 /* bmp10015.bmp */, + 24A200020F90D1DD003BB5A7 /* bmp10016.bmp */, + ); + name = resources; + path = /vstsdk2.4/vstgui.sf/drawtest/resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 245463B90991757100464AD3 /* Isolator2.h in Headers */, + 24D8287F09A9164A0093AEF8 /* xcode_vst_prefix.h in Headers */, + 24A202190F90D1DE003BB5A7 /* aeffect.h in Headers */, + 24A2021A0F90D1DE003BB5A7 /* aeffectx.h in Headers */, + 24A2021B0F90D1DE003BB5A7 /* vstfxstore.h in Headers */, + 24A2021D0F90D1DE003BB5A7 /* adelay.h in Headers */, + 24A202240F90D1DE003BB5A7 /* sdeditor.h in Headers */, + 24A202260F90D1DE003BB5A7 /* surrounddelay.h in Headers */, + 24A2022A0F90D1DE003BB5A7 /* again.h in Headers */, + 24A202330F90D1DE003BB5A7 /* gmnames.h in Headers */, + 24A202350F90D1DE003BB5A7 /* vstxsynth.h in Headers */, + 24A202460F90D1DE003BB5A7 /* aeffeditor.h in Headers */, + 24A202480F90D1DE003BB5A7 /* audioeffect.h in Headers */, + 24A2024A0F90D1DE003BB5A7 /* audioeffectx.h in Headers */, + 24A2024D0F90D1DE003BB5A7 /* cw_vst_prefix.pch++ in Headers */, + 24A202510F90D1DE003BB5A7 /* xcode_au_prefix.h in Headers */, + 24A202520F90D1DE003BB5A7 /* xcode_vst_prefix.h in Headers */, + 24A202680F90D1DE003BB5A7 /* controlsgui.h in Headers */, + 24A2026A0F90D1DE003BB5A7 /* pdrawtesteditor.h in Headers */, + 24A2026C0F90D1DE003BB5A7 /* pdrawtesteffect.h in Headers */, + 24A2026F0F90D1DE003BB5A7 /* pdrawtestview.h in Headers */, + 24A202710F90D1DE003BB5A7 /* pprimitivesviews.h in Headers */, + 24A202780F90D1DE003BB5A7 /* aeffguieditor.h in Headers */, + 24A2027A0F90D1DE003BB5A7 /* cfileselector.h in Headers */, + 24A2027D0F90D1DE003BB5A7 /* cscrollview.h in Headers */, + 24A2027F0F90D1DE003BB5A7 /* ctabview.h in Headers */, + 24A203A50F90D1DE003BB5A7 /* plugguieditor.h in Headers */, + 24A203A70F90D1DE003BB5A7 /* vstcontrols.h in Headers */, + 24A203A90F90D1DE003BB5A7 /* vstgui.h in Headers */, + 24A203AA0F90D1DE003BB5A7 /* vstkeycode.h in Headers */, + 24A203AB0F90D1DE003BB5A7 /* vstplugscarbon.h in Headers */, + 24A203AC0F90D1DE003BB5A7 /* vstplugsmac.h in Headers */, + 24A203AD0F90D1DE003BB5A7 /* vstplugsmacho.h in Headers */, + 24A203AE0F90D1DE003BB5A7 /* vstplugsquartz.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* Isolator2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Isolator2" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + 24CFB70807E7A07C0081BD57 /* Copy PkgInfo */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Isolator2; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = "FM-Chopper"; + productReference = 2407DE920899296600EB68BF /* Isolator2.vst */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 24BEAAF108919AE700E695F9 /* Build configuration list for PBXProject "Isolator2" */; + compatibilityVersion = "Xcode 2.4"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 089C166AFE841209C02AAC07 /* FM-Chopper */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 24A203E00F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFE50F90D1DD003BB5A7 /* drawtest.xcode */; + }, + { + ProductGroup = 24A203E80F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFE80F90D1DD003BB5A7 /* drawtest.xcodeproj */; + }, + { + ProductGroup = 24A203CE0F90D272003BB5A7 /* Products */; + ProjectRef = 24A2FFB00F90D1DD003BB5A7 /* vst 2.4 examples.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* Isolator2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 24A203D70F90D272003BB5A7 /* again.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = again.vst; + remoteRef = 24A203D60F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203D90F90D272003BB5A7 /* adelay.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = adelay.vst; + remoteRef = 24A203D80F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DB0F90D272003BB5A7 /* vstxsynth.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = vstxsynth.vst; + remoteRef = 24A203DA0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DD0F90D272003BB5A7 /* surrounddelay.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = surrounddelay.vst; + remoteRef = 24A203DC0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203DF0F90D272003BB5A7 /* minihost.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = minihost.app; + remoteRef = 24A203DE0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203E50F90D272003BB5A7 /* drawtest.component */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.component; + remoteRef = 24A203E40F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203E70F90D272003BB5A7 /* drawtest.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.vst; + remoteRef = 24A203E60F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203ED0F90D272003BB5A7 /* drawtest.component */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.component; + remoteRef = 24A203EC0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 24A203EF0F90D272003BB5A7 /* drawtest.vst */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = drawtest.vst; + remoteRef = 24A203EE0F90D272003BB5A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 24CFB70407E7A0220081BD57 /* PkgInfo in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 24CFB70807E7A07C0081BD57 /* Copy PkgInfo */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy PkgInfo"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "cp mac/PkgInfo \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.vst/Contents/\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2407DEB9089929BA00EB68BF /* Isolator2.cpp in Sources */, + 24D8287009A914000093AEF8 /* Isolator2Proc.cpp in Sources */, + 24A203CB0F90D251003BB5A7 /* audioeffect.cpp in Sources */, + 24A203CC0F90D251003BB5A7 /* audioeffectx.cpp in Sources */, + 24A203CD0F90D251003BB5A7 /* vstplugmain.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 24BEAAEE08919AE700E695F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = "/vstsdk2.4/**"; + INFOPLIST_FILE = ./mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = Gain; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = vst; + }; + name = Debug; + }; + 24BEAAEF08919AE700E695F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + x86_64, + ); + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = "/vstsdk2.4/**"; + INFOPLIST_FILE = ./mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = Isolator2; + SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + SECTORDER_FLAGS = ""; + SKIP_INSTALL = NO; + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = vst; + }; + name = Release; + }; + 24BEAAF208919AE700E695F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; + INFOPLIST_FILE = ""; + INFOPLIST_PREPROCESS = NO; + }; + name = Debug; + }; + 24BEAAF308919AE700E695F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = s; + INFOPLIST_FILE = ""; + INFOPLIST_PREPROCESS = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 24BEAAED08919AE700E695F9 /* Build configuration list for PBXNativeTarget "Isolator2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24BEAAEE08919AE700E695F9 /* Debug */, + 24BEAAEF08919AE700E695F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 24BEAAF108919AE700E695F9 /* Build configuration list for PBXProject "Isolator2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24BEAAF208919AE700E695F9 /* Debug */, + 24BEAAF308919AE700E695F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..a80c03824 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..5c38f9460675438b0fec50998b84b4a658168d63 GIT binary patch literal 12075 zcmbVS2Yi!N*S{le)1*n$B+XvUC}ngn%5G^v1WKi)lx0cVr)?l@Y6eg%as%ReQB)kS zib`AN>%;|4R9xUdhRP5H5tQXXMTX? z&&t{ZAV2^E0f+&y0hpYGdrrDj|`eqkxuCn_*ZE^r_UiEYm z%mZ;i2oyjGl0knk01O0!Ksv|(nIH>fgB&mf3YyGPpb?s&8CqZp zv_c!S!vQb{=E6Lf4-4QZSPV)?9$1bhy@1K)-3!S~@dxE+1~KZGB_o$y=u9Xt+C zz?1M4JPp5xKfoX1Pw)&p2me4ZC>BXkBGMuq(jx=PLAfXo<)Z>rhz6q~Gz1Mr!%#6Q zL8H-FbTyiYDo_<_KpbjBO{f{UkO#G)d1yWgqQz(lx(VHm?nKMceduA-iPoX@=qdC( zdKJBf-a+r8kI@eF3EGLiMc<+0=ma{6PNCE2d-MbP5uHW9p+C@{Scv1X2#awdPQg}e z!*=Yzskk3b!~JnSF2IF&FfPHP@i;sQSK_I-2G7K^uoH9Gh3DW_?7dc1ReZO(eG)Ked5;adH*GJ9eE;KDIEg{A3PS%qWL^GZqz z(@U}nv(ocQi?ee|O0$de@(UvqtAH7#tp{qL0a~B~dSC!XU?MRjmc$Vui6E(`ZS{@uc&ALB;F}pD<0|W$xfYHx;9n;PT1z>f-_`2$Q-iIQ8KW4C z@j6?$O4s#Vm`ANFYl73~AMI&rb8~dU3TEd%KivtQZHd#zHG~+u{OyyuHjkHXQDS7b zrn*`iJoA0EGRs?^j09<&U<8qOf>9)y z^xF+aQ|&1QWnc^#%k-y?E_Vj~_Hu5zee*a1h>|F3Wy2d?Zf;0sX66(h-Js0+W-r|& zPg^tRo#Sb4^?6z|>7LJ}EtzATuGY{;#sapgHoBb5UEpdk9!vler}O&QO3$E%f8=~q z$}8zcbt9O0biBV+r)*>aWu1?E0b4pZhA;u zL*%F@cZ(d6Y&8{joS$p) z?F!j=6PVKlnt_WLiH)R27`TB4$h$xbXeB0M?gDM#I$|Ly#5#+z8P`B{($(nVytOhJ zeP2-8+CJEE=$49*OpgK4EUXOZm!ttb+&hdrQjA&P8Bfp%1?G1xV=`U z=ppQ#wHw^V=A}!zbXWO}x&til1b31FBxet}8{7j{P!+!y+y};j2d4Q#=SHQU=6AJF zlyJ7R&1eWiAJsxKhzukOl5Hz~^=<8uV^0Yqi+cz>!mRgUu#%*cj4tpfc#LF{EYh!< zKhJ7jZ>}Iy6*CBaMQg!23P(}uajE`vgY{qoTif50(T$oYE4`(B9ckXqT$|2Nx==Expx2Rj(>d;mTKAAyg_ zFfyEsAR||UPry!U3%kiEQcOz7XlAdP3a_h$8bjnXsv?R-q2Q9PYM0MNb$)cS)9a+@ z;hpSkZQ^EK$y@_Iq8eO(DApF9Hgn1jyIJ7#IuVpb*AG5fsA&QbDdElSw71B2!2;nYtcI zX`rzSCP6t=Kqat{8X9PnkZEK(nL%dKXX`Y72;VD9$4__p%G|Cdb{@4d72jM+eLy`o z&NtOX{U67$U)i@K0`j#oIp18&QUE`71OYE)5^m&~jB&QO-0iip|kh?CS2>y-Jf27hyP zGv{h*_S;6?yE26Pwo%JS=pn+m5Dul_0SCh(ID|A1jx=_|VQ@Hw!zOYw14J57(Q}NB zn8MK&h26?P3$qpeh%31!7IM;U)?7AZQXBIzv`ckaSCz}}=0Z>pOTnBqundlYW8qbB z9BC#V;v@6P4L$x5PJk6m-ifdrP9iQchs^DU*TBiJlDJ6=X=U=JUN%FNc+?y{UK;$> z$_D;DVTrSTZY9@7ZJP$FwX*(yPtDI!?Q{n?+bCgZk3l`KI1sQzss2nj`?3W%VI8a| zZR9%QrM5PT9}KRsOeqPt+zpYVa>16%Mz%r^Y$JXWAoJKr89#LLkmxz*!Rs#@*#U2W z3&{e~POhgTNB$Tk@h-R+h~W}=6N@1moPOt|Bs8}!l1)Q|1u?NhhyAlG`pGz9qD-eZ z*c}72^9sXxPP|B*Ad%AeFuZMi@JNG^Vn0QTI%*R>n%^W4JgqWNU(az3T*K}pxk#bX zULh;$QYI4tiRn^nXqpmF#MR}MV?3>XN;%r&_IURgO=giL#cHGNEK{JfHjZ&Sn|$=0 z;gfAtD!=$7iHv1AwK7Y_Rh)Ys=XcdR%eer@Lg8_()Jz*`VwGOvaX0Kr?U&a7O2Kb< z>aMf_y|M40bWuiT7L{fy0~fl+kW`f{ODo9&GE792T~2O9+^(Df^gX{IIx@>=jf0CQ zD)rf;27dRth77o3J56lLE5~!~G~o%?Hg*mlQRVe``~=dfMiNc%Y_yt@Lvxoh8qZIr z^@}B<{H_c+A{=tt( zM=17zH^W2GJ=>3^YQ z0Y`|k2S;RZ7hFXRvJ-YO^=F|j^X{788qUrkH}PAw8m{4Yh3kT=L(z1Vr@`57ar!N} zL$U{3DkjQK@F2SZ%;}`%158r+_b0)e)qM0wGs#f=NaVeM`#gLVq^*N5z!%{rxEa0# zUxu%c+sVJkGI9sGlPo89t%I+@*Wnf*g`1eWCU=v2$O_7SS;$%UyO!Y@(*TahSU2+al2T4)Y)zo?g z4oo1Pzl-xR?V-cQ&~inE)8EWuN7p(vlxAK&hI)WN zC|-?7YD6?r+<;8Tj4UVxS&S%D3zSQo3@Mr<+PecUqVWZu0o?$kxl&bcra&G7{F0^pZ06es7@NZXOT@2 zg_we7Qs;=O(Nt7}rct$+L0%)TlP%;8st|9kMYHI^*V6w^R7c*TN4}l@|B!sd4xUw% zdybA(uByBo^TJd%sHo5^X?_Q;JZ95=`_O)LfE*-WlCQ`ia+rKgj*xH2 zQ3j7+Qm=Xt9z6y>Qx^hj|8DO2u(p~4#IxSQe+IzO1Zi~QxoUqJs(SS zc~`~C1hrJPTN|9-2Ij#SG2caPteU@xpUE%eS8{e8)?yvjV*~02`QTad8#zaQ4?-c?Nn|ug?l+Ty6vuK9=9Xsg zLWRVo?vl^8n1_r$66yt9QDVMOj zsZVcn2YmboZwBF$zyok5kY8Q`#aTET?83R^Jh?#i`y#d0P$}}f4n&nAdn=Kj;vzf* zi1AQ73=hX6@JKug9;7A^ktb4CyS7(W7P^HfTBvIDHZyNd!-55q8Y5$S`+_ir{27FC zy@I`qw?$319e)sn)*!UeTLP;1JVe_@xn@UA`w8A1 zHEIw3Gzc9*m>P*CBR-T5MP|Mc8odYa#|Q8i6a)`~GW-=jL~{>TSL3ydx!3a0t$@0T zYjp*D{M@YmKoy_w(X{cmOqX>9X#pPuVOkL8eulrsN9Y{i;G_5$o#!Av4j;uQ;Ey%* zn!?@SbWN^;7sXkLy90 z8H5AEILvF?8HTDq<6rQvK{zl72L)mJC9oPs(JLZfxKRLj+{^fT+>6=*K|I}rROrY9}MXdXc+f@LVAUgtw1j@ObLY+p{lKx{_bWV4M~Q8k?3(6ufI-z@wAghu?Nvt z=rB4)fAe$#ox+&9`$Bvb^>q_)Idx={aTTtnzhZLXxwwV?dg(ffpaDD|x6|J--GiUT zuTp>XvmjM4SWqdb5;z5of@Z-Sfk$wiz$XX@o)+vC92I;gI3YMK_(AZK;Ln)Y75f?wvo7YDm}g_2k9jd>bIi*zM`M+-qhsg9 z&X2u5_J-I+vBB6Su@A(qid_@CE_Org07UBEC zkA(Y$2ZUb;zZ9Mno)P{cJS#jW{3{;Di=Q6f6z__k8{ZPYG5+=V zH{#!le_Mn^i6V_iCo+gkB8#ZMXrL%vlqt#<<%-Hh0nrlCk>X}%?U3hyp^ycVOPSQgwGT9B^*fjF5z^- z4+%ddoJ}~Fa3SG$36jK1rHl2XZh$vu+CCC^K?NZyoe zmAoT)PqIz&fn=}bE6HKW5y?@>DarSeA0=lbzetVJ@zVKHBE3brO!}a7m9$H`TDn&H zr1WX&M(K0X7o@LC-;lm5-7VcO{X+Vs^pNyh>2c{v>1pW?(sR;_i6Bvus7zEPY7%vc zDT%g3M`FLk{)st>MTsSeS0}xc^h(m(NxPEvB^^pSopd4T_oP4NK#t@Bd8}L^PnN6Y zTDe|sl$+%#@-gzc^84glJu~~6mnWns2 z*{BREA5pGVZcsk1d{X(c@+0LAQJz(vQ(jR1uKY6@ zB%@?Oa%{3WIVX8Ua%*xh`I+Rc$-9ydC4ZfKGWlHc#pFL!K!sESl|&_1DODR}s}>)lI6KRd=YCtL|2U?#fx=1}#JzPCfU929hE>q7|d(=zR z52)9wUsvx^f3LwBoyMj~(+toI(qw4nYSwC=*1W3Os@bO5rP;0dRP&|gE6rie3C&5( zY0X*9dCf)5A6k)Ct<`GvTBFviP0`x4S=tYmrVsN1Z2NB6#NyY3_14&6@Om%78cBf4X{ z?{p`0zv(XMe%Jk_hkC3}&};Puy-A;<3nV6HaLHQ#8y!@SD;s(Fj~P4nC4 zcg^pcFIcceWJ$0jTI3d`CB;I25@N}-6j+KZB^IZp(X!NXkL6y=1D1y@D=ix=PgtI^ zY_z;+*=l*m^1fxeWw+(H<@*#tiX>%l%J7utlt)t5rff)gBIT)+_fqzx985WsawO$g z%JGylDZi$iOSzEpN6KGTp;c}*TJxowLY>s0G(Yn`>h+GKTE=UQ*GuC;En zer-KzJ!SpgdeQo)4cY{@Sewvhu=TeMvSrw^ZF#l=+ellfZLIBT+XUM*+qJgYwmMsr zZH}$Q=CLiXEw$ZlTV}h{w!(J5?Lphaw$-+cwr6e6**r(a&*caI!v_Eg( zWPi#2s(p)nul=z7JNqvVwZrCcIMN&g9T|?%jxmmLjtP!(M}=dWW45E-(dckF<~kNQ zu6NwvSmapdxYKdB<6cLnW3^+gV}s)<$19H49B(+@avX4c={V##;yCK~-tm*;7spx0 pU#b05Gg50(ovF8^E=zqj_3hMcsXIbpD?o_<78v>O$Y<)#{{dZm;Qasq literal 0 HcmV?d00001 diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..314de0ff8716f1de186bd9e12b891393458717e5 GIT binary patch literal 10373 zcmcgSX?Rmr)90LvXJxXhW-M3h^;9L>-L+#JblIBhbu}vxesIN0 zax6v?6p55bh1BSFbO*WVTyRipP#xwAP zcrJbjFT{`IMR*B*7PsPccs<^L|AV*SSMXc-L;MNej}PI`@L_x$pTb|_v-mu|fPcc* z@t*{dNFpV2q9975BArPW(v{p!?jU!PZX}hYkqpv<^d@(ayU9Q@h?J8dq=F15BgrUI zLu$zw;vg>4LZ*`$WG0zQ9wHBu$H^kHn5-k~$p*5Kyg*(gFOf~;WwM!UBX5!IA5^ zm+8m!XY!aLW*}3_lre*u;Y=k{#f)I885>j2jAfjRi}5gCX40@^XG>$_K_o>{C>qI7 z3}P#iYa8tz&+sx!+Bj~qX9WH9n-i3`p;#0L1ei7?M+y+ZP8*w?o|WG#CnvoqwO3wN zMrw9$@9fmv!rbiCtc+fTS-HJ)ih5?{+gMd`LE&(hdz`1)Udt7@YFnB(r#C=YgS03S ztZR`D#Unj3paf(@CS(RNM1TY$K?+e24YIYU6S@s0p=8R30d+x15CgHmf}HXc2@YUK z^HdzpI@iP^x4nt8v7P9`V0Rto=IVmft@fIHm(%NZH8xU*v9a;NL&eS_Dh^Mro8z3N zt~z@D?wi>TJ7~+#%goBk$jnXck=d&tHM?g)dTL&JkD}D<{Gz;!%))}6`Psc~Y`2>c z2&{#O4|6)kw{XRER1}VS2j{l2W(uBL>!m*1F}pW&YjwFAYwYe~PldzdsA;6!>Vh|+ ztmcJpO`V$2Gpk!-@7~k9B~H!APEV)L>FLv_AE3&QMp-Bu;#!dbA`hTmC{wP=OjW zpamVouSLaFdxKC3Dn(`VsT}lFdy8N(JPohXr}|O!B87Dhugjh5=Il0>rSFz8u8C## z362IkU9P4J^o}L=8m`gCrt&)QmK_9uJMocBfb1+*4wo>}t8m#;Z{sFPo8Q6dH|e=ssjeHK-O0 zkN`$7ff*8^6Wq3z+IKxK6XZZ+(Kysd?K_E=35?DLchxSE!R2F@=aO;BJy zyR}d@>g?`1UXDDlz|jcdL$GWm-74Vf?JbR7A1Xl%iTK9zX9)G&u~&2G*^AM9S5 zTj)LI0m?yvj%f7V)JokZWC;_|WU#iPNs!!%ra+2~O%bRIQnCFNfe?Zj2zUfDp>r#m z1zoJAc84>tD?@Y8!%*Ii9z=7|L(mm&hdbKQJSwzD;Z7>51{-^O7&$5sFK40F<81If z7C5Mrxtw;lPj%{WSgw&~Pp;0!hOZCgTuq$UJvrbpi+GP&4BY}uY0wh%JXqJDr_fUL zGdHKt*DLutVF9I8+t%4*y&FV)Q&82G;#%YuiZMi znfK;gU-q_B*A7=gwZN|LB2*uOB~z$kFV|G&3w!Z_2;0G)A+T3CiRzax7(xN4IK+aTESN(7VE7Z=%-|V&1#xJsX=qX@ulX5mJls zu~=?*xZBYCh;s9{Fv^*K3jYqGk0{k$XgB&8?WyuQnmCV_Qmd}>CqF7;K+qrV;+flv zK1KVgXs-46D8k(~maC`M(5HL%Mk>w5F)oi+5JFb>5=V{O?w%~Xb}tunl9HKj<>+0g znR~idSgiEDys@Rh;q<>0*4I&_Np;S7s?~@$%*-T)Q0|K!uL-A3p2K@=H>1u5vdw z!QpE0ge~Utl@aBs1NbzLtHoW*mC&G>=HWBV1Yf4<)&Xb$wbkx!;QYzLkGUgoi$5IQ zDsRe2atGLL!dkJj-X+|G`f(UoXeS^t4Z4i3^0D>`6t|*la4#R^E3Coz&c_vx;8Hix zFJNgyzoOq@5DW<*kfA>@q2(b)7()q^wqXW~pbQ3&qG&=M#|MB4E1!Z(?F~+cx229N zPa04+0P+8PHiDyY^vE(xFgj0e!%?VjkPME+@>|F#DVd>310HO?35f=4M+a@$SFf~V z4PUVcG~%(InrRRqM64ah^W-R-x605TPq2x`6Ksazhj`z{ozO0P8&1N>IHk(t(-IA) zPz5#^0hRxj11IHfS-5c77n|1vq@=-j;8d`-;X83RsD_bkI1P7)Q82nfu!jo4?mD<- z6K&ecY1=m#-An7XeA@h#(K@b_KEEkQt_SXEV~t_fbgNai<6bz2m*L-obsQ%`SLloT zfpx_Se|)yFy?jK|!bn?Mnwwp2Z<=te03+cr6eAvhb8#NdN4u+Oe06g)MDpb|eXg;4 zIN+cT(7&ZDL5u_OJ;TZ@H2$~YV$@f7WT^xA3UOS@+gKUUbg7y;l~(ELe8El|tZs=p znc35)OG84k;3}}L!d5&CSK#5e62?IzG=URbtMCY1jYrbIqoEnbgNOcYp%GpvzKUoD z^6*t)RRt}8_<-*jPMZ>stC1TaKnNuwUsQ%_!(cdIafpQm?4W@Ij{$cp9s$iZRv$#k z`*|RCS!!L)q1q5TaWj9)1>RO#``6QO<0nrGATQ_UsfS3k;E93QgeSoSe;mS7X&l1S z@N}36Qv$#;40v`}fOr7Ufk`lVR2WxD1Ezv6T!hZe!;giXn~xX3RG3!n=Zi0n=_w(| z1Wsx26ZlEqN<#}v@iReQm%+>cug~+mF2^eXV0HjlhTHM#Fq&)dT9^g*S5c`8CY?0E zao;U`zJND{op~8=h6i8{Rc%05{+1wVz{nlGvxo3j{3`W=*YN9TH+~auqlIO&+tEZT z2!RUUj&hT{Wxjq_+rT*;EuIc`6mFNxD_93#==0z(mliOO!~DZ|JANDQ!0%8pJMp`8 zB(sf2q~0&ymy1SHYEZe$`kjkC^;aPZ&28%#c3AXUm z&V>9xt;`;5r(jAtu_#5iQY?c%ml;l0b~`JS>M5&2mX!QhAdI+=+D(}#vq$f4iM?_HlOxidq{EsOJ|iWWB#UMm*8di54;jM zTI@d>crT?kN&1n&upVBlqy>8&Re7LZB^F_G7~R}dHIx&|^x$rluv<-cH&dbVEwS5a zZ%p)!4=3^?r9`TSM4{!Pvw{Fgn{duf&uyui;PHCu#$~2u2X;AOw}I|%t+4nSgOG8J zBTWIvB2IWMaArJM+KHQZh!B@K84ZaMb|nICp;0a*w;;2nWzaO%||Q4M*LEC=g4vV=TE zmXfE*Gh`WgmOMwEhj-yUcppB158)%&1-s$nb<}@o4M5t-O0tTq=KYEK&>lL%xdPYW zH~5|RDOw5T(F8oM+2wG0J-+cMZF8y1=>5|wAzk_AA)X?an^soTlC{E|in^FEcFp6) z(D{$cJyMvjT588|{DfE~ybf(~(m|is;q*-|Xg&?Nm2jBi(+Tb-&Icq;^Q&fqkvyUD!`Igi0ChLAz;Hd>5b)>~69TtR1)1 zWIsAf4w6H(r9MDg>Vt5IZ>j&Pxn~#;xgRC%!XT|ovVx@c> zopsf_g0f;5CK9YG84)99A{Ysrf-m4SoLR|8nJARR$ly!(iaIE*eRSnQNg419Yhc_( zhZMJL`7>kw7`xj}$E@z5c4q@O>K;cOm)qD_?D4el!}OF}4h8a5_$i-7%v`!4zmjj1 zGP8S6uMj$>&`)^B%vXUl{z~!l(E3iaHEYG##F#B@GC7MDXs!K;-e!w z|FoKp`-5w~ZpBM$H#$qEHm_5r{6cX9ML?{V$l<#R#CfX zi)gFpHPIWQZKCa>9ipA0_e7tGj);zlPKZ7iof4fEeJT1{bXgoBR*3V&!^97WpAv5p zza@TKyia^Ud`Ns)d{lf~d{X>h@fYGt;>+Tz;_KoY;$OwTi~o$k5vqvPh`td;5hEjJ zMl6naK4L?}3lWl&B?INxURca+@Ss z(pfT8GFEcGmF$-slzb*RA~_~G zAvqVxM8-uXMfQ&z73qka9l11eL*yHgpG1Bec|P*{$R8pvMP8PsNYkY0(ky8Y>D|&| z=^$yT)G8e%ohF?nT_Ig3-74K7-6P#A-6uUDJt6&CdNyisRAtoIsPR!#qGm@u9rb+F zmZ-O)&P9D6t&2{H?h>6DogLjXIw!hMbie3<(Z$h&qD!L(M-Pdf6}>U~ge*#yAsZyC zl#P&$lG$W6vO3u$*(}*?*+a5VDD!iU>|1}vrE{e>@xN__6_z!b{D&c-OKK053*<3E9^D) z2Ky`fhaAbJ@@P3LSIAZJPVyvqSNR?CZt@Iymb`~NUtS`wl2^;`lh?@Wk{CEHmLHXWEyL-DKP zcg3Gdl~SYBDfP+(rAgUEdAqWkGELb_*<0CHnWr42tW=Irj#Q3TPE<}-PE}4<&Qw06 zoTq$Dxj?y8xl{R}@{;lwRiY|IHAppDHBQx}YF4>bEvktsP~ESZt9n@Vh-#_o8P#%C ztEyeKR<&NWQT2*yr|Lb`F4f1XPgDm~hg64Er&JeI7gd*4S5?2hVF6QGrBdpb-Hc3?YbSh zox1mQALu^P?bhwl?bV&ueX09ecUJeU?!4}M-4D7;y36rV@m=C`> z8^169K>V@z6Y-zNpNjt`{#^Wb@fY-JeSdw4zDz$vZ_!uiEA^bdLGRFy(@)Y*(a+J( z)jzC%ME{t6f&Ll&v-;=tEA(ypmHO@a{rcnjlloKo)B2zESM=BPKkI)nFb3A3FlY_& z27@8daGN37(92L@C^8H(lo|#btcD6hrGYav7#xOi2Crd);Y-7hhMx>q4A%^QCg6nH zgysZy!qkN62{RLBCCpBEG+}SDUxbf>Ar)MQ#{dfK$i^sH%>X^m;E>1ES))BC26O=nC$m@b*Fn68;_n0_@&&B^8r zbCx;B+{fI{oNLZE7n-Zgy{=mG;eAs-{eB6A} z{H^)C`J(y9#9@gwiFJt$iH^jN6OSeyPy9UbRHu?oqdV1ha`=V;h!EkEnJ#<={&pJo Ee-@_#ZU6uP literal 0 HcmV?d00001 diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.mode1v3 b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.mode1v3 new file mode 100644 index 000000000..c5723261d --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.mode1v3 @@ -0,0 +1,1372 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Xcode3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 91857D9F148EF61800AAA11B + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 089C1671FE841209C02AAC07 + 19C28FB4FE9D528D11CA2CBB + 089C167CFE841241C02AAC07 + 08FB77ADFE841716C02AAC07 + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 11 + 10 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 693}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 711}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + Gain.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + Gain.cpp + _historyCapacity + 0 + bookmark + 911C2A9D1491A5F600A430AF + history + + 915DCCBB1491A5B8008574E6 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1053, 508}} + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + PBXNavigatorGroup + Proportion + 508pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 513}, {1053, 198}} + RubberWindowFrame + 286 197 1261 752 0 0 1680 1028 + + Module + XCDetailModule + Proportion + 198pt + + + Proportion + 1053pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 911C2A901491A5F600A430AF + 1CE0B1FE06471DED0097A5F4 + 911C2A911491A5F600A430AF + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Xcode3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 91857DA0148EF61800AAA11B + /Users/spiadmin/Documents/Gain/Gain.xcodeproj + + WindowString + 286 197 1261 752 0 0 1680 1028 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {743, 413}} + RubberWindowFrame + 112 208 743 695 0 0 1680 1028 + + Module + PBXNavigatorGroup + Proportion + 413pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 418}, {743, 236}} + RubberWindowFrame + 112 208 743 695 0 0 1680 1028 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 654pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 91857DA0148EF61800AAA11B + 911C2A921491A5F600A430AF + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 112 208 743 695 0 0 1680 1028 + WindowToolGUID + 91857DA0148EF61800AAA11B + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.pbxuser b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.pbxuser new file mode 100644 index 000000000..df947808e --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/spiadmin.pbxuser @@ -0,0 +1,143 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Release; + activeTarget = 8D01CCC60486CAD60068D4B7 /* Gain */; + codeSenseManager = 91857D95148EF55400AAA11B /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 829, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 789, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 345089498; + PBXWorkspaceStateSaveDate = 345089498; + }; + perUserProjectItems = { + 911C2A9D1491A5F600A430AF /* PBXTextBookmark */ = 911C2A9D1491A5F600A430AF /* PBXTextBookmark */; + 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */ = 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */; + }; + sourceControlManager = 91857D94148EF55400AAA11B /* Source Control */; + userBuildSettings = { + }; + }; + 2407DEB6089929BA00EB68BF /* Gain.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 1768}}"; + sepNavSelRange = "{247, 0}"; + sepNavVisRange = "{0, 1657}"; + }; + }; + 245463B80991757100464AD3 /* Gain.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 975}}"; + sepNavSelRange = "{1552, 0}"; + sepNavVisRange = "{796, 1857}"; + sepNavWindowFrame = "{{15, 465}, {750, 558}}"; + }; + }; + 24A2FF9A0F90D1DD003BB5A7 /* adelaymain.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 488}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 798}"; + }; + }; + 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {859, 19825}}"; + sepNavSelRange = "{10641, 0}"; + sepNavVisRange = "{10076, 1095}"; + }; + }; + 24D8286F09A914000093AEF8 /* GainProc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 482}}"; + sepNavSelRange = "{239, 0}"; + sepNavVisRange = "{0, 950}"; + }; + }; + 24D8287E09A9164A0093AEF8 /* xcode_vst_prefix.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {992, 493}}"; + sepNavSelRange = "{249, 0}"; + sepNavVisRange = "{0, 249}"; + }; + }; + 8D01CCC60486CAD60068D4B7 /* Gain */ = { + activeExec = 0; + }; + 911C2A9D1491A5F600A430AF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2407DEB6089929BA00EB68BF /* Gain.cpp */; + name = "Gain.cpp: 10"; + rLen = 0; + rLoc = 247; + rType = 0; + vrLen = 1657; + vrLoc = 0; + }; + 915DCCBB1491A5B8008574E6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2407DEB6089929BA00EB68BF /* Gain.cpp */; + name = "Gain.cpp: 10"; + rLen = 0; + rLoc = 247; + rType = 0; + vrLen = 1625; + vrLoc = 0; + }; + 91857D94148EF55400AAA11B /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 91857D95148EF55400AAA11B /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme new file mode 100644 index 000000000..8ee693f95 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/Gain.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..5bccbcb4f --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Gain.xcscheme + + orderHint + 8 + + + SuppressBuildableAutocreation + + 8D01CCC60486CAD60068D4B7 + + primary + + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..a7bdd62d4 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + «PROJECTNAME».xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D01CCC60486CAD60068D4B7 + + primary + + + + + diff --git a/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme new file mode 100644 index 000000000..0df2de4a3 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/Isolator2.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/MacSignedVST/Isolator2/mac/Info.plist b/plugins/MacSignedVST/Isolator2/mac/Info.plist new file mode 100755 index 000000000..c144ac6f9 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/mac/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Isolator2 + CFBundleIconFile + + CFBundleIdentifier + com.airwindows.Isolator2 + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + Dthr + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/plugins/MacSignedVST/Isolator2/mac/PkgInfo b/plugins/MacSignedVST/Isolator2/mac/PkgInfo new file mode 100755 index 000000000..19a9cf67e --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/mac/PkgInfo @@ -0,0 +1 @@ +BNDL???? \ No newline at end of file diff --git a/plugins/MacSignedVST/Isolator2/mac/xcode_vst_prefix.h b/plugins/MacSignedVST/Isolator2/mac/xcode_vst_prefix.h new file mode 100755 index 000000000..eaf4c0b4b --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/mac/xcode_vst_prefix.h @@ -0,0 +1,17 @@ +#define MAC 1 +#define MACX 1 + +#define USE_NAMESPACE 0 + +#define TARGET_API_MAC_CARBON 1 +#define USENAVSERVICES 1 + +#define __CF_USE_FRAMEWORK_INCLUDES__ + +#if __MWERKS__ +#define __NOEXTENSIONS__ +#endif + +#define QUARTZ 1 + +#include \ No newline at end of file diff --git a/plugins/MacSignedVST/Isolator2/source/Isolator2.cpp b/plugins/MacSignedVST/Isolator2/source/Isolator2.cpp new file mode 100755 index 000000000..76a2913c7 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/source/Isolator2.cpp @@ -0,0 +1,154 @@ +/* ======================================== + * Isolator2 - Isolator2.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Gain_H +#include "Isolator2.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Isolator2(audioMaster);} + +Isolator2::Isolator2(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 0.0; + C = 0.0; + D = 1.0; + for (int x = 0; x < biq_total; x++) { + biquadA[x] = 0.0; + biquadB[x] = 0.0; + biquadC[x] = 0.0; + biquadD[x] = 0.0; + biquadE[x] = 0.0; + biquadF[x] = 0.0; + biquadG[x] = 0.0; + } + highA = 0.0; highB = 0.0; + lowA = 1.0; lowB = 1.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + //this is reset: values being initialized only once. Startup values, whatever they are. + + _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. + _canDo.insert("plugAsSend"); // plug-in can be used as a send effect. + _canDo.insert("x2in2out"); + setNumInputs(kNumInputs); + setNumOutputs(kNumOutputs); + setUniqueID(kUniqueId); + canProcessReplacing(); // supports output replacing + canDoubleReplacing(); // supports double precision processing + programsAreChunks(true); + vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name +} + +Isolator2::~Isolator2() {} +VstInt32 Isolator2::getVendorVersion () {return 1000;} +void Isolator2::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Isolator2::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);} +//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than +//trying to do versioning and preventing people from using older versions. Maybe they like the old one! + +static float pinParameter(float data) +{ + if (data < 0.0f) return 0.0f; + if (data > 1.0f) return 1.0f; + return data; +} + +VstInt32 Isolator2::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* Note: The way this is set up, it will break if you manage to save settings on an Intel + machine and load them on a PPC Mac. However, it's fine if you stick to the machine you + started with. */ + + *data = chunkData; + return kNumParameters * sizeof(float); +} + +VstInt32 Isolator2::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* We're ignoring byteSize as we found it to be a filthy liar */ + + /* calculate any other fields you need here - you could copy in + code from setParameter() here. */ + return 0; +} + +void Isolator2::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Isolator2::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + default: break; // unknown parameter, shouldn't happen! + } return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void Isolator2::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Freq", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Reso", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "High", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Low", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Isolator2::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Isolator2::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Isolator2::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Isolator2::getEffectName(char* name) { + vst_strncpy(name, "Isolator2", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Isolator2::getPlugCategory() {return kPlugCategEffect;} + +bool Isolator2::getProductString(char* text) { + vst_strncpy (text, "airwindows Isolator2", kVstMaxProductStrLen); return true; +} + +bool Isolator2::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/MacSignedVST/Isolator2/source/Isolator2.h b/plugins/MacSignedVST/Isolator2/source/Isolator2.h new file mode 100755 index 000000000..d8c66d499 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/source/Isolator2.h @@ -0,0 +1,104 @@ +/* ======================================== + * Isolator2 - Isolator2.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Gain_H +#define __Gain_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include +#include +#include + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'isom'; //Change this to what the AU identity is! + +class Isolator2 : + public AudioEffectX +{ +public: + Isolator2(audioMasterCallback audioMaster); + ~Isolator2(); + virtual bool getEffectName(char* name); // The plug-in name + virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in + virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + virtual void getProgramName(char *name); // read the name from the host + virtual void setProgramName(char *name); // changes the name of the preset displayed in the host + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + virtual float getParameter(VstInt32 index); // get the parameter value at the specified index + virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value + virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) + virtual void getParameterName(VstInt32 index, char *text); // name of the parameter + virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + enum { + biq_freq, + biq_reso, + biq_a0, + biq_a1, + biq_a2, + biq_b1, + biq_b2, + biq_aA0, + biq_aA1, + biq_aA2, + biq_bA1, + biq_bA2, + biq_aB0, + biq_aB1, + biq_aB2, + biq_bB1, + biq_bB2, + biq_sL1, + biq_sL2, + biq_sR1, + biq_sR2, + biq_total + }; //coefficient interpolating biquad filter, stereo + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double biquadE[biq_total]; + double biquadF[biq_total]; + double biquadG[biq_total]; + double highA; + double highB; + double lowA; + double lowB; + + uint32_t fpdL; + uint32_t fpdR; + //default stuff + + float A; + float B; + float C; + float D; +}; + +#endif diff --git a/plugins/MacSignedVST/Isolator2/source/Isolator2Proc.cpp b/plugins/MacSignedVST/Isolator2/source/Isolator2Proc.cpp new file mode 100755 index 000000000..e28ecc690 --- /dev/null +++ b/plugins/MacSignedVST/Isolator2/source/Isolator2Proc.cpp @@ -0,0 +1,574 @@ +/* ======================================== + * Isolator2 - Isolator2.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Gain_H +#include "Isolator2.h" +#endif + +void Isolator2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + + biquadA[biq_freq] = pow(A,(2.0*sqrt(overallscale)))*0.4999; + if (biquadA[biq_freq] < 0.0005) biquadA[biq_freq] = 0.0005; + biquadG[biq_freq] = biquadF[biq_freq] = biquadE[biq_freq] = biquadD[biq_freq] = biquadC[biq_freq] = biquadB[biq_freq] = biquadA[biq_freq]; + + double reso = pow(B,2); + double resoBoost = reso+1.0; + reso = 1.0-reso; + + biquadA[biq_reso] = 4.46570214 * resoBoost; + biquadB[biq_reso] = 1.51387132 * resoBoost; + biquadC[biq_reso] = 0.93979296 * resoBoost; + biquadD[biq_reso] = 0.70710678 * resoBoost; + biquadE[biq_reso] = 0.59051105 * resoBoost; + biquadF[biq_reso] = 0.52972649 * resoBoost; + biquadG[biq_reso] = 0.50316379 * resoBoost; + + biquadA[biq_aA0] = biquadA[biq_aB0]; + biquadA[biq_aA1] = biquadA[biq_aB1]; + biquadA[biq_aA2] = biquadA[biq_aB2]; + biquadA[biq_bA1] = biquadA[biq_bB1]; + biquadA[biq_bA2] = biquadA[biq_bB2]; + + biquadB[biq_aA0] = biquadB[biq_aB0]; + biquadB[biq_aA1] = biquadB[biq_aB1]; + biquadB[biq_aA2] = biquadB[biq_aB2]; + biquadB[biq_bA1] = biquadB[biq_bB1]; + biquadB[biq_bA2] = biquadB[biq_bB2]; + + biquadC[biq_aA0] = biquadC[biq_aB0]; + biquadC[biq_aA1] = biquadC[biq_aB1]; + biquadC[biq_aA2] = biquadC[biq_aB2]; + biquadC[biq_bA1] = biquadC[biq_bB1]; + biquadC[biq_bA2] = biquadC[biq_bB2]; + + biquadD[biq_aA0] = biquadD[biq_aB0]; + biquadD[biq_aA1] = biquadD[biq_aB1]; + biquadD[biq_aA2] = biquadD[biq_aB2]; + biquadD[biq_bA1] = biquadD[biq_bB1]; + biquadD[biq_bA2] = biquadD[biq_bB2]; + + biquadE[biq_aA0] = biquadE[biq_aB0]; + biquadE[biq_aA1] = biquadE[biq_aB1]; + biquadE[biq_aA2] = biquadE[biq_aB2]; + biquadE[biq_bA1] = biquadE[biq_bB1]; + biquadE[biq_bA2] = biquadE[biq_bB2]; + + biquadF[biq_aA0] = biquadF[biq_aB0]; + biquadF[biq_aA1] = biquadF[biq_aB1]; + biquadF[biq_aA2] = biquadF[biq_aB2]; + biquadF[biq_bA1] = biquadF[biq_bB1]; + biquadF[biq_bA2] = biquadF[biq_bB2]; + + biquadG[biq_aA0] = biquadG[biq_aB0]; + biquadG[biq_aA1] = biquadG[biq_aB1]; + biquadG[biq_aA2] = biquadG[biq_aB2]; + biquadG[biq_bA1] = biquadG[biq_bB1]; + biquadG[biq_bA2] = biquadG[biq_bB2]; + + //previous run through the buffer is still in the filter, so we move it + //to the A section and now it's the new starting point. + double K = tan(M_PI * biquadA[biq_freq]); + double norm = 1.0 / (1.0 + K / biquadA[biq_reso] + K * K); + biquadA[biq_aB0] = K * K * norm; + biquadA[biq_aB1] = 2.0 * biquadA[biq_aB0]; + biquadA[biq_aB2] = biquadA[biq_aB0]; + biquadA[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadA[biq_bB2] = (1.0 - K / biquadA[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadB[biq_freq]); + norm = 1.0 / (1.0 + K / biquadB[biq_reso] + K * K); + biquadB[biq_aB0] = K * K * norm; + biquadB[biq_aB1] = 2.0 * biquadB[biq_aB0]; + biquadB[biq_aB2] = biquadB[biq_aB0]; + biquadB[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadB[biq_bB2] = (1.0 - K / biquadB[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadC[biq_freq]); + norm = 1.0 / (1.0 + K / biquadC[biq_reso] + K * K); + biquadC[biq_aB0] = K * K * norm; + biquadC[biq_aB1] = 2.0 * biquadC[biq_aB0]; + biquadC[biq_aB2] = biquadC[biq_aB0]; + biquadC[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadC[biq_bB2] = (1.0 - K / biquadC[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadD[biq_freq]); + norm = 1.0 / (1.0 + K / biquadD[biq_reso] + K * K); + biquadD[biq_aB0] = K * K * norm; + biquadD[biq_aB1] = 2.0 * biquadD[biq_aB0]; + biquadD[biq_aB2] = biquadD[biq_aB0]; + biquadD[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadD[biq_bB2] = (1.0 - K / biquadD[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadE[biq_freq]); + norm = 1.0 / (1.0 + K / biquadE[biq_reso] + K * K); + biquadE[biq_aB0] = K * K * norm; + biquadE[biq_aB1] = 2.0 * biquadE[biq_aB0]; + biquadE[biq_aB2] = biquadE[biq_aB0]; + biquadE[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadE[biq_bB2] = (1.0 - K / biquadE[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadF[biq_freq]); + norm = 1.0 / (1.0 + K / biquadF[biq_reso] + K * K); + biquadF[biq_aB0] = K * K * norm; + biquadF[biq_aB1] = 2.0 * biquadF[biq_aB0]; + biquadF[biq_aB2] = biquadF[biq_aB0]; + biquadF[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadF[biq_bB2] = (1.0 - K / biquadF[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadG[biq_freq]); + norm = 1.0 / (1.0 + K / biquadG[biq_reso] + K * K); + biquadG[biq_aB0] = K * K * norm; + biquadG[biq_aB1] = 2.0 * biquadG[biq_aB0]; + biquadG[biq_aB2] = biquadG[biq_aB0]; + biquadG[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadG[biq_bB2] = (1.0 - K / biquadG[biq_reso] + K * K) * norm; + + bool bypass = (A == 1.0); + highA = highB; + highB = C*reso; + if (highB > 0.0) bypass = false; + lowA = lowB; + lowB = D*reso; + if (lowB < 1.0) bypass = false; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + + double temp = (double)sampleFrames/inFramesToProcess; + + biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); + biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); + biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); + biquadA[biq_b1] = (biquadA[biq_bA1]*temp)+(biquadA[biq_bB1]*(1.0-temp)); + biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); + + biquadB[biq_a0] = (biquadB[biq_aA0]*temp)+(biquadB[biq_aB0]*(1.0-temp)); + biquadB[biq_a1] = (biquadB[biq_aA1]*temp)+(biquadB[biq_aB1]*(1.0-temp)); + biquadB[biq_a2] = (biquadB[biq_aA2]*temp)+(biquadB[biq_aB2]*(1.0-temp)); + biquadB[biq_b1] = (biquadB[biq_bA1]*temp)+(biquadB[biq_bB1]*(1.0-temp)); + biquadB[biq_b2] = (biquadB[biq_bA2]*temp)+(biquadB[biq_bB2]*(1.0-temp)); + + biquadC[biq_a0] = (biquadC[biq_aA0]*temp)+(biquadC[biq_aB0]*(1.0-temp)); + biquadC[biq_a1] = (biquadC[biq_aA1]*temp)+(biquadC[biq_aB1]*(1.0-temp)); + biquadC[biq_a2] = (biquadC[biq_aA2]*temp)+(biquadC[biq_aB2]*(1.0-temp)); + biquadC[biq_b1] = (biquadC[biq_bA1]*temp)+(biquadC[biq_bB1]*(1.0-temp)); + biquadC[biq_b2] = (biquadC[biq_bA2]*temp)+(biquadC[biq_bB2]*(1.0-temp)); + + biquadD[biq_a0] = (biquadD[biq_aA0]*temp)+(biquadD[biq_aB0]*(1.0-temp)); + biquadD[biq_a1] = (biquadD[biq_aA1]*temp)+(biquadD[biq_aB1]*(1.0-temp)); + biquadD[biq_a2] = (biquadD[biq_aA2]*temp)+(biquadD[biq_aB2]*(1.0-temp)); + biquadD[biq_b1] = (biquadD[biq_bA1]*temp)+(biquadD[biq_bB1]*(1.0-temp)); + biquadD[biq_b2] = (biquadD[biq_bA2]*temp)+(biquadD[biq_bB2]*(1.0-temp)); + + biquadE[biq_a0] = (biquadE[biq_aA0]*temp)+(biquadE[biq_aB0]*(1.0-temp)); + biquadE[biq_a1] = (biquadE[biq_aA1]*temp)+(biquadE[biq_aB1]*(1.0-temp)); + biquadE[biq_a2] = (biquadE[biq_aA2]*temp)+(biquadE[biq_aB2]*(1.0-temp)); + biquadE[biq_b1] = (biquadE[biq_bA1]*temp)+(biquadE[biq_bB1]*(1.0-temp)); + biquadE[biq_b2] = (biquadE[biq_bA2]*temp)+(biquadE[biq_bB2]*(1.0-temp)); + + biquadF[biq_a0] = (biquadF[biq_aA0]*temp)+(biquadF[biq_aB0]*(1.0-temp)); + biquadF[biq_a1] = (biquadF[biq_aA1]*temp)+(biquadF[biq_aB1]*(1.0-temp)); + biquadF[biq_a2] = (biquadF[biq_aA2]*temp)+(biquadF[biq_aB2]*(1.0-temp)); + biquadF[biq_b1] = (biquadF[biq_bA1]*temp)+(biquadF[biq_bB1]*(1.0-temp)); + biquadF[biq_b2] = (biquadF[biq_bA2]*temp)+(biquadF[biq_bB2]*(1.0-temp)); + + biquadG[biq_a0] = (biquadG[biq_aA0]*temp)+(biquadG[biq_aB0]*(1.0-temp)); + biquadG[biq_a1] = (biquadG[biq_aA1]*temp)+(biquadG[biq_aB1]*(1.0-temp)); + biquadG[biq_a2] = (biquadG[biq_aA2]*temp)+(biquadG[biq_aB2]*(1.0-temp)); + biquadG[biq_b1] = (biquadG[biq_bA1]*temp)+(biquadG[biq_bB1]*(1.0-temp)); + biquadG[biq_b2] = (biquadG[biq_bA2]*temp)+(biquadG[biq_bB2]*(1.0-temp)); + + //this is the interpolation code for the biquad + double high = (highA*temp)+(highB*(1.0-temp)); + double low = (lowA*temp)+(lowB*(1.0-temp)); + + double outSample = (inputSampleL * biquadA[biq_a0]) + biquadA[biq_sL1]; + biquadA[biq_sL1] = (inputSampleL * biquadA[biq_a1]) - (outSample * biquadA[biq_b1]) + biquadA[biq_sL2]; + biquadA[biq_sL2] = (inputSampleL * biquadA[biq_a2]) - (outSample * biquadA[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadA[biq_a0]) + biquadA[biq_sR1]; + biquadA[biq_sR1] = (inputSampleR * biquadA[biq_a1]) - (outSample * biquadA[biq_b1]) + biquadA[biq_sR2]; + biquadA[biq_sR2] = (inputSampleR * biquadA[biq_a2]) - (outSample * biquadA[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadB[biq_a0]) + biquadB[biq_sL1]; + biquadB[biq_sL1] = (inputSampleL * biquadB[biq_a1]) - (outSample * biquadB[biq_b1]) + biquadB[biq_sL2]; + biquadB[biq_sL2] = (inputSampleL * biquadB[biq_a2]) - (outSample * biquadB[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadB[biq_a0]) + biquadB[biq_sR1]; + biquadB[biq_sR1] = (inputSampleR * biquadB[biq_a1]) - (outSample * biquadB[biq_b1]) + biquadB[biq_sR2]; + biquadB[biq_sR2] = (inputSampleR * biquadB[biq_a2]) - (outSample * biquadB[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadC[biq_a0]) + biquadC[biq_sL1]; + biquadC[biq_sL1] = (inputSampleL * biquadC[biq_a1]) - (outSample * biquadC[biq_b1]) + biquadC[biq_sL2]; + biquadC[biq_sL2] = (inputSampleL * biquadC[biq_a2]) - (outSample * biquadC[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadC[biq_a0]) + biquadC[biq_sR1]; + biquadC[biq_sR1] = (inputSampleR * biquadC[biq_a1]) - (outSample * biquadC[biq_b1]) + biquadC[biq_sR2]; + biquadC[biq_sR2] = (inputSampleR * biquadC[biq_a2]) - (outSample * biquadC[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadD[biq_a0]) + biquadD[biq_sL1]; + biquadD[biq_sL1] = (inputSampleL * biquadD[biq_a1]) - (outSample * biquadD[biq_b1]) + biquadD[biq_sL2]; + biquadD[biq_sL2] = (inputSampleL * biquadD[biq_a2]) - (outSample * biquadD[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadD[biq_a0]) + biquadD[biq_sR1]; + biquadD[biq_sR1] = (inputSampleR * biquadD[biq_a1]) - (outSample * biquadD[biq_b1]) + biquadD[biq_sR2]; + biquadD[biq_sR2] = (inputSampleR * biquadD[biq_a2]) - (outSample * biquadD[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadE[biq_a0]) + biquadE[biq_sL1]; + biquadE[biq_sL1] = (inputSampleL * biquadE[biq_a1]) - (outSample * biquadE[biq_b1]) + biquadE[biq_sL2]; + biquadE[biq_sL2] = (inputSampleL * biquadE[biq_a2]) - (outSample * biquadE[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadE[biq_a0]) + biquadE[biq_sR1]; + biquadE[biq_sR1] = (inputSampleR * biquadE[biq_a1]) - (outSample * biquadE[biq_b1]) + biquadE[biq_sR2]; + biquadE[biq_sR2] = (inputSampleR * biquadE[biq_a2]) - (outSample * biquadE[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadF[biq_a0]) + biquadF[biq_sL1]; + biquadF[biq_sL1] = (inputSampleL * biquadF[biq_a1]) - (outSample * biquadF[biq_b1]) + biquadF[biq_sL2]; + biquadF[biq_sL2] = (inputSampleL * biquadF[biq_a2]) - (outSample * biquadF[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadF[biq_a0]) + biquadF[biq_sR1]; + biquadF[biq_sR1] = (inputSampleR * biquadF[biq_a1]) - (outSample * biquadF[biq_b1]) + biquadF[biq_sR2]; + biquadF[biq_sR2] = (inputSampleR * biquadF[biq_a2]) - (outSample * biquadF[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadG[biq_a0]) + biquadG[biq_sL1]; + biquadG[biq_sL1] = (inputSampleL * biquadG[biq_a1]) - (outSample * biquadG[biq_b1]) + biquadG[biq_sL2]; + biquadG[biq_sL2] = (inputSampleL * biquadG[biq_a2]) - (outSample * biquadG[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadG[biq_a0]) + biquadG[biq_sR1]; + biquadG[biq_sR1] = (inputSampleR * biquadG[biq_a1]) - (outSample * biquadG[biq_b1]) + biquadG[biq_sR2]; + biquadG[biq_sR2] = (inputSampleR * biquadG[biq_a2]) - (outSample * biquadG[biq_b2]); + inputSampleR = outSample; + + if (bypass) { + inputSampleL = drySampleL; + inputSampleR = drySampleR; + } else { + inputSampleL = (inputSampleL * low) + ((drySampleL - inputSampleL)*high); + inputSampleR = (inputSampleR * low) + ((drySampleR - inputSampleR)*high); + } + + //begin 32 bit stereo floating point dither + int expon; frexpf((float)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + frexpf((float)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither + + *out1 = inputSampleL; + *out2 = inputSampleR; + + in1++; + in2++; + out1++; + out2++; + } +} + +void Isolator2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + + biquadA[biq_freq] = pow(A,(2.0*sqrt(overallscale)))*0.4999; + if (biquadA[biq_freq] < 0.0005) biquadA[biq_freq] = 0.0005; + biquadG[biq_freq] = biquadF[biq_freq] = biquadE[biq_freq] = biquadD[biq_freq] = biquadC[biq_freq] = biquadB[biq_freq] = biquadA[biq_freq]; + + double reso = pow(B,2); + double resoBoost = reso+1.0; + reso = 1.0-reso; + + biquadA[biq_reso] = 4.46570214 * resoBoost; + biquadB[biq_reso] = 1.51387132 * resoBoost; + biquadC[biq_reso] = 0.93979296 * resoBoost; + biquadD[biq_reso] = 0.70710678 * resoBoost; + biquadE[biq_reso] = 0.59051105 * resoBoost; + biquadF[biq_reso] = 0.52972649 * resoBoost; + biquadG[biq_reso] = 0.50316379 * resoBoost; + + biquadA[biq_aA0] = biquadA[biq_aB0]; + biquadA[biq_aA1] = biquadA[biq_aB1]; + biquadA[biq_aA2] = biquadA[biq_aB2]; + biquadA[biq_bA1] = biquadA[biq_bB1]; + biquadA[biq_bA2] = biquadA[biq_bB2]; + + biquadB[biq_aA0] = biquadB[biq_aB0]; + biquadB[biq_aA1] = biquadB[biq_aB1]; + biquadB[biq_aA2] = biquadB[biq_aB2]; + biquadB[biq_bA1] = biquadB[biq_bB1]; + biquadB[biq_bA2] = biquadB[biq_bB2]; + + biquadC[biq_aA0] = biquadC[biq_aB0]; + biquadC[biq_aA1] = biquadC[biq_aB1]; + biquadC[biq_aA2] = biquadC[biq_aB2]; + biquadC[biq_bA1] = biquadC[biq_bB1]; + biquadC[biq_bA2] = biquadC[biq_bB2]; + + biquadD[biq_aA0] = biquadD[biq_aB0]; + biquadD[biq_aA1] = biquadD[biq_aB1]; + biquadD[biq_aA2] = biquadD[biq_aB2]; + biquadD[biq_bA1] = biquadD[biq_bB1]; + biquadD[biq_bA2] = biquadD[biq_bB2]; + + biquadE[biq_aA0] = biquadE[biq_aB0]; + biquadE[biq_aA1] = biquadE[biq_aB1]; + biquadE[biq_aA2] = biquadE[biq_aB2]; + biquadE[biq_bA1] = biquadE[biq_bB1]; + biquadE[biq_bA2] = biquadE[biq_bB2]; + + biquadF[biq_aA0] = biquadF[biq_aB0]; + biquadF[biq_aA1] = biquadF[biq_aB1]; + biquadF[biq_aA2] = biquadF[biq_aB2]; + biquadF[biq_bA1] = biquadF[biq_bB1]; + biquadF[biq_bA2] = biquadF[biq_bB2]; + + biquadG[biq_aA0] = biquadG[biq_aB0]; + biquadG[biq_aA1] = biquadG[biq_aB1]; + biquadG[biq_aA2] = biquadG[biq_aB2]; + biquadG[biq_bA1] = biquadG[biq_bB1]; + biquadG[biq_bA2] = biquadG[biq_bB2]; + + //previous run through the buffer is still in the filter, so we move it + //to the A section and now it's the new starting point. + double K = tan(M_PI * biquadA[biq_freq]); + double norm = 1.0 / (1.0 + K / biquadA[biq_reso] + K * K); + biquadA[biq_aB0] = K * K * norm; + biquadA[biq_aB1] = 2.0 * biquadA[biq_aB0]; + biquadA[biq_aB2] = biquadA[biq_aB0]; + biquadA[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadA[biq_bB2] = (1.0 - K / biquadA[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadB[biq_freq]); + norm = 1.0 / (1.0 + K / biquadB[biq_reso] + K * K); + biquadB[biq_aB0] = K * K * norm; + biquadB[biq_aB1] = 2.0 * biquadB[biq_aB0]; + biquadB[biq_aB2] = biquadB[biq_aB0]; + biquadB[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadB[biq_bB2] = (1.0 - K / biquadB[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadC[biq_freq]); + norm = 1.0 / (1.0 + K / biquadC[biq_reso] + K * K); + biquadC[biq_aB0] = K * K * norm; + biquadC[biq_aB1] = 2.0 * biquadC[biq_aB0]; + biquadC[biq_aB2] = biquadC[biq_aB0]; + biquadC[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadC[biq_bB2] = (1.0 - K / biquadC[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadD[biq_freq]); + norm = 1.0 / (1.0 + K / biquadD[biq_reso] + K * K); + biquadD[biq_aB0] = K * K * norm; + biquadD[biq_aB1] = 2.0 * biquadD[biq_aB0]; + biquadD[biq_aB2] = biquadD[biq_aB0]; + biquadD[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadD[biq_bB2] = (1.0 - K / biquadD[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadE[biq_freq]); + norm = 1.0 / (1.0 + K / biquadE[biq_reso] + K * K); + biquadE[biq_aB0] = K * K * norm; + biquadE[biq_aB1] = 2.0 * biquadE[biq_aB0]; + biquadE[biq_aB2] = biquadE[biq_aB0]; + biquadE[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadE[biq_bB2] = (1.0 - K / biquadE[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadF[biq_freq]); + norm = 1.0 / (1.0 + K / biquadF[biq_reso] + K * K); + biquadF[biq_aB0] = K * K * norm; + biquadF[biq_aB1] = 2.0 * biquadF[biq_aB0]; + biquadF[biq_aB2] = biquadF[biq_aB0]; + biquadF[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadF[biq_bB2] = (1.0 - K / biquadF[biq_reso] + K * K) * norm; + + K = tan(M_PI * biquadG[biq_freq]); + norm = 1.0 / (1.0 + K / biquadG[biq_reso] + K * K); + biquadG[biq_aB0] = K * K * norm; + biquadG[biq_aB1] = 2.0 * biquadG[biq_aB0]; + biquadG[biq_aB2] = biquadG[biq_aB0]; + biquadG[biq_bB1] = 2.0 * (K * K - 1.0) * norm; + biquadG[biq_bB2] = (1.0 - K / biquadG[biq_reso] + K * K) * norm; + + bool bypass = (A == 1.0); + highA = highB; + highB = C*reso; + if (highB > 0.0) bypass = false; + lowA = lowB; + lowB = D*reso; + if (lowB < 1.0) bypass = false; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + + double temp = (double)sampleFrames/inFramesToProcess; + + biquadA[biq_a0] = (biquadA[biq_aA0]*temp)+(biquadA[biq_aB0]*(1.0-temp)); + biquadA[biq_a1] = (biquadA[biq_aA1]*temp)+(biquadA[biq_aB1]*(1.0-temp)); + biquadA[biq_a2] = (biquadA[biq_aA2]*temp)+(biquadA[biq_aB2]*(1.0-temp)); + biquadA[biq_b1] = (biquadA[biq_bA1]*temp)+(biquadA[biq_bB1]*(1.0-temp)); + biquadA[biq_b2] = (biquadA[biq_bA2]*temp)+(biquadA[biq_bB2]*(1.0-temp)); + + biquadB[biq_a0] = (biquadB[biq_aA0]*temp)+(biquadB[biq_aB0]*(1.0-temp)); + biquadB[biq_a1] = (biquadB[biq_aA1]*temp)+(biquadB[biq_aB1]*(1.0-temp)); + biquadB[biq_a2] = (biquadB[biq_aA2]*temp)+(biquadB[biq_aB2]*(1.0-temp)); + biquadB[biq_b1] = (biquadB[biq_bA1]*temp)+(biquadB[biq_bB1]*(1.0-temp)); + biquadB[biq_b2] = (biquadB[biq_bA2]*temp)+(biquadB[biq_bB2]*(1.0-temp)); + + biquadC[biq_a0] = (biquadC[biq_aA0]*temp)+(biquadC[biq_aB0]*(1.0-temp)); + biquadC[biq_a1] = (biquadC[biq_aA1]*temp)+(biquadC[biq_aB1]*(1.0-temp)); + biquadC[biq_a2] = (biquadC[biq_aA2]*temp)+(biquadC[biq_aB2]*(1.0-temp)); + biquadC[biq_b1] = (biquadC[biq_bA1]*temp)+(biquadC[biq_bB1]*(1.0-temp)); + biquadC[biq_b2] = (biquadC[biq_bA2]*temp)+(biquadC[biq_bB2]*(1.0-temp)); + + biquadD[biq_a0] = (biquadD[biq_aA0]*temp)+(biquadD[biq_aB0]*(1.0-temp)); + biquadD[biq_a1] = (biquadD[biq_aA1]*temp)+(biquadD[biq_aB1]*(1.0-temp)); + biquadD[biq_a2] = (biquadD[biq_aA2]*temp)+(biquadD[biq_aB2]*(1.0-temp)); + biquadD[biq_b1] = (biquadD[biq_bA1]*temp)+(biquadD[biq_bB1]*(1.0-temp)); + biquadD[biq_b2] = (biquadD[biq_bA2]*temp)+(biquadD[biq_bB2]*(1.0-temp)); + + biquadE[biq_a0] = (biquadE[biq_aA0]*temp)+(biquadE[biq_aB0]*(1.0-temp)); + biquadE[biq_a1] = (biquadE[biq_aA1]*temp)+(biquadE[biq_aB1]*(1.0-temp)); + biquadE[biq_a2] = (biquadE[biq_aA2]*temp)+(biquadE[biq_aB2]*(1.0-temp)); + biquadE[biq_b1] = (biquadE[biq_bA1]*temp)+(biquadE[biq_bB1]*(1.0-temp)); + biquadE[biq_b2] = (biquadE[biq_bA2]*temp)+(biquadE[biq_bB2]*(1.0-temp)); + + biquadF[biq_a0] = (biquadF[biq_aA0]*temp)+(biquadF[biq_aB0]*(1.0-temp)); + biquadF[biq_a1] = (biquadF[biq_aA1]*temp)+(biquadF[biq_aB1]*(1.0-temp)); + biquadF[biq_a2] = (biquadF[biq_aA2]*temp)+(biquadF[biq_aB2]*(1.0-temp)); + biquadF[biq_b1] = (biquadF[biq_bA1]*temp)+(biquadF[biq_bB1]*(1.0-temp)); + biquadF[biq_b2] = (biquadF[biq_bA2]*temp)+(biquadF[biq_bB2]*(1.0-temp)); + + biquadG[biq_a0] = (biquadG[biq_aA0]*temp)+(biquadG[biq_aB0]*(1.0-temp)); + biquadG[biq_a1] = (biquadG[biq_aA1]*temp)+(biquadG[biq_aB1]*(1.0-temp)); + biquadG[biq_a2] = (biquadG[biq_aA2]*temp)+(biquadG[biq_aB2]*(1.0-temp)); + biquadG[biq_b1] = (biquadG[biq_bA1]*temp)+(biquadG[biq_bB1]*(1.0-temp)); + biquadG[biq_b2] = (biquadG[biq_bA2]*temp)+(biquadG[biq_bB2]*(1.0-temp)); + + //this is the interpolation code for the biquad + double high = (highA*temp)+(highB*(1.0-temp)); + double low = (lowA*temp)+(lowB*(1.0-temp)); + + double outSample = (inputSampleL * biquadA[biq_a0]) + biquadA[biq_sL1]; + biquadA[biq_sL1] = (inputSampleL * biquadA[biq_a1]) - (outSample * biquadA[biq_b1]) + biquadA[biq_sL2]; + biquadA[biq_sL2] = (inputSampleL * biquadA[biq_a2]) - (outSample * biquadA[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadA[biq_a0]) + biquadA[biq_sR1]; + biquadA[biq_sR1] = (inputSampleR * biquadA[biq_a1]) - (outSample * biquadA[biq_b1]) + biquadA[biq_sR2]; + biquadA[biq_sR2] = (inputSampleR * biquadA[biq_a2]) - (outSample * biquadA[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadB[biq_a0]) + biquadB[biq_sL1]; + biquadB[biq_sL1] = (inputSampleL * biquadB[biq_a1]) - (outSample * biquadB[biq_b1]) + biquadB[biq_sL2]; + biquadB[biq_sL2] = (inputSampleL * biquadB[biq_a2]) - (outSample * biquadB[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadB[biq_a0]) + biquadB[biq_sR1]; + biquadB[biq_sR1] = (inputSampleR * biquadB[biq_a1]) - (outSample * biquadB[biq_b1]) + biquadB[biq_sR2]; + biquadB[biq_sR2] = (inputSampleR * biquadB[biq_a2]) - (outSample * biquadB[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadC[biq_a0]) + biquadC[biq_sL1]; + biquadC[biq_sL1] = (inputSampleL * biquadC[biq_a1]) - (outSample * biquadC[biq_b1]) + biquadC[biq_sL2]; + biquadC[biq_sL2] = (inputSampleL * biquadC[biq_a2]) - (outSample * biquadC[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadC[biq_a0]) + biquadC[biq_sR1]; + biquadC[biq_sR1] = (inputSampleR * biquadC[biq_a1]) - (outSample * biquadC[biq_b1]) + biquadC[biq_sR2]; + biquadC[biq_sR2] = (inputSampleR * biquadC[biq_a2]) - (outSample * biquadC[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadD[biq_a0]) + biquadD[biq_sL1]; + biquadD[biq_sL1] = (inputSampleL * biquadD[biq_a1]) - (outSample * biquadD[biq_b1]) + biquadD[biq_sL2]; + biquadD[biq_sL2] = (inputSampleL * biquadD[biq_a2]) - (outSample * biquadD[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadD[biq_a0]) + biquadD[biq_sR1]; + biquadD[biq_sR1] = (inputSampleR * biquadD[biq_a1]) - (outSample * biquadD[biq_b1]) + biquadD[biq_sR2]; + biquadD[biq_sR2] = (inputSampleR * biquadD[biq_a2]) - (outSample * biquadD[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadE[biq_a0]) + biquadE[biq_sL1]; + biquadE[biq_sL1] = (inputSampleL * biquadE[biq_a1]) - (outSample * biquadE[biq_b1]) + biquadE[biq_sL2]; + biquadE[biq_sL2] = (inputSampleL * biquadE[biq_a2]) - (outSample * biquadE[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadE[biq_a0]) + biquadE[biq_sR1]; + biquadE[biq_sR1] = (inputSampleR * biquadE[biq_a1]) - (outSample * biquadE[biq_b1]) + biquadE[biq_sR2]; + biquadE[biq_sR2] = (inputSampleR * biquadE[biq_a2]) - (outSample * biquadE[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadF[biq_a0]) + biquadF[biq_sL1]; + biquadF[biq_sL1] = (inputSampleL * biquadF[biq_a1]) - (outSample * biquadF[biq_b1]) + biquadF[biq_sL2]; + biquadF[biq_sL2] = (inputSampleL * biquadF[biq_a2]) - (outSample * biquadF[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadF[biq_a0]) + biquadF[biq_sR1]; + biquadF[biq_sR1] = (inputSampleR * biquadF[biq_a1]) - (outSample * biquadF[biq_b1]) + biquadF[biq_sR2]; + biquadF[biq_sR2] = (inputSampleR * biquadF[biq_a2]) - (outSample * biquadF[biq_b2]); + inputSampleR = outSample; + + outSample = (inputSampleL * biquadG[biq_a0]) + biquadG[biq_sL1]; + biquadG[biq_sL1] = (inputSampleL * biquadG[biq_a1]) - (outSample * biquadG[biq_b1]) + biquadG[biq_sL2]; + biquadG[biq_sL2] = (inputSampleL * biquadG[biq_a2]) - (outSample * biquadG[biq_b2]); + inputSampleL = outSample; + outSample = (inputSampleR * biquadG[biq_a0]) + biquadG[biq_sR1]; + biquadG[biq_sR1] = (inputSampleR * biquadG[biq_a1]) - (outSample * biquadG[biq_b1]) + biquadG[biq_sR2]; + biquadG[biq_sR2] = (inputSampleR * biquadG[biq_a2]) - (outSample * biquadG[biq_b2]); + inputSampleR = outSample; + + if (bypass) { + inputSampleL = drySampleL; + inputSampleR = drySampleR; + } else { + inputSampleL = (inputSampleL * low) + ((drySampleL - inputSampleL)*high); + inputSampleR = (inputSampleR * low) + ((drySampleR - inputSampleR)*high); + } + + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither + + *out1 = inputSampleL; + *out2 = inputSampleR; + + in1++; + in2++; + out1++; + out2++; + } +} diff --git a/plugins/MacSignedVST/Logical4/source/Logical4.cpp b/plugins/MacSignedVST/Logical4/source/Logical4.cpp index 15d185bea..72da4ad93 100755 --- a/plugins/MacSignedVST/Logical4/source/Logical4.cpp +++ b/plugins/MacSignedVST/Logical4/source/Logical4.cpp @@ -78,8 +78,8 @@ Logical4::Logical4(audioMasterCallback audioMaster) : gcount = 0; //end Power Sags fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Logical4/source/Logical4Proc.cpp b/plugins/MacSignedVST/Logical4/source/Logical4Proc.cpp index 5d079f36b..df5c110f4 100755 --- a/plugins/MacSignedVST/Logical4/source/Logical4Proc.cpp +++ b/plugins/MacSignedVST/Logical4/source/Logical4Proc.cpp @@ -17,8 +17,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -119,44 +119,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -871,14 +835,14 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -900,8 +864,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -1001,44 +965,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1752,16 +1680,14 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Loud/source/LoudProc.cpp b/plugins/MacSignedVST/Loud/source/LoudProc.cpp index 85d98996d..906f51dbd 100755 --- a/plugins/MacSignedVST/Loud/source/LoudProc.cpp +++ b/plugins/MacSignedVST/Loud/source/LoudProc.cpp @@ -21,8 +21,8 @@ void Loud::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; @@ -138,8 +138,8 @@ void Loud::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; diff --git a/plugins/MacSignedVST/Lowpass/source/Lowpass.cpp b/plugins/MacSignedVST/Lowpass/source/Lowpass.cpp index 18064fcae..9b6a6f4eb 100755 --- a/plugins/MacSignedVST/Lowpass/source/Lowpass.cpp +++ b/plugins/MacSignedVST/Lowpass/source/Lowpass.cpp @@ -19,8 +19,8 @@ Lowpass::Lowpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/Lowpass/source/Lowpass.h b/plugins/MacSignedVST/Lowpass/source/Lowpass.h index 40ac45681..f9d4ec8c7 100755 --- a/plugins/MacSignedVST/Lowpass/source/Lowpass.h +++ b/plugins/MacSignedVST/Lowpass/source/Lowpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Lowpass/source/LowpassProc.cpp b/plugins/MacSignedVST/Lowpass/source/LowpassProc.cpp index bcc369049..ea450b239 100755 --- a/plugins/MacSignedVST/Lowpass/source/LowpassProc.cpp +++ b/plugins/MacSignedVST/Lowpass/source/LowpassProc.cpp @@ -41,44 +41,8 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -120,14 +84,14 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -173,44 +137,8 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -252,16 +180,14 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/MacSignedVST/Lowpass2/source/Lowpass2Proc.cpp b/plugins/MacSignedVST/Lowpass2/source/Lowpass2Proc.cpp index e46b16e75..1dd3af06f 100755 --- a/plugins/MacSignedVST/Lowpass2/source/Lowpass2Proc.cpp +++ b/plugins/MacSignedVST/Lowpass2/source/Lowpass2Proc.cpp @@ -38,8 +38,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -209,8 +209,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -248,8 +248,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp b/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp index 086b1741e..c8d0add39 100755 --- a/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp +++ b/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp @@ -37,8 +37,8 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/MV/source/MVProc.cpp b/plugins/MacSignedVST/MV/source/MVProc.cpp index 00082b487..11da2fce9 100755 --- a/plugins/MacSignedVST/MV/source/MVProc.cpp +++ b/plugins/MacSignedVST/MV/source/MVProc.cpp @@ -31,8 +31,8 @@ void MV::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -827,8 +827,8 @@ void MV::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; diff --git a/plugins/MacSignedVST/MackEQ/source/MackEQ.h b/plugins/MacSignedVST/MackEQ/source/MackEQ.h index 9447e67f3..d413503b3 100755 --- a/plugins/MacSignedVST/MackEQ/source/MackEQ.h +++ b/plugins/MacSignedVST/MackEQ/source/MackEQ.h @@ -56,22 +56,22 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleCL; - long double iirSampleDL; - long double iirSampleEL; - long double iirSampleFL; - long double iirSampleAR; - long double iirSampleBR; - long double iirSampleCR; - long double iirSampleDR; - long double iirSampleER; - long double iirSampleFR; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/MackEQ/source/MackEQProc.cpp b/plugins/MacSignedVST/MackEQ/source/MackEQProc.cpp index 6713aed49..00466fda1 100755 --- a/plugins/MacSignedVST/MackEQ/source/MackEQProc.cpp +++ b/plugins/MacSignedVST/MackEQ/source/MackEQProc.cpp @@ -73,12 +73,12 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -90,10 +90,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -123,10 +123,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -149,11 +149,11 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -294,12 +294,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -311,10 +311,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -344,10 +344,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -370,11 +370,11 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -431,12 +431,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Mackity/source/Mackity.h b/plugins/MacSignedVST/Mackity/source/Mackity.h index f6ecb608a..338df8de9 100755 --- a/plugins/MacSignedVST/Mackity/source/Mackity.h +++ b/plugins/MacSignedVST/Mackity/source/Mackity.h @@ -54,12 +54,12 @@ private: std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; - long double biquadA[15]; - long double biquadB[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Mackity/source/MackityProc.cpp b/plugins/MacSignedVST/Mackity/source/MackityProc.cpp index 97a9b7fb6..ff7c1631a 100755 --- a/plugins/MacSignedVST/Mackity/source/MackityProc.cpp +++ b/plugins/MacSignedVST/Mackity/source/MackityProc.cpp @@ -47,10 +47,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -61,10 +61,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -148,10 +148,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -162,10 +162,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -191,12 +191,12 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (outPad != 1.0) {inputSampleL *= outPad; inputSampleR *= outPad;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/MatrixVerb/source/MatrixVerb.h b/plugins/MacSignedVST/MatrixVerb/source/MatrixVerb.h index 3b2c0a62b..3f3b8298c 100755 --- a/plugins/MacSignedVST/MatrixVerb/source/MatrixVerb.h +++ b/plugins/MacSignedVST/MatrixVerb/source/MatrixVerb.h @@ -58,9 +58,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacSignedVST/MatrixVerb/source/MatrixVerbProc.cpp b/plugins/MacSignedVST/MatrixVerb/source/MatrixVerbProc.cpp index 15ee2871e..4099a1853 100755 --- a/plugins/MacSignedVST/MatrixVerb/source/MatrixVerbProc.cpp +++ b/plugins/MacSignedVST/MatrixVerb/source/MatrixVerbProc.cpp @@ -77,12 +77,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -91,12 +91,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -108,15 +108,15 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -470,12 +470,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -484,12 +484,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -501,15 +501,15 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -775,12 +775,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Melt/source/Melt.cpp b/plugins/MacSignedVST/Melt/source/Melt.cpp index 35ede1e0d..b2f8301bc 100755 --- a/plugins/MacSignedVST/Melt/source/Melt.cpp +++ b/plugins/MacSignedVST/Melt/source/Melt.cpp @@ -26,8 +26,8 @@ Melt::Melt(audioMasterCallback audioMaster) : slowCount = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Melt/source/Melt.h b/plugins/MacSignedVST/Melt/source/Melt.h index af11f0fc5..07cf0075c 100755 --- a/plugins/MacSignedVST/Melt/source/Melt.h +++ b/plugins/MacSignedVST/Melt/source/Melt.h @@ -70,8 +70,8 @@ private: int slowCount; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Melt/source/MeltProc.cpp b/plugins/MacSignedVST/Melt/source/MeltProc.cpp index 8a55732df..c990386b6 100755 --- a/plugins/MacSignedVST/Melt/source/MeltProc.cpp +++ b/plugins/MacSignedVST/Melt/source/MeltProc.cpp @@ -22,10 +22,10 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -63,44 +63,8 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -268,14 +232,14 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -302,10 +266,10 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -343,44 +307,8 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -548,16 +476,14 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/MidSide/source/MidSide.cpp b/plugins/MacSignedVST/MidSide/source/MidSide.cpp index 8f61cffda..4bb31183d 100755 --- a/plugins/MacSignedVST/MidSide/source/MidSide.cpp +++ b/plugins/MacSignedVST/MidSide/source/MidSide.cpp @@ -13,8 +13,8 @@ MidSide::MidSide(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/MidSide/source/MidSide.h b/plugins/MacSignedVST/MidSide/source/MidSide.h index 4d139c874..086fbea98 100755 --- a/plugins/MacSignedVST/MidSide/source/MidSide.h +++ b/plugins/MacSignedVST/MidSide/source/MidSide.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp b/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp index cca7a5cda..46fb1397e 100755 --- a/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp +++ b/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp @@ -15,11 +15,11 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -28,44 +28,8 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -75,7 +39,7 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -100,11 +64,11 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -113,44 +77,8 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -160,7 +88,7 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/MacSignedVST/MoNoam/source/MoNoamProc.cpp b/plugins/MacSignedVST/MoNoam/source/MoNoamProc.cpp index 105d34b15..64cc63a99 100755 --- a/plugins/MacSignedVST/MoNoam/source/MoNoamProc.cpp +++ b/plugins/MacSignedVST/MoNoam/source/MoNoamProc.cpp @@ -18,13 +18,13 @@ void MoNoam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; @@ -69,13 +69,13 @@ void MoNoam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/MacSignedVST/Mojo/source/MojoProc.cpp b/plugins/MacSignedVST/Mojo/source/MojoProc.cpp index 60f986d64..6687feea8 100755 --- a/plugins/MacSignedVST/Mojo/source/MojoProc.cpp +++ b/plugins/MacSignedVST/Mojo/source/MojoProc.cpp @@ -18,8 +18,8 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); @@ -65,8 +65,8 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); diff --git a/plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/xcshareddata/xcschemes/Monitoring.xcscheme b/plugins/MacSignedVST/Monitoring/Monitoring.xcodeproj/xcshareddata/xcschemes/Monitoring.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Monitoring/source/Monitoring.h b/plugins/MacSignedVST/Monitoring/source/Monitoring.h index f92a46b42..8dd0210fc 100755 --- a/plugins/MacSignedVST/Monitoring/source/Monitoring.h +++ b/plugins/MacSignedVST/Monitoring/source/Monitoring.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD double aL[1503], bL[1503], cL[1503], dL[1503]; double aR[1503], bR[1503], cR[1503], dR[1503]; @@ -73,8 +73,8 @@ private: double iirSampleTR, iirSampleUR, iirSampleVR; double iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquadL[11]; - long double biquadR[11]; + double biquadL[11]; + double biquadR[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/MacSignedVST/Monitoring/source/MonitoringProc.cpp b/plugins/MacSignedVST/Monitoring/source/MonitoringProc.cpp index ddb1f6f98..397d31b12 100755 --- a/plugins/MacSignedVST/Monitoring/source/MonitoringProc.cpp +++ b/plugins/MacSignedVST/Monitoring/source/MonitoringProc.cpp @@ -48,8 +48,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -116,7 +116,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -289,8 +289,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -305,17 +305,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -337,9 +337,9 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -396,7 +396,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -415,17 +415,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -439,7 +439,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -448,7 +448,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -565,8 +565,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -633,7 +633,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -806,8 +806,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -822,17 +822,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -854,9 +854,9 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -913,7 +913,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -932,17 +932,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -956,7 +956,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -965,7 +965,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/MacSignedVST/Monitoring2/source/Monitoring2.h b/plugins/MacSignedVST/Monitoring2/source/Monitoring2.h index 34e9aac76..a1d6c5e4b 100755 --- a/plugins/MacSignedVST/Monitoring2/source/Monitoring2.h +++ b/plugins/MacSignedVST/Monitoring2/source/Monitoring2.h @@ -87,7 +87,7 @@ private: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/MacSignedVST/Monitoring2/source/Monitoring2Proc.cpp b/plugins/MacSignedVST/Monitoring2/source/Monitoring2Proc.cpp index d9af88b6a..82325d164 100755 --- a/plugins/MacSignedVST/Monitoring2/source/Monitoring2Proc.cpp +++ b/plugins/MacSignedVST/Monitoring2/source/Monitoring2Proc.cpp @@ -42,8 +42,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -113,7 +113,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -286,8 +286,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -302,17 +302,17 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -334,9 +334,9 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -393,7 +393,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -525,8 +525,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -596,7 +596,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -769,8 +769,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -785,17 +785,17 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -817,9 +817,9 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -876,7 +876,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/MacSignedVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp b/plugins/MacSignedVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp index c2e097a11..0336c96dc 100755 --- a/plugins/MacSignedVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp +++ b/plugins/MacSignedVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp @@ -51,10 +51,10 @@ void MultiBandDistortion::processReplacing(float **inputs, float **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -296,10 +296,10 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -479,12 +479,12 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu inputSampleR *= outputGlobal; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.cpp b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.cpp index 409f98398..a0a9a061d 100755 --- a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.cpp +++ b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.cpp @@ -31,8 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.h b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.h index b3ecd9486..100f02bdb 100755 --- a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.h +++ b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeen.h @@ -70,8 +70,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeenProc.cpp b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeenProc.cpp index e124cb5ff..aebc1ba49 100755 --- a/plugins/MacSignedVST/NCSeventeen/source/NCSeventeenProc.cpp +++ b/plugins/MacSignedVST/NCSeventeen/source/NCSeventeenProc.cpp @@ -39,13 +39,13 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -59,44 +59,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -344,14 +308,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,13 +359,13 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -414,44 +378,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -699,16 +627,14 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp index e0b2d86d0..ffc731e21 100755 --- a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp +++ b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp @@ -14,8 +14,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -27,44 +27,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -248,8 +212,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -261,44 +225,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp b/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp index de15a19fa..58493f8a3 100755 --- a/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp +++ b/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp @@ -37,8 +37,8 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -214,8 +214,8 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; inputSampleL *= indrive; diff --git a/plugins/MacSignedVST/Nikola/source/NikolaProc.cpp b/plugins/MacSignedVST/Nikola/source/NikolaProc.cpp index 1b439c6e8..59738686d 100755 --- a/plugins/MacSignedVST/Nikola/source/NikolaProc.cpp +++ b/plugins/MacSignedVST/Nikola/source/NikolaProc.cpp @@ -20,12 +20,12 @@ void Nikola::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; @@ -1040,12 +1040,12 @@ void Nikola::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; else outlevelL = ((outlevelL * decay) + bridgerectifier) / (decay+1.0); diff --git a/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp b/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp index 3d6046485..50f3e85f9 100755 --- a/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp +++ b/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp @@ -25,8 +25,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -34,44 +34,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -135,8 +99,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -144,44 +108,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacSignedVST/Noise/source/Noise.cpp b/plugins/MacSignedVST/Noise/source/Noise.cpp index d955a290a..ebb384dbe 100755 --- a/plugins/MacSignedVST/Noise/source/Noise.cpp +++ b/plugins/MacSignedVST/Noise/source/Noise.cpp @@ -36,8 +36,8 @@ Noise::Noise(audioMasterCallback audioMaster) : flipR = false; filterflip = false; for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Noise/source/Noise.h b/plugins/MacSignedVST/Noise/source/Noise.h index 67c32bcf5..d14ef6305 100755 --- a/plugins/MacSignedVST/Noise/source/Noise.h +++ b/plugins/MacSignedVST/Noise/source/Noise.h @@ -81,8 +81,8 @@ private: double f[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Noise/source/NoiseProc.cpp b/plugins/MacSignedVST/Noise/source/NoiseProc.cpp index 31cba201a..0f75966cc 100755 --- a/plugins/MacSignedVST/Noise/source/NoiseProc.cpp +++ b/plugins/MacSignedVST/Noise/source/NoiseProc.cpp @@ -22,8 +22,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -111,44 +111,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -296,14 +260,14 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -330,8 +294,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -417,44 +381,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -602,16 +530,14 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.cpp b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.cpp index eb05bc33a..48eac47c8 100755 --- a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.cpp +++ b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.cpp @@ -195,8 +195,8 @@ NonlinearSpace::NonlinearSpace(audioMasterCallback audioMaster) : countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.h b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.h index dbaa0b3a4..b75c7a51d 100755 --- a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.h +++ b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpace.h @@ -208,8 +208,8 @@ private: double nonlin; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpaceProc.cpp b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpaceProc.cpp index f9df9fcc2..c7efecbc4 100755 --- a/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpaceProc.cpp +++ b/plugins/MacSignedVST/NonlinearSpace/source/NonlinearSpaceProc.cpp @@ -17,10 +17,10 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -99,44 +99,8 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -743,14 +707,14 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; @@ -773,10 +737,10 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -855,44 +819,8 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1499,16 +1427,14 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h index 39f785e9e..d27f0cc5c 100755 --- a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h +++ b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h @@ -53,8 +53,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; }; diff --git a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp index af4320013..f129dda8f 100755 --- a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp +++ b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp @@ -14,8 +14,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -29,44 +29,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -263,8 +227,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -278,44 +242,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; diff --git a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDither.h b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDither.h index 5ca0c0a85..184a9269e 100755 --- a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDither.h +++ b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDither.h @@ -55,8 +55,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp index 1a8071115..7e38de75c 100755 --- a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp +++ b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp @@ -29,8 +29,8 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -43,18 +43,18 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -70,7 +70,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -81,7 +81,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -183,8 +183,8 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -197,18 +197,18 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -224,7 +224,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -235,7 +235,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleL; + double outputSampleL; if (totalA < totalB) {bynL[hotbinA] += 1; outputSampleL = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSampleL = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -282,7 +282,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleR; + double outputSampleR; if (totalA < totalB) {bynR[hotbinA] += 1; outputSampleR = floor(inputSampleR);} else {bynR[hotbinB] += 1; outputSampleR = floor(inputSampleR+1);} //assign the relevant one to the delay line diff --git a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.cpp b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.cpp index 59e28246f..ea15e1fe2 100755 --- a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.cpp +++ b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.cpp @@ -25,8 +25,8 @@ OneCornerClip::OneCornerClip(audioMasterCallback audioMaster) : limitPosR = 0.0; limitNegR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.h b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.h index 4f039fa00..a69f185b2 100755 --- a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.h +++ b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClip.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClipProc.cpp b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClipProc.cpp index c45c69b91..194cab890 100755 --- a/plugins/MacSignedVST/OneCornerClip/source/OneCornerClipProc.cpp +++ b/plugins/MacSignedVST/OneCornerClip/source/OneCornerClipProc.cpp @@ -41,51 +41,15 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -154,14 +118,14 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither if (clipEngage == false) { @@ -214,52 +178,16 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -328,16 +256,14 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither if (clipEngage == false) { diff --git a/plugins/MacSignedVST/PDBuss/source/PDBuss.cpp b/plugins/MacSignedVST/PDBuss/source/PDBuss.cpp index 8b31d8b58..60bdec0bd 100755 --- a/plugins/MacSignedVST/PDBuss/source/PDBuss.cpp +++ b/plugins/MacSignedVST/PDBuss/source/PDBuss.cpp @@ -21,8 +21,8 @@ PDBuss::PDBuss(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PDBuss/source/PDBuss.h b/plugins/MacSignedVST/PDBuss/source/PDBuss.h index 3e6d9b8da..0b962dcfb 100755 --- a/plugins/MacSignedVST/PDBuss/source/PDBuss.h +++ b/plugins/MacSignedVST/PDBuss/source/PDBuss.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacSignedVST/PDBuss/source/PDBussProc.cpp b/plugins/MacSignedVST/PDBuss/source/PDBussProc.cpp index 6da8fa0c4..00b05af39 100755 --- a/plugins/MacSignedVST/PDBuss/source/PDBussProc.cpp +++ b/plugins/MacSignedVST/PDBuss/source/PDBussProc.cpp @@ -21,8 +21,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -152,8 +116,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -166,44 +130,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -250,16 +178,14 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PDChannel/source/PDChannel.cpp b/plugins/MacSignedVST/PDChannel/source/PDChannel.cpp index aef639d5e..6cf15db30 100755 --- a/plugins/MacSignedVST/PDChannel/source/PDChannel.cpp +++ b/plugins/MacSignedVST/PDChannel/source/PDChannel.cpp @@ -21,8 +21,8 @@ PDChannel::PDChannel(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PDChannel/source/PDChannel.h b/plugins/MacSignedVST/PDChannel/source/PDChannel.h index ea233e26b..cd7c14fb7 100755 --- a/plugins/MacSignedVST/PDChannel/source/PDChannel.h +++ b/plugins/MacSignedVST/PDChannel/source/PDChannel.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacSignedVST/PDChannel/source/PDChannelProc.cpp b/plugins/MacSignedVST/PDChannel/source/PDChannelProc.cpp index fb5932de6..2277acc7d 100755 --- a/plugins/MacSignedVST/PDChannel/source/PDChannelProc.cpp +++ b/plugins/MacSignedVST/PDChannel/source/PDChannelProc.cpp @@ -21,8 +21,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -112,14 +76,14 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -145,8 +109,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -159,44 +123,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -236,16 +164,14 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Pafnuty/source/Pafnuty.cpp b/plugins/MacSignedVST/Pafnuty/source/Pafnuty.cpp index 8c6f42d09..14eb30129 100755 --- a/plugins/MacSignedVST/Pafnuty/source/Pafnuty.cpp +++ b/plugins/MacSignedVST/Pafnuty/source/Pafnuty.cpp @@ -25,8 +25,8 @@ Pafnuty::Pafnuty(audioMasterCallback audioMaster) : K = 0.5; L = 0.5; M = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Pafnuty/source/Pafnuty.h b/plugins/MacSignedVST/Pafnuty/source/Pafnuty.h index 3a832b773..80eba3e36 100755 --- a/plugins/MacSignedVST/Pafnuty/source/Pafnuty.h +++ b/plugins/MacSignedVST/Pafnuty/source/Pafnuty.h @@ -64,8 +64,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Pafnuty/source/PafnutyProc.cpp b/plugins/MacSignedVST/Pafnuty/source/PafnutyProc.cpp index 710bcdc8f..79d2326a1 100755 --- a/plugins/MacSignedVST/Pafnuty/source/PafnutyProc.cpp +++ b/plugins/MacSignedVST/Pafnuty/source/PafnutyProc.cpp @@ -14,52 +14,52 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out1 = outputs[0]; float* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,14 +258,14 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -284,52 +284,52 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -528,16 +528,14 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp b/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp index 759c49820..476bfd332 100755 --- a/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp +++ b/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp @@ -31,8 +31,8 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -103,8 +103,8 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp b/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp index c8ba4a921..13cd58f79 100755 --- a/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp +++ b/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp @@ -28,8 +28,8 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -46,14 +46,14 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises @@ -116,8 +116,8 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -134,14 +134,14 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/MacSignedVST/PeaksOnly/source/PeaksOnlyProc.cpp b/plugins/MacSignedVST/PeaksOnly/source/PeaksOnlyProc.cpp index 89aa62f35..39a49e8c1 100755 --- a/plugins/MacSignedVST/PeaksOnly/source/PeaksOnlyProc.cpp +++ b/plugins/MacSignedVST/PeaksOnly/source/PeaksOnlyProc.cpp @@ -26,8 +26,8 @@ void PeaksOnly::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -165,8 +165,8 @@ void PeaksOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.cpp b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.cpp index e9e5c8d6d..7c200bd4d 100755 --- a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.cpp +++ b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.cpp @@ -16,8 +16,8 @@ PhaseNudge::PhaseNudge(audioMasterCallback audioMaster) : B = 1.0; for(int count = 0; count < 1502; count++) {dL[count] = 0.0; dR[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.h b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.h index 2926ccbea..a2f0dedbc 100755 --- a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.h +++ b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudge.h @@ -57,8 +57,8 @@ private: double dR[1503]; int one, maxdelay; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp index 150ecd567..449d1f224 100755 --- a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp +++ b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp @@ -23,53 +23,17 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,53 +132,17 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PitchDelay/source/PitchDelay.h b/plugins/MacSignedVST/PitchDelay/source/PitchDelay.h index b5c0fc1b2..2c6f52ffc 100755 --- a/plugins/MacSignedVST/PitchDelay/source/PitchDelay.h +++ b/plugins/MacSignedVST/PitchDelay/source/PitchDelay.h @@ -63,8 +63,8 @@ private: double regenSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; @@ -72,8 +72,8 @@ private: double regenSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/MacSignedVST/PitchDelay/source/PitchDelayProc.cpp b/plugins/MacSignedVST/PitchDelay/source/PitchDelayProc.cpp index 4dcdcbafe..be0bb419f 100755 --- a/plugins/MacSignedVST/PitchDelay/source/PitchDelayProc.cpp +++ b/plugins/MacSignedVST/PitchDelay/source/PitchDelayProc.cpp @@ -64,12 +64,12 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -294,12 +294,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -309,7 +309,7 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -449,12 +449,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/PocketVerbs/source/PocketVerbsProc.cpp b/plugins/MacSignedVST/PocketVerbs/source/PocketVerbsProc.cpp index 4ea8f5120..c6ab00834 100755 --- a/plugins/MacSignedVST/PocketVerbs/source/PocketVerbsProc.cpp +++ b/plugins/MacSignedVST/PocketVerbs/source/PocketVerbsProc.cpp @@ -469,14 +469,14 @@ void PocketVerbs::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); @@ -9645,14 +9645,14 @@ void PocketVerbs::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); diff --git a/plugins/MacSignedVST/Podcast/source/PodcastProc.cpp b/plugins/MacSignedVST/Podcast/source/PodcastProc.cpp index e8fd9949a..4a4c4fdd6 100755 --- a/plugins/MacSignedVST/Podcast/source/PodcastProc.cpp +++ b/plugins/MacSignedVST/Podcast/source/PodcastProc.cpp @@ -30,12 +30,12 @@ void Podcast::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; @@ -189,12 +189,12 @@ void Podcast::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; diff --git a/plugins/MacSignedVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp b/plugins/MacSignedVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp index 5349f2eb0..eafe49669 100755 --- a/plugins/MacSignedVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp +++ b/plugins/MacSignedVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp @@ -45,8 +45,8 @@ void PodcastDeluxe::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -371,8 +371,8 @@ void PodcastDeluxe::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Point/source/Point.cpp b/plugins/MacSignedVST/Point/source/Point.cpp index f79547099..636dec5f7 100755 --- a/plugins/MacSignedVST/Point/source/Point.cpp +++ b/plugins/MacSignedVST/Point/source/Point.cpp @@ -24,8 +24,8 @@ Point::Point(audioMasterCallback audioMaster) : nibBR = 0.0; nobBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/Point/source/Point.h b/plugins/MacSignedVST/Point/source/Point.h index ff898cb39..046c81f6b 100755 --- a/plugins/MacSignedVST/Point/source/Point.h +++ b/plugins/MacSignedVST/Point/source/Point.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double nibAL; diff --git a/plugins/MacSignedVST/Point/source/PointProc.cpp b/plugins/MacSignedVST/Point/source/PointProc.cpp index a3bbe3cf2..70173909f 100755 --- a/plugins/MacSignedVST/Point/source/PointProc.cpp +++ b/plugins/MacSignedVST/Point/source/PointProc.cpp @@ -27,51 +27,15 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -127,14 +91,14 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,51 +130,15 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -266,16 +194,14 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Pop/source/Pop.h b/plugins/MacSignedVST/Pop/source/Pop.h index c598dfcaa..9784b4ee5 100755 --- a/plugins/MacSignedVST/Pop/source/Pop.h +++ b/plugins/MacSignedVST/Pop/source/Pop.h @@ -64,12 +64,12 @@ private: double muSpeedBL; double muCoefficientAL; double muCoefficientBL; - long double thickenL; - long double previousL; - long double previous2L; - long double previous3L; - long double previous4L; - long double previous5L; + double thickenL; + double previousL; + double previous2L; + double previous3L; + double previous4L; + double previous5L; double dL[10001]; double muVaryR; @@ -79,12 +79,12 @@ private: double muSpeedBR; double muCoefficientAR; double muCoefficientBR; - long double thickenR; - long double previousR; - long double previous2R; - long double previous3R; - long double previous4R; - long double previous5R; + double thickenR; + double previousR; + double previous2R; + double previous3R; + double previous4R; + double previous5R; double dR[10001]; int delay; diff --git a/plugins/MacSignedVST/Pop/source/PopProc.cpp b/plugins/MacSignedVST/Pop/source/PopProc.cpp index a7174cf46..44e7efd3a 100755 --- a/plugins/MacSignedVST/Pop/source/PopProc.cpp +++ b/plugins/MacSignedVST/Pop/source/PopProc.cpp @@ -34,14 +34,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -51,7 +51,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -66,7 +66,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -195,14 +195,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -211,7 +211,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm @@ -281,14 +281,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -298,7 +298,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -313,7 +313,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -442,14 +442,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -458,7 +458,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/MacSignedVST/PowerSag/source/PowerSag.cpp b/plugins/MacSignedVST/PowerSag/source/PowerSag.cpp index d1d0745bc..12c46489a 100755 --- a/plugins/MacSignedVST/PowerSag/source/PowerSag.cpp +++ b/plugins/MacSignedVST/PowerSag/source/PowerSag.cpp @@ -18,8 +18,8 @@ PowerSag::PowerSag(audioMasterCallback audioMaster) : gcount = 0; A = 0.0; B = 0.3; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PowerSag/source/PowerSag.h b/plugins/MacSignedVST/PowerSag/source/PowerSag.h index 38839b650..106a02c34 100755 --- a/plugins/MacSignedVST/PowerSag/source/PowerSag.h +++ b/plugins/MacSignedVST/PowerSag/source/PowerSag.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double dL[9000]; double dR[9000]; diff --git a/plugins/MacSignedVST/PowerSag/source/PowerSagProc.cpp b/plugins/MacSignedVST/PowerSag/source/PowerSagProc.cpp index de43be625..61c9be8c7 100755 --- a/plugins/MacSignedVST/PowerSag/source/PowerSagProc.cpp +++ b/plugins/MacSignedVST/PowerSag/source/PowerSagProc.cpp @@ -23,51 +23,15 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -120,14 +84,14 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -155,51 +119,15 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -252,16 +180,14 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PowerSag2/source/PowerSag2Proc.cpp b/plugins/MacSignedVST/PowerSag2/source/PowerSag2Proc.cpp index 645d7b259..69e12f697 100755 --- a/plugins/MacSignedVST/PowerSag2/source/PowerSag2Proc.cpp +++ b/plugins/MacSignedVST/PowerSag2/source/PowerSag2Proc.cpp @@ -20,12 +20,12 @@ void PowerSag2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); @@ -89,12 +89,12 @@ void PowerSag2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); diff --git a/plugins/MacSignedVST/Precious/source/PreciousProc.cpp b/plugins/MacSignedVST/Precious/source/PreciousProc.cpp index 01aeef35c..d15680a95 100755 --- a/plugins/MacSignedVST/Precious/source/PreciousProc.cpp +++ b/plugins/MacSignedVST/Precious/source/PreciousProc.cpp @@ -37,8 +37,8 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Preponderant/source/Preponderant.h b/plugins/MacSignedVST/Preponderant/source/Preponderant.h index dd7949024..731430fb8 100755 --- a/plugins/MacSignedVST/Preponderant/source/Preponderant.h +++ b/plugins/MacSignedVST/Preponderant/source/Preponderant.h @@ -56,25 +56,25 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; - long double bassBalanceL; - long double midBalanceL; - long double highBalanceL; - long double bassTrackL; - long double midTrackL; - long double highTrackL; - long double quicknessL; + double bassBalanceL; + double midBalanceL; + double highBalanceL; + double bassTrackL; + double midTrackL; + double highTrackL; + double quicknessL; - long double bassBalanceR; - long double midBalanceR; - long double highBalanceR; - long double bassTrackR; - long double midTrackR; - long double highTrackR; - long double quicknessR; + double bassBalanceR; + double midBalanceR; + double highBalanceR; + double bassTrackR; + double midTrackR; + double highTrackR; + double quicknessR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Preponderant/source/PreponderantProc.cpp b/plugins/MacSignedVST/Preponderant/source/PreponderantProc.cpp index d1956b1a6..9ea118e03 100755 --- a/plugins/MacSignedVST/Preponderant/source/PreponderantProc.cpp +++ b/plugins/MacSignedVST/Preponderant/source/PreponderantProc.cpp @@ -62,43 +62,43 @@ void Preponderant::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -258,43 +258,43 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -381,12 +381,12 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Pressure4/source/Pressure4.cpp b/plugins/MacSignedVST/Pressure4/source/Pressure4.cpp index 10ed5facf..cdfc41d8b 100755 --- a/plugins/MacSignedVST/Pressure4/source/Pressure4.cpp +++ b/plugins/MacSignedVST/Pressure4/source/Pressure4.cpp @@ -16,8 +16,8 @@ Pressure4::Pressure4(audioMasterCallback audioMaster) : B = 0.2; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/MacSignedVST/Pressure4/source/Pressure4.h b/plugins/MacSignedVST/Pressure4/source/Pressure4.h index 6cf344845..1e30c3f88 100755 --- a/plugins/MacSignedVST/Pressure4/source/Pressure4.h +++ b/plugins/MacSignedVST/Pressure4/source/Pressure4.h @@ -62,8 +62,8 @@ private: double muSpeedB; double muCoefficientA; double muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/MacSignedVST/Pressure4/source/Pressure4Proc.cpp b/plugins/MacSignedVST/Pressure4/source/Pressure4Proc.cpp index 7e285df60..2c1445a6b 100755 --- a/plugins/MacSignedVST/Pressure4/source/Pressure4Proc.cpp +++ b/plugins/MacSignedVST/Pressure4/source/Pressure4Proc.cpp @@ -24,7 +24,7 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -44,51 +44,15 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -192,14 +156,14 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; @@ -228,7 +192,7 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -248,52 +212,16 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -397,16 +325,14 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.pbxuser b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.pbxuser old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/christopherjohnson.perspectivev3 old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/project.xcworkspace/xcuserdata/spiadmin.xcuserdatad/UserInterfaceState.xcuserstate old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.mode1v3 b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.mode1v3 old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.pbxuser b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/spiadmin.pbxuser old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcshareddata/xcschemes/Pressure5.xcscheme b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcshareddata/xcschemes/Pressure5.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/christopherjohnson.xcuserdatad/xcschemes/xcschememanagement.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/xcschememanagement.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme b/plugins/MacSignedVST/Pressure5/Pressure5.xcodeproj/xcuserdata/spiadmin.xcuserdatad/xcschemes/«PROJECTNAME».xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Pressure5/source/Pressure5.h b/plugins/MacSignedVST/Pressure5/source/Pressure5.h index de0e13480..479d94b12 100755 --- a/plugins/MacSignedVST/Pressure5/source/Pressure5.h +++ b/plugins/MacSignedVST/Pressure5/source/Pressure5.h @@ -82,15 +82,15 @@ private: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacSignedVST/Pressure5/source/Pressure5Proc.cpp b/plugins/MacSignedVST/Pressure5/source/Pressure5Proc.cpp index 42d8fe532..41fbf6480 100755 --- a/plugins/MacSignedVST/Pressure5/source/Pressure5Proc.cpp +++ b/plugins/MacSignedVST/Pressure5/source/Pressure5Proc.cpp @@ -49,18 +49,18 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -160,7 +160,7 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -276,18 +276,18 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -387,7 +387,7 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -443,12 +443,12 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt //final clip runs AFTER the Dry/Wet. It serves as a safety clip even if you're not full wet //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/PurestAir/source/PurestAir.h b/plugins/MacSignedVST/PurestAir/source/PurestAir.h index 5b592c3b4..d077af8c5 100755 --- a/plugins/MacSignedVST/PurestAir/source/PurestAir.h +++ b/plugins/MacSignedVST/PurestAir/source/PurestAir.h @@ -56,23 +56,23 @@ private: uint32_t fpd; //default stuff - long double last1SampleL; - long double halfwaySampleL; - long double halfDrySampleL; - long double halfDiffSampleL; - long double diffSampleL; - long double lastSampleL; + double last1SampleL; + double halfwaySampleL; + double halfDrySampleL; + double halfDiffSampleL; + double diffSampleL; + double lastSampleL; double s1L; double s2L; double s3L; double applyL; - long double last1SampleR; - long double halfwaySampleR; - long double halfDrySampleR; - long double halfDiffSampleR; - long double diffSampleR; - long double lastSampleR; + double last1SampleR; + double halfwaySampleR; + double halfDrySampleR; + double halfDiffSampleR; + double diffSampleR; + double lastSampleR; double s1R; double s2R; double s3R; diff --git a/plugins/MacSignedVST/PurestAir/source/PurestAirProc.cpp b/plugins/MacSignedVST/PurestAir/source/PurestAirProc.cpp index 73939a77e..362e27217 100755 --- a/plugins/MacSignedVST/PurestAir/source/PurestAirProc.cpp +++ b/plugins/MacSignedVST/PurestAir/source/PurestAirProc.cpp @@ -23,12 +23,12 @@ void PurestAir::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; @@ -128,12 +128,12 @@ void PurestAir::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; diff --git a/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2Buss.h b/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2Buss.h index b65aa472f..d625c7545 100755 --- a/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2Buss.h +++ b/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2Buss.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp b/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp index 346bf2ae8..08b4a4904 100755 --- a/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp +++ b/plugins/MacSignedVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Buss::processReplacing(float **inputs, float **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -90,13 +90,13 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -115,12 +115,12 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2Channel.h b/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2Channel.h index ac89c047d..6c7a2753e 100755 --- a/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2Channel.h +++ b/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2Channel.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp b/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp index 124b27f16..127c7910b 100755 --- a/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp +++ b/plugins/MacSignedVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Channel::processReplacing(float **inputs, float **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -89,13 +89,13 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -113,12 +113,12 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp index 2d8e61900..c7b1ee68e 100755 --- a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp +++ b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleBuss::PurestConsoleBuss(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.h b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.h index 51495fcc9..2c49190a0 100755 --- a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.h +++ b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBuss.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp index 6211eeb29..95223c51e 100755 --- a/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp +++ b/plugins/MacSignedVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp @@ -15,51 +15,15 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -71,14 +35,14 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -98,51 +62,15 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -154,16 +82,14 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp index 35649a6f6..909f43b68 100755 --- a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp +++ b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleChannel::PurestConsoleChannel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.h b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.h index 51e728f59..aa984365d 100755 --- a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.h +++ b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannel.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp index 2fc513aa3..4a500fadf 100755 --- a/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp +++ b/plugins/MacSignedVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp @@ -15,64 +15,28 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -92,66 +56,28 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PurestDrive/source/PurestDrive.cpp b/plugins/MacSignedVST/PurestDrive/source/PurestDrive.cpp index a1d926444..08c592079 100755 --- a/plugins/MacSignedVST/PurestDrive/source/PurestDrive.cpp +++ b/plugins/MacSignedVST/PurestDrive/source/PurestDrive.cpp @@ -17,8 +17,8 @@ PurestDrive::PurestDrive(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestDrive/source/PurestDrive.h b/plugins/MacSignedVST/PurestDrive/source/PurestDrive.h index abcd65bb4..2b84c79e1 100755 --- a/plugins/MacSignedVST/PurestDrive/source/PurestDrive.h +++ b/plugins/MacSignedVST/PurestDrive/source/PurestDrive.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double previousSampleL; diff --git a/plugins/MacSignedVST/PurestDrive/source/PurestDriveProc.cpp b/plugins/MacSignedVST/PurestDrive/source/PurestDriveProc.cpp index f5cc80477..39c9096f5 100755 --- a/plugins/MacSignedVST/PurestDrive/source/PurestDriveProc.cpp +++ b/plugins/MacSignedVST/PurestDrive/source/PurestDriveProc.cpp @@ -18,52 +18,16 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -87,14 +51,14 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -117,8 +81,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; @@ -126,44 +90,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -187,16 +115,14 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PurestEcho/source/PurestEcho.cpp b/plugins/MacSignedVST/PurestEcho/source/PurestEcho.cpp index 6bcaa3f69..d54d53c1e 100755 --- a/plugins/MacSignedVST/PurestEcho/source/PurestEcho.cpp +++ b/plugins/MacSignedVST/PurestEcho/source/PurestEcho.cpp @@ -19,8 +19,8 @@ PurestEcho::PurestEcho(audioMasterCallback audioMaster) : E = 0.0; for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestEcho/source/PurestEcho.h b/plugins/MacSignedVST/PurestEcho/source/PurestEcho.h index 870e15822..e16cde658 100755 --- a/plugins/MacSignedVST/PurestEcho/source/PurestEcho.h +++ b/plugins/MacSignedVST/PurestEcho/source/PurestEcho.h @@ -62,8 +62,8 @@ private: int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/PurestEcho/source/PurestEchoProc.cpp b/plugins/MacSignedVST/PurestEcho/source/PurestEchoProc.cpp index e8e141cd4..a64daf546 100755 --- a/plugins/MacSignedVST/PurestEcho/source/PurestEchoProc.cpp +++ b/plugins/MacSignedVST/PurestEcho/source/PurestEchoProc.cpp @@ -77,51 +77,15 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -174,14 +138,14 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -263,51 +227,15 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -360,16 +288,14 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp b/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp index ef2f9fc09..31f0a9d17 100755 --- a/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp +++ b/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp @@ -31,24 +31,24 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -119,24 +119,24 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/PurestGain/source/PurestGain.cpp b/plugins/MacSignedVST/PurestGain/source/PurestGain.cpp index b1b77fe18..d068d7fac 100755 --- a/plugins/MacSignedVST/PurestGain/source/PurestGain.cpp +++ b/plugins/MacSignedVST/PurestGain/source/PurestGain.cpp @@ -18,8 +18,8 @@ PurestGain::PurestGain(audioMasterCallback audioMaster) : settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestGain/source/PurestGain.h b/plugins/MacSignedVST/PurestGain/source/PurestGain.h index 9e2baeab4..b9d3a2d47 100755 --- a/plugins/MacSignedVST/PurestGain/source/PurestGain.h +++ b/plugins/MacSignedVST/PurestGain/source/PurestGain.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp b/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp index 4aa6d96fb..2ca5b8478 100755 --- a/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp +++ b/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp @@ -44,8 +44,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; //A is 0-1 (you can't feed other values to VST hosts, it's always 0-1 internally) //B is 0-1 and you need to multiply it by 100 if you want to use the 'percent' @@ -74,44 +74,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -122,7 +86,7 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= outputgain; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -176,8 +140,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { @@ -200,44 +164,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -248,7 +176,7 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/MacSignedVST/PurestSquish/source/PurestSquishProc.cpp b/plugins/MacSignedVST/PurestSquish/source/PurestSquishProc.cpp index 1be853713..946d23963 100755 --- a/plugins/MacSignedVST/PurestSquish/source/PurestSquishProc.cpp +++ b/plugins/MacSignedVST/PurestSquish/source/PurestSquishProc.cpp @@ -18,10 +18,10 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -29,8 +29,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); @@ -522,10 +522,10 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -533,8 +533,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -572,8 +572,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/MacSignedVST/PurestWarm/source/PurestWarm.cpp b/plugins/MacSignedVST/PurestWarm/source/PurestWarm.cpp index eeee37b58..13dbe8bd6 100755 --- a/plugins/MacSignedVST/PurestWarm/source/PurestWarm.cpp +++ b/plugins/MacSignedVST/PurestWarm/source/PurestWarm.cpp @@ -13,8 +13,8 @@ PurestWarm::PurestWarm(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/PurestWarm/source/PurestWarm.h b/plugins/MacSignedVST/PurestWarm/source/PurestWarm.h index 98bb0ce4e..83fd9c336 100755 --- a/plugins/MacSignedVST/PurestWarm/source/PurestWarm.h +++ b/plugins/MacSignedVST/PurestWarm/source/PurestWarm.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp b/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp index 101c9319d..b34bfb596 100755 --- a/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp +++ b/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp @@ -17,51 +17,15 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -70,7 +34,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -82,7 +46,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -95,7 +59,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -108,7 +72,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -138,51 +102,15 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -191,7 +119,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -206,7 +134,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -221,7 +149,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -235,7 +163,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/MacSignedVST/Pyewacket/source/Pyewacket.cpp b/plugins/MacSignedVST/Pyewacket/source/Pyewacket.cpp index d500e7449..2be4313fe 100755 --- a/plugins/MacSignedVST/Pyewacket/source/Pyewacket.cpp +++ b/plugins/MacSignedVST/Pyewacket/source/Pyewacket.cpp @@ -18,8 +18,8 @@ Pyewacket::Pyewacket(audioMasterCallback audioMaster) : chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Pyewacket/source/Pyewacket.h b/plugins/MacSignedVST/Pyewacket/source/Pyewacket.h index 087a198ee..5624c4b93 100755 --- a/plugins/MacSignedVST/Pyewacket/source/Pyewacket.h +++ b/plugins/MacSignedVST/Pyewacket/source/Pyewacket.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double chase; double lastrectifierL; diff --git a/plugins/MacSignedVST/Pyewacket/source/PyewacketProc.cpp b/plugins/MacSignedVST/Pyewacket/source/PyewacketProc.cpp index 8b3021a9e..8b21a91fb 100755 --- a/plugins/MacSignedVST/Pyewacket/source/PyewacketProc.cpp +++ b/plugins/MacSignedVST/Pyewacket/source/PyewacketProc.cpp @@ -17,12 +17,12 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -41,44 +41,8 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -133,14 +97,14 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,12 +126,12 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -186,44 +150,8 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -278,16 +206,14 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp b/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp index 4ee485fa4..a4414634e 100755 --- a/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp +++ b/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp @@ -27,8 +27,8 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -84,8 +84,8 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp b/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp index 78e012e26..0a1b401c3 100755 --- a/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp +++ b/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp @@ -28,8 +28,8 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -87,8 +87,8 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Recurve/source/Recurve.h b/plugins/MacSignedVST/Recurve/source/Recurve.h index 52a507738..bb90e4bac 100755 --- a/plugins/MacSignedVST/Recurve/source/Recurve.h +++ b/plugins/MacSignedVST/Recurve/source/Recurve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/Recurve/source/RecurveProc.cpp b/plugins/MacSignedVST/Recurve/source/RecurveProc.cpp index 8a0b85d85..fc20e5b25 100755 --- a/plugins/MacSignedVST/Recurve/source/RecurveProc.cpp +++ b/plugins/MacSignedVST/Recurve/source/RecurveProc.cpp @@ -16,8 +16,8 @@ void Recurve::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -71,8 +71,8 @@ void Recurve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Remap/source/RemapProc.cpp b/plugins/MacSignedVST/Remap/source/RemapProc.cpp index 594800c96..b9227743f 100755 --- a/plugins/MacSignedVST/Remap/source/RemapProc.cpp +++ b/plugins/MacSignedVST/Remap/source/RemapProc.cpp @@ -21,18 +21,18 @@ void Remap::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; @@ -95,18 +95,18 @@ void Remap::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; diff --git a/plugins/MacSignedVST/ResEQ/source/ResEQProc.cpp b/plugins/MacSignedVST/ResEQ/source/ResEQProc.cpp index 99fa31999..c9c21c0dd 100755 --- a/plugins/MacSignedVST/ResEQ/source/ResEQProc.cpp +++ b/plugins/MacSignedVST/ResEQ/source/ResEQProc.cpp @@ -128,12 +128,12 @@ void ResEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; @@ -422,14 +422,14 @@ void ResEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; diff --git a/plugins/MacSignedVST/Reverb/source/Reverb.h b/plugins/MacSignedVST/Reverb/source/Reverb.h index a7b966d93..5d6f36229 100755 --- a/plugins/MacSignedVST/Reverb/source/Reverb.h +++ b/plugins/MacSignedVST/Reverb/source/Reverb.h @@ -53,9 +53,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacSignedVST/Reverb/source/ReverbProc.cpp b/plugins/MacSignedVST/Reverb/source/ReverbProc.cpp index 7140d1781..3dce2d8af 100755 --- a/plugins/MacSignedVST/Reverb/source/ReverbProc.cpp +++ b/plugins/MacSignedVST/Reverb/source/ReverbProc.cpp @@ -68,12 +68,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -82,12 +82,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -99,15 +99,15 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -446,12 +446,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -460,12 +460,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -477,15 +477,15 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -745,12 +745,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Righteous4/source/Righteous4.cpp b/plugins/MacSignedVST/Righteous4/source/Righteous4.cpp index 3c50a7493..ffedc9292 100755 --- a/plugins/MacSignedVST/Righteous4/source/Righteous4.cpp +++ b/plugins/MacSignedVST/Righteous4/source/Righteous4.cpp @@ -105,8 +105,8 @@ Righteous4::Righteous4(audioMasterCallback audioMaster) : gwAR = 0.0; gwBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Righteous4/source/Righteous4.h b/plugins/MacSignedVST/Righteous4/source/Righteous4.h index 8b9e44b57..4ddd61ec9 100755 --- a/plugins/MacSignedVST/Righteous4/source/Righteous4.h +++ b/plugins/MacSignedVST/Righteous4/source/Righteous4.h @@ -108,7 +108,7 @@ private: double rightSampleZ; double bynL[13]; - long double noiseShapingL; + double noiseShapingL; double lastSampleL; double IIRsampleL; double gwPrevL; @@ -116,15 +116,15 @@ private: double gwBL; double bynR[13]; - long double noiseShapingR; + double noiseShapingR; double lastSampleR; double IIRsampleR; double gwPrevR; double gwAR; double gwBR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Righteous4/source/Righteous4Proc.cpp b/plugins/MacSignedVST/Righteous4/source/Righteous4Proc.cpp index feff69b52..3b330cb6d 100755 --- a/plugins/MacSignedVST/Righteous4/source/Righteous4Proc.cpp +++ b/plugins/MacSignedVST/Righteous4/source/Righteous4Proc.cpp @@ -13,8 +13,8 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); @@ -42,46 +42,10 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -95,7 +59,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -300,14 +264,14 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp //output dither section if (bitDepth == 3) { - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out @@ -523,8 +487,8 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0002597;//scaleback of harmonic avg IIRscaleback /= overallscale; IIRscaleback = 1.0 - IIRscaleback; @@ -549,46 +513,10 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -602,7 +530,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -807,16 +735,14 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn //output dither section if (bitDepth == 3) { - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out diff --git a/plugins/MacSignedVST/SideDull/source/SideDull.cpp b/plugins/MacSignedVST/SideDull/source/SideDull.cpp index 479bdfd5d..1153e90bc 100755 --- a/plugins/MacSignedVST/SideDull/source/SideDull.cpp +++ b/plugins/MacSignedVST/SideDull/source/SideDull.cpp @@ -16,8 +16,8 @@ SideDull::SideDull(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/SideDull/source/SideDull.h b/plugins/MacSignedVST/SideDull/source/SideDull.h index ef5e892c8..36950fd08 100755 --- a/plugins/MacSignedVST/SideDull/source/SideDull.h +++ b/plugins/MacSignedVST/SideDull/source/SideDull.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; float A; }; diff --git a/plugins/MacSignedVST/SideDull/source/SideDullProc.cpp b/plugins/MacSignedVST/SideDull/source/SideDullProc.cpp index 7b777444b..06f8ec15b 100755 --- a/plugins/MacSignedVST/SideDull/source/SideDullProc.cpp +++ b/plugins/MacSignedVST/SideDull/source/SideDullProc.cpp @@ -18,9 +18,9 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -28,44 +28,8 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -85,14 +49,14 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -115,9 +79,9 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -125,44 +89,8 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -182,16 +110,14 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Sidepass/source/Sidepass.cpp b/plugins/MacSignedVST/Sidepass/source/Sidepass.cpp index a28c21233..8dc84167f 100755 --- a/plugins/MacSignedVST/Sidepass/source/Sidepass.cpp +++ b/plugins/MacSignedVST/Sidepass/source/Sidepass.cpp @@ -16,8 +16,8 @@ Sidepass::Sidepass(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Sidepass/source/Sidepass.h b/plugins/MacSignedVST/Sidepass/source/Sidepass.h index 1b31b911e..4755073ea 100755 --- a/plugins/MacSignedVST/Sidepass/source/Sidepass.h +++ b/plugins/MacSignedVST/Sidepass/source/Sidepass.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Sidepass/source/SidepassProc.cpp b/plugins/MacSignedVST/Sidepass/source/SidepassProc.cpp index 834ae3e26..b6b664d3f 100755 --- a/plugins/MacSignedVST/Sidepass/source/SidepassProc.cpp +++ b/plugins/MacSignedVST/Sidepass/source/SidepassProc.cpp @@ -18,53 +18,17 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -84,14 +48,14 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -114,53 +78,17 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -180,16 +108,14 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.cpp b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.cpp index fd8a06a35..28ba08c34 100755 --- a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.cpp +++ b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.cpp @@ -19,8 +19,8 @@ SingleEndedTriode::SingleEndedTriode(audioMasterCallback audioMaster) : postsine = sin(0.5); - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.h b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.h index c162512f3..340d8dbd8 100755 --- a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.h +++ b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriode.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double postsine; diff --git a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp index ef6694c21..882fca727 100755 --- a/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp +++ b/plugins/MacSignedVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp @@ -23,46 +23,10 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -73,7 +37,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -93,7 +57,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -109,7 +73,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -127,14 +91,14 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,46 +126,10 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -212,7 +140,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -232,7 +160,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -248,7 +176,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -266,16 +194,14 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Slew/source/SlewProc.cpp b/plugins/MacSignedVST/Slew/source/SlewProc.cpp index 5618bb793..480beb3fd 100755 --- a/plugins/MacSignedVST/Slew/source/SlewProc.cpp +++ b/plugins/MacSignedVST/Slew/source/SlewProc.cpp @@ -33,44 +33,8 @@ void Slew::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; @@ -122,44 +86,8 @@ void Slew::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; diff --git a/plugins/MacSignedVST/Slew2/source/Slew2Proc.cpp b/plugins/MacSignedVST/Slew2/source/Slew2Proc.cpp index 07b1bb9d3..cea1b98e8 100755 --- a/plugins/MacSignedVST/Slew2/source/Slew2Proc.cpp +++ b/plugins/MacSignedVST/Slew2/source/Slew2Proc.cpp @@ -26,44 +26,8 @@ void Slew2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -173,44 +137,8 @@ void Slew2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/MacSignedVST/Slew3/source/Slew3Proc.cpp b/plugins/MacSignedVST/Slew3/source/Slew3Proc.cpp index eacd1386f..18177c5ea 100755 --- a/plugins/MacSignedVST/Slew3/source/Slew3Proc.cpp +++ b/plugins/MacSignedVST/Slew3/source/Slew3Proc.cpp @@ -22,8 +22,8 @@ void Slew3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void Slew3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/SlewOnly/source/SlewOnlyProc.cpp b/plugins/MacSignedVST/SlewOnly/source/SlewOnlyProc.cpp index 5fc12c3a8..5676a6f91 100755 --- a/plugins/MacSignedVST/SlewOnly/source/SlewOnlyProc.cpp +++ b/plugins/MacSignedVST/SlewOnly/source/SlewOnlyProc.cpp @@ -14,54 +14,18 @@ void SlewOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; outputSampleR = (inputSampleR - lastSampleR)*trim; @@ -89,54 +53,18 @@ void SlewOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; diff --git a/plugins/MacSignedVST/Smooth/source/SmoothProc.cpp b/plugins/MacSignedVST/Smooth/source/SmoothProc.cpp index 1fb135570..81df54143 100755 --- a/plugins/MacSignedVST/Smooth/source/SmoothProc.cpp +++ b/plugins/MacSignedVST/Smooth/source/SmoothProc.cpp @@ -28,8 +28,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); @@ -214,8 +214,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -253,8 +253,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); diff --git a/plugins/MacSignedVST/SoftGate/source/SoftGateProc.cpp b/plugins/MacSignedVST/SoftGate/source/SoftGateProc.cpp index a09429bfc..ba8d6358c 100755 --- a/plugins/MacSignedVST/SoftGate/source/SoftGateProc.cpp +++ b/plugins/MacSignedVST/SoftGate/source/SoftGateProc.cpp @@ -26,8 +26,8 @@ void SoftGate::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void SoftGate::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp b/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp index 4a611e8fa..bf9da7ef7 100755 --- a/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp +++ b/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp @@ -34,8 +34,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -125,8 +125,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Spiral/source/SpiralProc.cpp b/plugins/MacSignedVST/Spiral/source/SpiralProc.cpp index 0ad97429c..f672d63d1 100755 --- a/plugins/MacSignedVST/Spiral/source/SpiralProc.cpp +++ b/plugins/MacSignedVST/Spiral/source/SpiralProc.cpp @@ -16,8 +16,8 @@ void Spiral::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -55,8 +55,8 @@ void Spiral::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/Spiral2/source/Spiral2.h b/plugins/MacSignedVST/Spiral2/source/Spiral2.h index a65051eab..7da43323c 100755 --- a/plugins/MacSignedVST/Spiral2/source/Spiral2.h +++ b/plugins/MacSignedVST/Spiral2/source/Spiral2.h @@ -56,14 +56,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double prevSampleL; + double iirSampleAL; + double iirSampleBL; + double prevSampleL; uint32_t fpd; - long double iirSampleAR; - long double iirSampleBR; - long double prevSampleR; + double iirSampleAR; + double iirSampleBR; + double prevSampleR; bool flip; //default stuff diff --git a/plugins/MacSignedVST/Spiral2/source/Spiral2Proc.cpp b/plugins/MacSignedVST/Spiral2/source/Spiral2Proc.cpp index 2655f678a..36f15560c 100755 --- a/plugins/MacSignedVST/Spiral2/source/Spiral2Proc.cpp +++ b/plugins/MacSignedVST/Spiral2/source/Spiral2Proc.cpp @@ -26,14 +26,14 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -58,8 +58,8 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); @@ -124,14 +124,14 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -156,8 +156,8 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); diff --git a/plugins/MacSignedVST/Srsly/source/Srsly.h b/plugins/MacSignedVST/Srsly/source/Srsly.h index 099d33844..ff5958586 100755 --- a/plugins/MacSignedVST/Srsly/source/Srsly.h +++ b/plugins/MacSignedVST/Srsly/source/Srsly.h @@ -56,17 +56,17 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp b/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp index 4832f24a9..0cde87189 100755 --- a/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp +++ b/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp @@ -16,7 +16,7 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -127,81 +127,81 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -254,7 +254,7 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -365,81 +365,81 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; diff --git a/plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/xcshareddata/xcschemes/Srsly2.xcscheme b/plugins/MacSignedVST/Srsly2/Srsly2.xcodeproj/xcshareddata/xcschemes/Srsly2.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Srsly2/source/Srsly2.h b/plugins/MacSignedVST/Srsly2/source/Srsly2.h index 78d5df5f7..f8c2bdbef 100755 --- a/plugins/MacSignedVST/Srsly2/source/Srsly2.h +++ b/plugins/MacSignedVST/Srsly2/source/Srsly2.h @@ -57,17 +57,17 @@ private: std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Srsly2/source/Srsly2Proc.cpp b/plugins/MacSignedVST/Srsly2/source/Srsly2Proc.cpp index a1eb1ce15..13306512c 100755 --- a/plugins/MacSignedVST/Srsly2/source/Srsly2Proc.cpp +++ b/plugins/MacSignedVST/Srsly2/source/Srsly2Proc.cpp @@ -16,7 +16,7 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -132,81 +132,81 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -273,7 +273,7 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -389,81 +389,81 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -503,12 +503,12 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/StarChild/source/StarChild.cpp b/plugins/MacSignedVST/StarChild/source/StarChild.cpp index 6e4bf3e9a..610c87efc 100755 --- a/plugins/MacSignedVST/StarChild/source/StarChild.cpp +++ b/plugins/MacSignedVST/StarChild/source/StarChild.cpp @@ -66,8 +66,8 @@ StarChild::StarChild(audioMasterCallback audioMaster) : increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/StarChild/source/StarChild.h b/plugins/MacSignedVST/StarChild/source/StarChild.h index 630be3c82..157454b92 100755 --- a/plugins/MacSignedVST/StarChild/source/StarChild.h +++ b/plugins/MacSignedVST/StarChild/source/StarChild.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double d[45102]; diff --git a/plugins/MacSignedVST/StarChild/source/StarChildProc.cpp b/plugins/MacSignedVST/StarChild/source/StarChildProc.cpp index 047948abe..608c93157 100755 --- a/plugins/MacSignedVST/StarChild/source/StarChildProc.cpp +++ b/plugins/MacSignedVST/StarChild/source/StarChildProc.cpp @@ -76,44 +76,8 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -389,14 +353,14 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,44 +440,8 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -790,16 +718,14 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/StereoFX/source/StereoFX.cpp b/plugins/MacSignedVST/StereoFX/source/StereoFX.cpp index 704cbf375..8531bcdbe 100755 --- a/plugins/MacSignedVST/StereoFX/source/StereoFX.cpp +++ b/plugins/MacSignedVST/StereoFX/source/StereoFX.cpp @@ -17,8 +17,8 @@ StereoFX::StereoFX(audioMasterCallback audioMaster) : C = 0.0; iirSampleA = 0.0; iirSampleB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = false; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/StereoFX/source/StereoFX.h b/plugins/MacSignedVST/StereoFX/source/StereoFX.h index 7a3605921..04d34a587 100755 --- a/plugins/MacSignedVST/StereoFX/source/StereoFX.h +++ b/plugins/MacSignedVST/StereoFX/source/StereoFX.h @@ -56,8 +56,8 @@ private: double iirSampleA; double iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff diff --git a/plugins/MacSignedVST/StereoFX/source/StereoFXProc.cpp b/plugins/MacSignedVST/StereoFX/source/StereoFXProc.cpp index 0e9de7478..0c3ae4962 100755 --- a/plugins/MacSignedVST/StereoFX/source/StereoFXProc.cpp +++ b/plugins/MacSignedVST/StereoFX/source/StereoFXProc.cpp @@ -17,10 +17,10 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -40,44 +40,8 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -135,14 +99,14 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -164,10 +128,10 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -187,44 +151,8 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -282,16 +210,14 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/StudioTan/source/StudioTan.h b/plugins/MacSignedVST/StudioTan/source/StudioTan.h index 66caf4866..9e17ad768 100755 --- a/plugins/MacSignedVST/StudioTan/source/StudioTan.h +++ b/plugins/MacSignedVST/StudioTan/source/StudioTan.h @@ -52,15 +52,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13]; - long double noiseShapingL; - long double lastSampleL; - long double lastSample2L; + double bynL[13]; + double noiseShapingL; + double lastSampleL; + double lastSample2L; - long double bynR[13]; - long double noiseShapingR; - long double lastSampleR; - long double lastSample2R; + double bynR[13]; + double noiseShapingR; + double lastSampleR; + double lastSample2R; float A; diff --git a/plugins/MacSignedVST/StudioTan/source/StudioTanProc.cpp b/plugins/MacSignedVST/StudioTan/source/StudioTanProc.cpp index 3258f7b4f..de2418d10 100755 --- a/plugins/MacSignedVST/StudioTan/source/StudioTanProc.cpp +++ b/plugins/MacSignedVST/StudioTan/source/StudioTanProc.cpp @@ -30,12 +30,12 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -54,7 +54,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -66,7 +66,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -93,7 +93,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -252,11 +252,11 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; @@ -308,12 +308,12 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -332,7 +332,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -344,7 +344,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -371,7 +371,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -530,11 +530,11 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; diff --git a/plugins/MacSignedVST/SubsOnly/source/SubsOnlyProc.cpp b/plugins/MacSignedVST/SubsOnly/source/SubsOnlyProc.cpp index 23e79231f..3a7df87a0 100755 --- a/plugins/MacSignedVST/SubsOnly/source/SubsOnlyProc.cpp +++ b/plugins/MacSignedVST/SubsOnly/source/SubsOnlyProc.cpp @@ -22,51 +22,15 @@ void SubsOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; @@ -306,51 +270,15 @@ void SubsOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; diff --git a/plugins/MacSignedVST/Surge/source/Surge.cpp b/plugins/MacSignedVST/Surge/source/Surge.cpp index 222fbcf96..e330af883 100755 --- a/plugins/MacSignedVST/Surge/source/Surge.cpp +++ b/plugins/MacSignedVST/Surge/source/Surge.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new S Surge::Surge(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/MacSignedVST/Surge/source/Surge.h b/plugins/MacSignedVST/Surge/source/Surge.h index 7f42c9f74..18d47a94a 100755 --- a/plugins/MacSignedVST/Surge/source/Surge.h +++ b/plugins/MacSignedVST/Surge/source/Surge.h @@ -53,14 +53,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; float A; float B; diff --git a/plugins/MacSignedVST/Surge/source/SurgeProc.cpp b/plugins/MacSignedVST/Surge/source/SurgeProc.cpp index cd82badfb..53cac6996 100755 --- a/plugins/MacSignedVST/Surge/source/SurgeProc.cpp +++ b/plugins/MacSignedVST/Surge/source/SurgeProc.cpp @@ -18,10 +18,10 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -36,44 +36,8 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -117,14 +81,14 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -147,10 +111,10 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -164,44 +128,8 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -245,16 +173,14 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/SurgeTide/source/SurgeTide.cpp b/plugins/MacSignedVST/SurgeTide/source/SurgeTide.cpp index 494e886b8..ba28ed38f 100755 --- a/plugins/MacSignedVST/SurgeTide/source/SurgeTide.cpp +++ b/plugins/MacSignedVST/SurgeTide/source/SurgeTide.cpp @@ -15,8 +15,8 @@ SurgeTide::SurgeTide(audioMasterCallback audioMaster) : A = 0.5; B = 0.3; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/MacSignedVST/SurgeTide/source/SurgeTide.h b/plugins/MacSignedVST/SurgeTide/source/SurgeTide.h index 8f8cd4241..f6a2b7cbf 100755 --- a/plugins/MacSignedVST/SurgeTide/source/SurgeTide.h +++ b/plugins/MacSignedVST/SurgeTide/source/SurgeTide.h @@ -54,12 +54,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; + double chaseA; + double chaseB; + double chaseC; float A; float B; diff --git a/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp b/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp index 59a92aa02..ea08259c9 100755 --- a/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp +++ b/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp @@ -18,10 +18,10 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -34,44 +34,8 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -107,14 +71,14 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -137,10 +101,10 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -153,44 +117,8 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,16 +154,14 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Swell/source/Swell.cpp b/plugins/MacSignedVST/Swell/source/Swell.cpp index e197cfb5f..f1b5da9a3 100755 --- a/plugins/MacSignedVST/Swell/source/Swell.cpp +++ b/plugins/MacSignedVST/Swell/source/Swell.cpp @@ -21,8 +21,8 @@ Swell::Swell(audioMasterCallback audioMaster) : louderL = false; louderR = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Swell/source/Swell.h b/plugins/MacSignedVST/Swell/source/Swell.h index 7c108b728..1acfaf86c 100755 --- a/plugins/MacSignedVST/Swell/source/Swell.h +++ b/plugins/MacSignedVST/Swell/source/Swell.h @@ -54,13 +54,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double swellL; - long double swellR; + double swellL; + double swellR; bool louderL; bool louderR; diff --git a/plugins/MacSignedVST/Swell/source/SwellProc.cpp b/plugins/MacSignedVST/Swell/source/SwellProc.cpp index 3ab1e9b43..447613b50 100755 --- a/plugins/MacSignedVST/Swell/source/SwellProc.cpp +++ b/plugins/MacSignedVST/Swell/source/SwellProc.cpp @@ -25,53 +25,17 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -94,14 +58,14 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,53 +95,17 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -200,16 +128,14 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp b/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp index 865cd643d..e51504299 100755 --- a/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp +++ b/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp @@ -28,8 +28,8 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -86,8 +86,8 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp b/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp index 810a8ebac..45b831dac 100755 --- a/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp +++ b/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp @@ -28,8 +28,8 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -39,12 +39,12 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises @@ -104,8 +104,8 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -115,12 +115,12 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/MacSignedVST/Tape/source/Tape.h b/plugins/MacSignedVST/Tape/source/Tape.h index 932247bac..1ab35bd88 100755 --- a/plugins/MacSignedVST/Tape/source/Tape.h +++ b/plugins/MacSignedVST/Tape/source/Tape.h @@ -63,19 +63,19 @@ private: double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/Tape/source/TapeProc.cpp b/plugins/MacSignedVST/Tape/source/TapeProc.cpp index 961a1c1e4..4d498b2cd 100755 --- a/plugins/MacSignedVST/Tape/source/TapeProc.cpp +++ b/plugins/MacSignedVST/Tape/source/TapeProc.cpp @@ -45,18 +45,18 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -158,15 +158,15 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain != 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -324,8 +324,8 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -334,14 +334,14 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= inputgain; } //gain cut before anything, even dry - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -443,15 +443,15 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; diff --git a/plugins/MacSignedVST/TapeDelay/source/TapeDelay.cpp b/plugins/MacSignedVST/TapeDelay/source/TapeDelay.cpp index f7690dbd9..345f06d58 100755 --- a/plugins/MacSignedVST/TapeDelay/source/TapeDelay.cpp +++ b/plugins/MacSignedVST/TapeDelay/source/TapeDelay.cpp @@ -26,8 +26,8 @@ TapeDelay::TapeDelay(audioMasterCallback audioMaster) : gcount = 0; chase = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/TapeDelay/source/TapeDelay.h b/plugins/MacSignedVST/TapeDelay/source/TapeDelay.h index f5fcb6ce3..d1708fa60 100755 --- a/plugins/MacSignedVST/TapeDelay/source/TapeDelay.h +++ b/plugins/MacSignedVST/TapeDelay/source/TapeDelay.h @@ -66,8 +66,8 @@ private: int maxdelay; int chase; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/TapeDelay/source/TapeDelayProc.cpp b/plugins/MacSignedVST/TapeDelay/source/TapeDelayProc.cpp index e2f1ade22..ef32867b9 100755 --- a/plugins/MacSignedVST/TapeDelay/source/TapeDelayProc.cpp +++ b/plugins/MacSignedVST/TapeDelay/source/TapeDelayProc.cpp @@ -35,8 +35,8 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -156,14 +156,14 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -202,8 +202,8 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -323,16 +323,14 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2.h b/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2.h index 5f9d9e7a3..178d356fb 100755 --- a/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2.h +++ b/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2.h @@ -62,16 +62,16 @@ private: double prevSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; double prevSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2Proc.cpp b/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2Proc.cpp index 3fbb9d938..a6b4e4b2d 100755 --- a/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2Proc.cpp +++ b/plugins/MacSignedVST/TapeDelay2/source/TapeDelay2Proc.cpp @@ -62,12 +62,12 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -266,12 +266,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -283,7 +283,7 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -397,12 +397,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp b/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp index 9011c04d9..4bf9003fd 100755 --- a/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp +++ b/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp @@ -30,8 +30,8 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -99,8 +99,8 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/TapeDust/source/TapeDust.cpp b/plugins/MacSignedVST/TapeDust/source/TapeDust.cpp index 0ce16e093..11ff21768 100755 --- a/plugins/MacSignedVST/TapeDust/source/TapeDust.cpp +++ b/plugins/MacSignedVST/TapeDust/source/TapeDust.cpp @@ -22,8 +22,8 @@ TapeDust::TapeDust(audioMasterCallback audioMaster) : fR[count] = 0.0; } - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/TapeDust/source/TapeDust.h b/plugins/MacSignedVST/TapeDust/source/TapeDust.h index facbf408f..4918fdcb3 100755 --- a/plugins/MacSignedVST/TapeDust/source/TapeDust.h +++ b/plugins/MacSignedVST/TapeDust/source/TapeDust.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff diff --git a/plugins/MacSignedVST/TapeDust/source/TapeDustProc.cpp b/plugins/MacSignedVST/TapeDust/source/TapeDustProc.cpp index 429a3667f..9d7aceff9 100755 --- a/plugins/MacSignedVST/TapeDust/source/TapeDustProc.cpp +++ b/plugins/MacSignedVST/TapeDust/source/TapeDustProc.cpp @@ -13,8 +13,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -32,44 +32,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -118,14 +82,14 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -143,8 +107,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* in2 = inputs[1]; double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -162,44 +126,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -248,16 +176,14 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TapeFat/source/TapeFat.cpp b/plugins/MacSignedVST/TapeFat/source/TapeFat.cpp index 26478dfe6..bcb1927b5 100755 --- a/plugins/MacSignedVST/TapeFat/source/TapeFat.cpp +++ b/plugins/MacSignedVST/TapeFat/source/TapeFat.cpp @@ -18,8 +18,8 @@ TapeFat::TapeFat(audioMasterCallback audioMaster) : for(int count = 0; count < 257; count++) {pL[count] = 0;pR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/TapeFat/source/TapeFat.h b/plugins/MacSignedVST/TapeFat/source/TapeFat.h index 614ee47ff..0ce30222f 100755 --- a/plugins/MacSignedVST/TapeFat/source/TapeFat.h +++ b/plugins/MacSignedVST/TapeFat/source/TapeFat.h @@ -57,8 +57,8 @@ private: int pR[258]; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/TapeFat/source/TapeFatProc.cpp b/plugins/MacSignedVST/TapeFat/source/TapeFatProc.cpp index 8eb0e98e9..7d0e52a57 100755 --- a/plugins/MacSignedVST/TapeFat/source/TapeFatProc.cpp +++ b/plugins/MacSignedVST/TapeFat/source/TapeFatProc.cpp @@ -25,8 +25,8 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -119,14 +119,14 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -156,8 +156,8 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -250,16 +250,14 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Thunder/source/Thunder.cpp b/plugins/MacSignedVST/Thunder/source/Thunder.cpp index 7bc8226ab..b206dace5 100755 --- a/plugins/MacSignedVST/Thunder/source/Thunder.cpp +++ b/plugins/MacSignedVST/Thunder/source/Thunder.cpp @@ -15,8 +15,8 @@ Thunder::Thunder(audioMasterCallback audioMaster) : A = 0.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/MacSignedVST/Thunder/source/Thunder.h b/plugins/MacSignedVST/Thunder/source/Thunder.h index 9e49054f5..fc8bf411e 100755 --- a/plugins/MacSignedVST/Thunder/source/Thunder.h +++ b/plugins/MacSignedVST/Thunder/source/Thunder.h @@ -69,8 +69,8 @@ private: double iirSampleAM; double iirSampleBM; double iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/MacSignedVST/Thunder/source/ThunderProc.cpp b/plugins/MacSignedVST/Thunder/source/ThunderProc.cpp index 2cf454d35..ce6b41c13 100755 --- a/plugins/MacSignedVST/Thunder/source/ThunderProc.cpp +++ b/plugins/MacSignedVST/Thunder/source/ThunderProc.cpp @@ -40,51 +40,15 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -222,14 +186,14 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -275,51 +239,15 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -457,16 +385,14 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ToTape5/source/ToTape5.cpp b/plugins/MacSignedVST/ToTape5/source/ToTape5.cpp index 6136aafb5..509c70874 100755 --- a/plugins/MacSignedVST/ToTape5/source/ToTape5.cpp +++ b/plugins/MacSignedVST/ToTape5/source/ToTape5.cpp @@ -98,8 +98,8 @@ ToTape5::ToTape5(audioMasterCallback audioMaster) : hcount = 0; flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ToTape5/source/ToTape5.h b/plugins/MacSignedVST/ToTape5/source/ToTape5.h index d049014d6..b35426a07 100755 --- a/plugins/MacSignedVST/ToTape5/source/ToTape5.h +++ b/plugins/MacSignedVST/ToTape5/source/ToTape5.h @@ -140,8 +140,8 @@ private: double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp b/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp index 5824f8030..3db88a2ec 100755 --- a/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp +++ b/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp @@ -17,7 +17,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -63,52 +63,16 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -355,14 +319,14 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -384,7 +348,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -429,51 +393,15 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifierR; double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -720,16 +648,14 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ToTape6/source/ToTape6.h b/plugins/MacSignedVST/ToTape6/source/ToTape6.h index fba651fd1..a613c4812 100755 --- a/plugins/MacSignedVST/ToTape6/source/ToTape6.h +++ b/plugins/MacSignedVST/ToTape6/source/ToTape6.h @@ -73,19 +73,19 @@ private: double iirMidRollerBR; double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp b/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp index 1b4ff7de7..49e72323b 100755 --- a/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp +++ b/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp @@ -54,12 +54,12 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -74,7 +74,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -93,13 +93,13 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -201,15 +201,15 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -241,7 +241,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding @@ -388,12 +388,12 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -408,7 +408,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -427,13 +427,13 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -535,15 +535,15 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -575,7 +575,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.cpp b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.cpp index 429187cf3..3d46fd518 100755 --- a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.cpp +++ b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.cpp @@ -87,8 +87,8 @@ ToVinyl4::ToVinyl4(audioMasterCallback audioMaster) : B = 0.3424051; //44.0 hz = ((B*B)*290)+10 (B*B)*290 = 34 (B*B) = 0.1172413 sqrt() = 0.3424051 C = 0.32; D = 0.064; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.h b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.h index 6a2dc26ed..d1a7363eb 100755 --- a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.h +++ b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4.h @@ -142,8 +142,8 @@ private: double bMidPrev; double bSidePrev; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4Proc.cpp b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4Proc.cpp index a67af995f..1bb4c1841 100755 --- a/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4Proc.cpp +++ b/plugins/MacSignedVST/ToVinyl4/source/ToVinyl4Proc.cpp @@ -217,44 +217,8 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -461,14 +425,14 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -689,44 +653,8 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -933,16 +861,14 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/ToneSlant/source/ToneSlant.cpp b/plugins/MacSignedVST/ToneSlant/source/ToneSlant.cpp index d99fa60a7..6bc494340 100755 --- a/plugins/MacSignedVST/ToneSlant/source/ToneSlant.cpp +++ b/plugins/MacSignedVST/ToneSlant/source/ToneSlant.cpp @@ -15,8 +15,8 @@ ToneSlant::ToneSlant(audioMasterCallback audioMaster) : A = 0.0; B = 0.0; for(int count = 0; count < 102; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ToneSlant/source/ToneSlant.h b/plugins/MacSignedVST/ToneSlant/source/ToneSlant.h index 7c52bca20..ca55bbf14 100755 --- a/plugins/MacSignedVST/ToneSlant/source/ToneSlant.h +++ b/plugins/MacSignedVST/ToneSlant/source/ToneSlant.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/ToneSlant/source/ToneSlantProc.cpp b/plugins/MacSignedVST/ToneSlant/source/ToneSlantProc.cpp index d78cfb574..7397d8aa4 100755 --- a/plugins/MacSignedVST/ToneSlant/source/ToneSlantProc.cpp +++ b/plugins/MacSignedVST/ToneSlant/source/ToneSlantProc.cpp @@ -48,44 +48,8 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -106,14 +70,14 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -165,44 +129,8 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -223,16 +151,14 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TransDesk/source/TransDesk.cpp b/plugins/MacSignedVST/TransDesk/source/TransDesk.cpp index 3f352f7fe..d26434509 100755 --- a/plugins/MacSignedVST/TransDesk/source/TransDesk.cpp +++ b/plugins/MacSignedVST/TransDesk/source/TransDesk.cpp @@ -25,8 +25,8 @@ TransDesk::TransDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/TransDesk/source/TransDesk.h b/plugins/MacSignedVST/TransDesk/source/TransDesk.h index 5729b4c4e..4657525a2 100755 --- a/plugins/MacSignedVST/TransDesk/source/TransDesk.h +++ b/plugins/MacSignedVST/TransDesk/source/TransDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[20]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[20]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacSignedVST/TransDesk/source/TransDeskProc.cpp b/plugins/MacSignedVST/TransDesk/source/TransDeskProc.cpp index c8b45c2d5..9768c73fb 100755 --- a/plugins/MacSignedVST/TransDesk/source/TransDeskProc.cpp +++ b/plugins/MacSignedVST/TransDesk/source/TransDeskProc.cpp @@ -40,53 +40,17 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -197,14 +161,14 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,53 +213,17 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -406,16 +334,14 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TremoSquare/source/TremoSquareProc.cpp b/plugins/MacSignedVST/TremoSquare/source/TremoSquareProc.cpp index ef99feb16..1c627a8e6 100755 --- a/plugins/MacSignedVST/TremoSquare/source/TremoSquareProc.cpp +++ b/plugins/MacSignedVST/TremoSquare/source/TremoSquareProc.cpp @@ -23,12 +23,12 @@ void TremoSquare::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code @@ -92,12 +92,12 @@ void TremoSquare::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code diff --git a/plugins/MacSignedVST/Tremolo/source/Tremolo.cpp b/plugins/MacSignedVST/Tremolo/source/Tremolo.cpp index f0b649d78..b57f9ec20 100755 --- a/plugins/MacSignedVST/Tremolo/source/Tremolo.cpp +++ b/plugins/MacSignedVST/Tremolo/source/Tremolo.cpp @@ -21,8 +21,8 @@ Tremolo::Tremolo(audioMasterCallback audioMaster) : depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Tremolo/source/Tremolo.h b/plugins/MacSignedVST/Tremolo/source/Tremolo.h index 11fc718fb..1f1d00675 100755 --- a/plugins/MacSignedVST/Tremolo/source/Tremolo.h +++ b/plugins/MacSignedVST/Tremolo/source/Tremolo.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sweep; diff --git a/plugins/MacSignedVST/Tremolo/source/TremoloProc.cpp b/plugins/MacSignedVST/Tremolo/source/TremoloProc.cpp index d27dc86c7..e63f0b044 100755 --- a/plugins/MacSignedVST/Tremolo/source/TremoloProc.cpp +++ b/plugins/MacSignedVST/Tremolo/source/TremoloProc.cpp @@ -38,53 +38,17 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -198,53 +162,17 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -309,16 +237,14 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/TripleSpread/source/TripleSpreadProc.cpp b/plugins/MacSignedVST/TripleSpread/source/TripleSpreadProc.cpp index 09b8dd534..6bd70e790 100755 --- a/plugins/MacSignedVST/TripleSpread/source/TripleSpreadProc.cpp +++ b/plugins/MacSignedVST/TripleSpread/source/TripleSpreadProc.cpp @@ -21,12 +21,12 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -291,8 +291,8 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; @@ -340,12 +340,12 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -610,8 +610,8 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/MacSignedVST/Tube/source/Tube.h b/plugins/MacSignedVST/Tube/source/Tube.h index d44d0e3ab..c423e2802 100755 --- a/plugins/MacSignedVST/Tube/source/Tube.h +++ b/plugins/MacSignedVST/Tube/source/Tube.h @@ -52,10 +52,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Tube/source/TubeProc.cpp b/plugins/MacSignedVST/Tube/source/TubeProc.cpp index 8952b4238..068a6ea5e 100755 --- a/plugins/MacSignedVST/Tube/source/TubeProc.cpp +++ b/plugins/MacSignedVST/Tube/source/TubeProc.cpp @@ -33,13 +33,13 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -87,7 +87,7 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -138,13 +138,13 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -192,19 +192,19 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Tube2/source/Tube2.h b/plugins/MacSignedVST/Tube2/source/Tube2.h index 24f7f73cd..80bfcc84b 100755 --- a/plugins/MacSignedVST/Tube2/source/Tube2.h +++ b/plugins/MacSignedVST/Tube2/source/Tube2.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; - long double previousSampleE; - long double previousSampleF; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; + double previousSampleE; + double previousSampleF; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/Tube2/source/Tube2Proc.cpp b/plugins/MacSignedVST/Tube2/source/Tube2Proc.cpp index 33dc4d827..e3c528b96 100755 --- a/plugins/MacSignedVST/Tube2/source/Tube2Proc.cpp +++ b/plugins/MacSignedVST/Tube2/source/Tube2Proc.cpp @@ -27,10 +27,10 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -38,7 +38,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -51,7 +51,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -84,7 +84,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -92,9 +92,9 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -107,7 +107,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -158,10 +158,10 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -169,7 +169,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -182,7 +182,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -215,7 +215,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -223,9 +223,9 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -238,7 +238,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -251,12 +251,12 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end hysteresis and spiky fuzz section //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/TubeDesk/source/TubeDesk.cpp b/plugins/MacSignedVST/TubeDesk/source/TubeDesk.cpp index 5a7465c3b..5a42bb4aa 100755 --- a/plugins/MacSignedVST/TubeDesk/source/TubeDesk.cpp +++ b/plugins/MacSignedVST/TubeDesk/source/TubeDesk.cpp @@ -25,8 +25,8 @@ TubeDesk::TubeDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/TubeDesk/source/TubeDesk.h b/plugins/MacSignedVST/TubeDesk/source/TubeDesk.h index fb15768fb..7ef3e35be 100755 --- a/plugins/MacSignedVST/TubeDesk/source/TubeDesk.h +++ b/plugins/MacSignedVST/TubeDesk/source/TubeDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[5000]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[5000]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacSignedVST/TubeDesk/source/TubeDeskProc.cpp b/plugins/MacSignedVST/TubeDesk/source/TubeDeskProc.cpp index cccf6e2cc..72b8fe2c7 100755 --- a/plugins/MacSignedVST/TubeDesk/source/TubeDeskProc.cpp +++ b/plugins/MacSignedVST/TubeDesk/source/TubeDeskProc.cpp @@ -39,53 +39,17 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -196,14 +160,14 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,53 +211,17 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -404,16 +332,14 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/UltrasonX/source/UltrasonX.h b/plugins/MacSignedVST/UltrasonX/source/UltrasonX.h index 439c12866..dccd0df88 100755 --- a/plugins/MacSignedVST/UltrasonX/source/UltrasonX.h +++ b/plugins/MacSignedVST/UltrasonX/source/UltrasonX.h @@ -66,7 +66,7 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/UltrasonX/source/UltrasonXProc.cpp b/plugins/MacSignedVST/UltrasonX/source/UltrasonXProc.cpp index 8a0955704..09a93d0a6 100755 --- a/plugins/MacSignedVST/UltrasonX/source/UltrasonXProc.cpp +++ b/plugins/MacSignedVST/UltrasonX/source/UltrasonXProc.cpp @@ -34,8 +34,8 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -45,12 +45,12 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -105,8 +105,8 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -116,12 +116,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -131,12 +131,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = temp; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Ultrasonic/source/Ultrasonic.h b/plugins/MacSignedVST/Ultrasonic/source/Ultrasonic.h index 929c3c8aa..f853b70e2 100755 --- a/plugins/MacSignedVST/Ultrasonic/source/Ultrasonic.h +++ b/plugins/MacSignedVST/Ultrasonic/source/Ultrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacSignedVST/Ultrasonic/source/UltrasonicProc.cpp b/plugins/MacSignedVST/Ultrasonic/source/UltrasonicProc.cpp index 7049da762..0bb52e5e0 100755 --- a/plugins/MacSignedVST/Ultrasonic/source/UltrasonicProc.cpp +++ b/plugins/MacSignedVST/Ultrasonic/source/UltrasonicProc.cpp @@ -63,12 +63,12 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLite.h b/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLite.h index 73fb675ad..59fd77310 100755 --- a/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLite.h +++ b/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLite.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLiteProc.cpp b/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLiteProc.cpp index bd62ec460..8bf48c273 100755 --- a/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLiteProc.cpp +++ b/plugins/MacSignedVST/UltrasonicLite/source/UltrasonicLiteProc.cpp @@ -28,15 +28,15 @@ void UltrasonicLite::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 32 bit stereo floating point dither @@ -79,15 +79,15 @@ void UltrasonicLite::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 64 bit stereo floating point dither diff --git a/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMed.h b/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMed.h index ca6b4f9d1..0a3552480 100755 --- a/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMed.h +++ b/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMed.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpd; //default stuff diff --git a/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMedProc.cpp b/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMedProc.cpp index 9c584ac7c..152e5b0ce 100755 --- a/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMedProc.cpp +++ b/plugins/MacSignedVST/UltrasonicMed/source/UltrasonicMedProc.cpp @@ -41,18 +41,18 @@ void UltrasonicMed::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -111,18 +111,18 @@ void UltrasonicMed::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacSignedVST/UnBox/source/UnBox.h b/plugins/MacSignedVST/UnBox/source/UnBox.h index 73cb40f6b..0de78a63d 100755 --- a/plugins/MacSignedVST/UnBox/source/UnBox.h +++ b/plugins/MacSignedVST/UnBox/source/UnBox.h @@ -56,18 +56,18 @@ private: uint32_t fpd; //default stuff - long double aL[5]; - long double bL[5]; - long double cL[11]; - long double aR[5]; - long double bR[5]; - long double cR[11]; - long double e[5]; - long double f[11]; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; + double aL[5]; + double bL[5]; + double cL[11]; + double aR[5]; + double bR[5]; + double cR[11]; + double e[5]; + double f[11]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; float A; diff --git a/plugins/MacSignedVST/UnBox/source/UnBoxProc.cpp b/plugins/MacSignedVST/UnBox/source/UnBoxProc.cpp index 40585b3ce..e45e21e08 100755 --- a/plugins/MacSignedVST/UnBox/source/UnBoxProc.cpp +++ b/plugins/MacSignedVST/UnBox/source/UnBoxProc.cpp @@ -68,16 +68,16 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -130,7 +130,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -146,7 +146,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; @@ -265,16 +265,16 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -327,7 +327,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -343,7 +343,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; diff --git a/plugins/MacSignedVST/VariMu/source/VariMu.cpp b/plugins/MacSignedVST/VariMu/source/VariMu.cpp index c4d63b29e..e71b73000 100755 --- a/plugins/MacSignedVST/VariMu/source/VariMu.cpp +++ b/plugins/MacSignedVST/VariMu/source/VariMu.cpp @@ -32,8 +32,8 @@ VariMu::VariMu(audioMasterCallback audioMaster) : B = 0.5; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/VariMu/source/VariMu.h b/plugins/MacSignedVST/VariMu/source/VariMu.h index d79dff11b..d06ae8cfc 100755 --- a/plugins/MacSignedVST/VariMu/source/VariMu.h +++ b/plugins/MacSignedVST/VariMu/source/VariMu.h @@ -74,8 +74,8 @@ private: double previousR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/VariMu/source/VariMuProc.cpp b/plugins/MacSignedVST/VariMu/source/VariMuProc.cpp index 323b5e490..a4482761f 100755 --- a/plugins/MacSignedVST/VariMu/source/VariMuProc.cpp +++ b/plugins/MacSignedVST/VariMu/source/VariMuProc.cpp @@ -31,15 +31,15 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -233,14 +233,14 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -276,15 +276,15 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -322,8 +322,8 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -478,16 +478,14 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/Verbity/Verbity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacSignedVST/Verbity/Verbity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Verbity/Verbity.xcodeproj/xcshareddata/xcschemes/Verbity.xcscheme b/plugins/MacSignedVST/Verbity/Verbity.xcodeproj/xcshareddata/xcschemes/Verbity.xcscheme old mode 100644 new mode 100755 diff --git a/plugins/MacSignedVST/Verbity/source/VerbityProc.cpp b/plugins/MacSignedVST/Verbity/source/VerbityProc.cpp index 9a719ea4d..286a798c8 100755 --- a/plugins/MacSignedVST/Verbity/source/VerbityProc.cpp +++ b/plugins/MacSignedVST/Verbity/source/VerbityProc.cpp @@ -56,12 +56,12 @@ void Verbity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -292,12 +292,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -461,12 +461,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Vibrato/source/VibratoProc.cpp b/plugins/MacSignedVST/Vibrato/source/VibratoProc.cpp index 551fb2d09..150da0987 100755 --- a/plugins/MacSignedVST/Vibrato/source/VibratoProc.cpp +++ b/plugins/MacSignedVST/Vibrato/source/VibratoProc.cpp @@ -22,8 +22,8 @@ void Vibrato::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; double drySampleL = inputSampleL; @@ -120,8 +120,8 @@ void Vibrato::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; double drySampleL = inputSampleL; diff --git a/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp b/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp index f6cd4e85b..d73eece2d 100755 --- a/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp +++ b/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp @@ -30,8 +30,8 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -169,8 +169,8 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp index 19f1d9493..ac1ed8939 100755 --- a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp +++ b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp @@ -28,8 +28,8 @@ VoiceOfTheStarship::VoiceOfTheStarship(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h index 519923b71..51c66c043 100755 --- a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h +++ b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h @@ -73,8 +73,8 @@ private: int lastAlgorithm; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp index bbb14faf6..dda1805dc 100755 --- a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp +++ b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp @@ -178,14 +178,14 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn filterflip = !filterflip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -367,16 +367,14 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output flipR = !flipR; filterflip = !filterflip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/VoiceTrick/source/VoiceTrickProc.cpp b/plugins/MacSignedVST/VoiceTrick/source/VoiceTrickProc.cpp index b57b695de..0de1f49ae 100755 --- a/plugins/MacSignedVST/VoiceTrick/source/VoiceTrickProc.cpp +++ b/plugins/MacSignedVST/VoiceTrick/source/VoiceTrickProc.cpp @@ -23,8 +23,8 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -32,7 +32,7 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) @@ -126,8 +126,8 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -135,7 +135,7 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/MacSignedVST/Wider/source/Wider.cpp b/plugins/MacSignedVST/Wider/source/Wider.cpp index 26d4d47d5..a7cb54608 100755 --- a/plugins/MacSignedVST/Wider/source/Wider.cpp +++ b/plugins/MacSignedVST/Wider/source/Wider.cpp @@ -17,8 +17,8 @@ Wider::Wider(audioMasterCallback audioMaster) : C = 1.0; for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Wider/source/Wider.h b/plugins/MacSignedVST/Wider/source/Wider.h index 6a6a2dfc5..a79fa43f0 100755 --- a/plugins/MacSignedVST/Wider/source/Wider.h +++ b/plugins/MacSignedVST/Wider/source/Wider.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double p[4099]; diff --git a/plugins/MacSignedVST/Wider/source/WiderProc.cpp b/plugins/MacSignedVST/Wider/source/WiderProc.cpp index f90fa210c..d860ce370 100755 --- a/plugins/MacSignedVST/Wider/source/WiderProc.cpp +++ b/plugins/MacSignedVST/Wider/source/WiderProc.cpp @@ -18,12 +18,12 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -46,44 +46,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -138,14 +102,14 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,12 +132,12 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -196,44 +160,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -288,16 +216,14 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/XBandpass/source/XBandpass.h b/plugins/MacSignedVST/XBandpass/source/XBandpass.h index 144855c8b..d03811383 100755 --- a/plugins/MacSignedVST/XBandpass/source/XBandpass.h +++ b/plugins/MacSignedVST/XBandpass/source/XBandpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/XBandpass/source/XBandpassProc.cpp b/plugins/MacSignedVST/XBandpass/source/XBandpassProc.cpp index 4540db0df..53f7c5f2a 100755 --- a/plugins/MacSignedVST/XBandpass/source/XBandpassProc.cpp +++ b/plugins/MacSignedVST/XBandpass/source/XBandpassProc.cpp @@ -46,24 +46,24 @@ void XBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -221,24 +221,24 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -339,12 +339,12 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/XHighpass/source/XHighpass.h b/plugins/MacSignedVST/XHighpass/source/XHighpass.h index 54165b3e0..8001ab17b 100755 --- a/plugins/MacSignedVST/XHighpass/source/XHighpass.h +++ b/plugins/MacSignedVST/XHighpass/source/XHighpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/XHighpass/source/XHighpassProc.cpp b/plugins/MacSignedVST/XHighpass/source/XHighpassProc.cpp index 7fb2f3100..dd6a8d08e 100755 --- a/plugins/MacSignedVST/XHighpass/source/XHighpassProc.cpp +++ b/plugins/MacSignedVST/XHighpass/source/XHighpassProc.cpp @@ -44,24 +44,24 @@ void XHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -197,24 +197,24 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -295,12 +295,12 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/XLowpass/source/XLowpass.h b/plugins/MacSignedVST/XLowpass/source/XLowpass.h index 928e6d0b4..dac60bc2a 100755 --- a/plugins/MacSignedVST/XLowpass/source/XLowpass.h +++ b/plugins/MacSignedVST/XLowpass/source/XLowpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/XLowpass/source/XLowpassProc.cpp b/plugins/MacSignedVST/XLowpass/source/XLowpassProc.cpp index a2b71cb1b..48ea9f36b 100755 --- a/plugins/MacSignedVST/XLowpass/source/XLowpassProc.cpp +++ b/plugins/MacSignedVST/XLowpass/source/XLowpassProc.cpp @@ -47,24 +47,24 @@ void XLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -223,24 +223,24 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -341,12 +341,12 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/XNotch/source/XNotch.h b/plugins/MacSignedVST/XNotch/source/XNotch.h index e83b2c356..85a0781d7 100755 --- a/plugins/MacSignedVST/XNotch/source/XNotch.h +++ b/plugins/MacSignedVST/XNotch/source/XNotch.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/XNotch/source/XNotchProc.cpp b/plugins/MacSignedVST/XNotch/source/XNotchProc.cpp index efccb1de8..3e867df7b 100755 --- a/plugins/MacSignedVST/XNotch/source/XNotchProc.cpp +++ b/plugins/MacSignedVST/XNotch/source/XNotchProc.cpp @@ -44,24 +44,24 @@ void XNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -223,24 +223,24 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -347,12 +347,12 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/XRegion/source/XRegion.h b/plugins/MacSignedVST/XRegion/source/XRegion.h index e42abe2b3..5234fc31c 100755 --- a/plugins/MacSignedVST/XRegion/source/XRegion.h +++ b/plugins/MacSignedVST/XRegion/source/XRegion.h @@ -56,11 +56,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/XRegion/source/XRegionProc.cpp b/plugins/MacSignedVST/XRegion/source/XRegionProc.cpp index 3c7f95e46..a65f234e8 100755 --- a/plugins/MacSignedVST/XRegion/source/XRegionProc.cpp +++ b/plugins/MacSignedVST/XRegion/source/XRegionProc.cpp @@ -96,24 +96,24 @@ void XRegion::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -338,24 +338,24 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -473,12 +473,12 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/YBandpass/source/YBandpass.h b/plugins/MacSignedVST/YBandpass/source/YBandpass.h index 903d563dc..e72e50d43 100755 --- a/plugins/MacSignedVST/YBandpass/source/YBandpass.h +++ b/plugins/MacSignedVST/YBandpass/source/YBandpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/YBandpass/source/YBandpassProc.cpp b/plugins/MacSignedVST/YBandpass/source/YBandpassProc.cpp index bf9b2aa2b..efdf576b5 100755 --- a/plugins/MacSignedVST/YBandpass/source/YBandpassProc.cpp +++ b/plugins/MacSignedVST/YBandpass/source/YBandpassProc.cpp @@ -66,23 +66,23 @@ void YBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/YHighpass/source/YHighpass.h b/plugins/MacSignedVST/YHighpass/source/YHighpass.h index 05eb71a64..079d3bc00 100755 --- a/plugins/MacSignedVST/YHighpass/source/YHighpass.h +++ b/plugins/MacSignedVST/YHighpass/source/YHighpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/YHighpass/source/YHighpassProc.cpp b/plugins/MacSignedVST/YHighpass/source/YHighpassProc.cpp index 3333b4158..60626324f 100755 --- a/plugins/MacSignedVST/YHighpass/source/YHighpassProc.cpp +++ b/plugins/MacSignedVST/YHighpass/source/YHighpassProc.cpp @@ -66,23 +66,23 @@ void YHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/YLowpass/source/YLowpass.h b/plugins/MacSignedVST/YLowpass/source/YLowpass.h index 12ed3a63f..d26f5f781 100755 --- a/plugins/MacSignedVST/YLowpass/source/YLowpass.h +++ b/plugins/MacSignedVST/YLowpass/source/YLowpass.h @@ -81,15 +81,15 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; - //long double biquadC[biq_total]; - //long double biquadD[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double biquad[biq_total]; + //double biquadC[biq_total]; + //double biquadD[biq_total]; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -105,8 +105,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/YLowpass/source/YLowpassProc.cpp b/plugins/MacSignedVST/YLowpass/source/YLowpassProc.cpp index 86343995d..a4c489f53 100755 --- a/plugins/MacSignedVST/YLowpass/source/YLowpassProc.cpp +++ b/plugins/MacSignedVST/YLowpass/source/YLowpassProc.cpp @@ -66,23 +66,23 @@ void YLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/YNotch/source/YNotch.h b/plugins/MacSignedVST/YNotch/source/YNotch.h index 3a7074bec..e699edb1f 100755 --- a/plugins/MacSignedVST/YNotch/source/YNotch.h +++ b/plugins/MacSignedVST/YNotch/source/YNotch.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/YNotch/source/YNotchProc.cpp b/plugins/MacSignedVST/YNotch/source/YNotchProc.cpp index ef6b9c773..f3535a645 100755 --- a/plugins/MacSignedVST/YNotch/source/YNotchProc.cpp +++ b/plugins/MacSignedVST/YNotch/source/YNotchProc.cpp @@ -65,23 +65,23 @@ void YNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -218,23 +218,23 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -295,12 +295,12 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZBandpass/source/ZBandpass.h b/plugins/MacSignedVST/ZBandpass/source/ZBandpass.h index febc1562b..6dd973ab7 100755 --- a/plugins/MacSignedVST/ZBandpass/source/ZBandpass.h +++ b/plugins/MacSignedVST/ZBandpass/source/ZBandpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZBandpass/source/ZBandpassProc.cpp b/plugins/MacSignedVST/ZBandpass/source/ZBandpassProc.cpp index 1345861c0..ab264eb48 100755 --- a/plugins/MacSignedVST/ZBandpass/source/ZBandpassProc.cpp +++ b/plugins/MacSignedVST/ZBandpass/source/ZBandpassProc.cpp @@ -63,18 +63,18 @@ void ZBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -254,18 +254,18 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -371,12 +371,12 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2.h b/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2.h index 8aae72342..35e06499f 100755 --- a/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2.h +++ b/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2Proc.cpp b/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2Proc.cpp index 641a5634a..60ec7317e 100755 --- a/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2Proc.cpp +++ b/plugins/MacSignedVST/ZBandpass2/source/ZBandpass2Proc.cpp @@ -62,16 +62,16 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h b/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h index 5b47dcd95..d37a5ac4a 100755 --- a/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h +++ b/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZHighpass/source/ZHighpassProc.cpp b/plugins/MacSignedVST/ZHighpass/source/ZHighpassProc.cpp index 43ed909bb..09a18cfb2 100755 --- a/plugins/MacSignedVST/ZHighpass/source/ZHighpassProc.cpp +++ b/plugins/MacSignedVST/ZHighpass/source/ZHighpassProc.cpp @@ -61,18 +61,18 @@ void ZHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -243,18 +243,18 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -355,12 +355,12 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2.h b/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2.h index d5bb73f3a..7c8d3a52f 100755 --- a/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2.h +++ b/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2Proc.cpp b/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2Proc.cpp index 7bb5b9a99..5add1560b 100755 --- a/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2Proc.cpp +++ b/plugins/MacSignedVST/ZHighpass2/source/ZHighpass2Proc.cpp @@ -62,16 +62,16 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZLowpass/source/ZLowpass.h b/plugins/MacSignedVST/ZLowpass/source/ZLowpass.h index d32901e01..3939e781b 100755 --- a/plugins/MacSignedVST/ZLowpass/source/ZLowpass.h +++ b/plugins/MacSignedVST/ZLowpass/source/ZLowpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZLowpass/source/ZLowpassProc.cpp b/plugins/MacSignedVST/ZLowpass/source/ZLowpassProc.cpp index 728f25dde..c5df9e840 100755 --- a/plugins/MacSignedVST/ZLowpass/source/ZLowpassProc.cpp +++ b/plugins/MacSignedVST/ZLowpass/source/ZLowpassProc.cpp @@ -63,18 +63,18 @@ void ZLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2.h b/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2.h index b093df0e7..1f51c3c2e 100755 --- a/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2.h +++ b/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2Proc.cpp b/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2Proc.cpp index 61bc55947..415ca5f47 100755 --- a/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2Proc.cpp +++ b/plugins/MacSignedVST/ZLowpass2/source/ZLowpass2Proc.cpp @@ -62,16 +62,16 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZNotch/source/ZNotch.h b/plugins/MacSignedVST/ZNotch/source/ZNotch.h index 603ffa4ec..e493e40f6 100755 --- a/plugins/MacSignedVST/ZNotch/source/ZNotch.h +++ b/plugins/MacSignedVST/ZNotch/source/ZNotch.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZNotch/source/ZNotchProc.cpp b/plugins/MacSignedVST/ZNotch/source/ZNotchProc.cpp index a5eaba61e..37871fa0e 100755 --- a/plugins/MacSignedVST/ZNotch/source/ZNotchProc.cpp +++ b/plugins/MacSignedVST/ZNotch/source/ZNotchProc.cpp @@ -63,18 +63,18 @@ void ZNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/ZNotch2/source/ZNotch2.h b/plugins/MacSignedVST/ZNotch2/source/ZNotch2.h index 3dde478ea..f23bf7b0d 100755 --- a/plugins/MacSignedVST/ZNotch2/source/ZNotch2.h +++ b/plugins/MacSignedVST/ZNotch2/source/ZNotch2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacSignedVST/ZNotch2/source/ZNotch2Proc.cpp b/plugins/MacSignedVST/ZNotch2/source/ZNotch2Proc.cpp index 9e9443722..1e2f92745 100755 --- a/plugins/MacSignedVST/ZNotch2/source/ZNotch2Proc.cpp +++ b/plugins/MacSignedVST/ZNotch2/source/ZNotch2Proc.cpp @@ -62,16 +62,16 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/curve/source/curve.h b/plugins/MacSignedVST/curve/source/curve.h index b1c313eec..4dd52f8e7 100755 --- a/plugins/MacSignedVST/curve/source/curve.h +++ b/plugins/MacSignedVST/curve/source/curve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff }; diff --git a/plugins/MacSignedVST/curve/source/curveProc.cpp b/plugins/MacSignedVST/curve/source/curveProc.cpp index d7739b806..3a3f18b86 100755 --- a/plugins/MacSignedVST/curve/source/curveProc.cpp +++ b/plugins/MacSignedVST/curve/source/curveProc.cpp @@ -16,8 +16,8 @@ void curve::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -65,8 +65,8 @@ void curve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacSignedVST/uLawDecode/source/uLawDecode.cpp b/plugins/MacSignedVST/uLawDecode/source/uLawDecode.cpp index 234bc6cff..e1dd5cc6e 100755 --- a/plugins/MacSignedVST/uLawDecode/source/uLawDecode.cpp +++ b/plugins/MacSignedVST/uLawDecode/source/uLawDecode.cpp @@ -14,8 +14,8 @@ uLawDecode::uLawDecode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/uLawDecode/source/uLawDecode.h b/plugins/MacSignedVST/uLawDecode/source/uLawDecode.h index ec3f23285..fb74bcdba 100755 --- a/plugins/MacSignedVST/uLawDecode/source/uLawDecode.h +++ b/plugins/MacSignedVST/uLawDecode/source/uLawDecode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/uLawDecode/source/uLawDecodeProc.cpp b/plugins/MacSignedVST/uLawDecode/source/uLawDecodeProc.cpp index 18356232c..0c0ee1f1f 100755 --- a/plugins/MacSignedVST/uLawDecode/source/uLawDecodeProc.cpp +++ b/plugins/MacSignedVST/uLawDecode/source/uLawDecodeProc.cpp @@ -24,8 +24,8 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/uLawEncode/source/uLawEncode.cpp b/plugins/MacSignedVST/uLawEncode/source/uLawEncode.cpp index 0c062b676..e4f3de546 100755 --- a/plugins/MacSignedVST/uLawEncode/source/uLawEncode.cpp +++ b/plugins/MacSignedVST/uLawEncode/source/uLawEncode.cpp @@ -14,8 +14,8 @@ uLawEncode::uLawEncode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/uLawEncode/source/uLawEncode.h b/plugins/MacSignedVST/uLawEncode/source/uLawEncode.h index a8c6858f7..41d0d6008 100755 --- a/plugins/MacSignedVST/uLawEncode/source/uLawEncode.h +++ b/plugins/MacSignedVST/uLawEncode/source/uLawEncode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/uLawEncode/source/uLawEncodeProc.cpp b/plugins/MacSignedVST/uLawEncode/source/uLawEncodeProc.cpp index c5dd74d76..7f0eb12cd 100755 --- a/plugins/MacSignedVST/uLawEncode/source/uLawEncodeProc.cpp +++ b/plugins/MacSignedVST/uLawEncode/source/uLawEncodeProc.cpp @@ -24,8 +24,8 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ADClip7/source/ADClip7.cpp b/plugins/MacVST/ADClip7/source/ADClip7.cpp index 7ebc8179d..9f8bc2c88 100755 --- a/plugins/MacVST/ADClip7/source/ADClip7.cpp +++ b/plugins/MacVST/ADClip7/source/ADClip7.cpp @@ -30,8 +30,8 @@ ADClip7::ADClip7(audioMasterCallback audioMaster) : iirLowsBL = 0.0; iirLowsBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ADClip7/source/ADClip7.h b/plugins/MacVST/ADClip7/source/ADClip7.h index f0cde6cf7..6a619cd09 100755 --- a/plugins/MacVST/ADClip7/source/ADClip7.h +++ b/plugins/MacVST/ADClip7/source/ADClip7.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; float bL[22200]; float bR[22200]; int gcount; @@ -69,8 +69,8 @@ private: double iirLowsAR; double iirLowsBL; double iirLowsBR; - long double refclipL; - long double refclipR; + double refclipL; + double refclipR; float A; float B; diff --git a/plugins/MacVST/ADClip7/source/ADClip7Proc.cpp b/plugins/MacVST/ADClip7/source/ADClip7Proc.cpp index abc9909d5..db5a449b0 100755 --- a/plugins/MacVST/ADClip7/source/ADClip7Proc.cpp +++ b/plugins/MacVST/ADClip7/source/ADClip7Proc.cpp @@ -17,8 +17,8 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -28,7 +28,7 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -55,51 +55,15 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -447,14 +411,14 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,8 +440,8 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -487,7 +451,7 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -514,52 +478,16 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -907,16 +835,14 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ADT/source/ADTProc.cpp b/plugins/MacVST/ADT/source/ADTProc.cpp index 828579d06..555f0877e 100755 --- a/plugins/MacVST/ADT/source/ADTProc.cpp +++ b/plugins/MacVST/ADT/source/ADTProc.cpp @@ -29,8 +29,8 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp index 9b8422125..a96f32802 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.cpp @@ -57,8 +57,8 @@ AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h index 40cfab209..862629b6b 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClip.h @@ -115,8 +115,8 @@ private: double RiirSampleD; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp index cc282b6dd..6ddecdf61 100755 --- a/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp +++ b/plugins/MacVST/AQuickVoiceClip/source/AQuickVoiceClipProc.cpp @@ -42,51 +42,15 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -407,14 +371,14 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); @@ -474,51 +438,15 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -839,16 +767,14 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); diff --git a/plugins/MacVST/Acceleration/source/Acceleration.cpp b/plugins/MacVST/Acceleration/source/Acceleration.cpp index b2721d922..a2d27752d 100755 --- a/plugins/MacVST/Acceleration/source/Acceleration.cpp +++ b/plugins/MacVST/Acceleration/source/Acceleration.cpp @@ -23,8 +23,8 @@ Acceleration::Acceleration(audioMasterCallback audioMaster) : o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Acceleration/source/Acceleration.h b/plugins/MacVST/Acceleration/source/Acceleration.h index 02a3760ba..4e4dea014 100755 --- a/plugins/MacVST/Acceleration/source/Acceleration.h +++ b/plugins/MacVST/Acceleration/source/Acceleration.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double ataLastOutL; double s1L; diff --git a/plugins/MacVST/Acceleration/source/AccelerationProc.cpp b/plugins/MacVST/Acceleration/source/AccelerationProc.cpp index 0151dbeb1..050c433ca 100755 --- a/plugins/MacVST/Acceleration/source/AccelerationProc.cpp +++ b/plugins/MacVST/Acceleration/source/AccelerationProc.cpp @@ -29,51 +29,15 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -132,14 +96,14 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -173,51 +137,15 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -276,16 +204,14 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Acceleration2/source/Acceleration2.h b/plugins/MacVST/Acceleration2/source/Acceleration2.h index e16c92d77..ee3a7e56f 100755 --- a/plugins/MacVST/Acceleration2/source/Acceleration2.h +++ b/plugins/MacVST/Acceleration2/source/Acceleration2.h @@ -64,8 +64,8 @@ private: double m1R; double m2R; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Acceleration2/source/Acceleration2Proc.cpp b/plugins/MacVST/Acceleration2/source/Acceleration2Proc.cpp index 575e70a23..49ece8844 100755 --- a/plugins/MacVST/Acceleration2/source/Acceleration2Proc.cpp +++ b/plugins/MacVST/Acceleration2/source/Acceleration2Proc.cpp @@ -46,14 +46,14 @@ void Acceleration2::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -151,14 +151,14 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -199,12 +199,12 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Air/source/Air.cpp b/plugins/MacVST/Air/source/Air.cpp index ea52c265c..5ad55b387 100755 --- a/plugins/MacVST/Air/source/Air.cpp +++ b/plugins/MacVST/Air/source/Air.cpp @@ -61,8 +61,8 @@ Air::Air(audioMasterCallback audioMaster) : D = 0.0; E = 1.0; F = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Air/source/Air.h b/plugins/MacVST/Air/source/Air.h index a713cf275..9432f792b 100755 --- a/plugins/MacVST/Air/source/Air.h +++ b/plugins/MacVST/Air/source/Air.h @@ -100,8 +100,8 @@ private: bool flop; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Air/source/AirProc.cpp b/plugins/MacVST/Air/source/AirProc.cpp index f5eb39fde..9e72d87e2 100755 --- a/plugins/MacVST/Air/source/AirProc.cpp +++ b/plugins/MacVST/Air/source/AirProc.cpp @@ -23,8 +23,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -34,44 +34,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -257,14 +221,14 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -292,8 +256,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -303,44 +267,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -526,16 +454,14 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Air2/source/Air2.h b/plugins/MacVST/Air2/source/Air2.h index b50e7c919..5fa7a5325 100755 --- a/plugins/MacVST/Air2/source/Air2.h +++ b/plugins/MacVST/Air2/source/Air2.h @@ -106,7 +106,7 @@ private: bool flipB; bool flop; int count; - long double postsine; + double postsine; float A; diff --git a/plugins/MacVST/Air2/source/Air2Proc.cpp b/plugins/MacVST/Air2/source/Air2Proc.cpp index 16b6ae552..e07abffda 100755 --- a/plugins/MacVST/Air2/source/Air2Proc.cpp +++ b/plugins/MacVST/Air2/source/Air2Proc.cpp @@ -44,17 +44,17 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -190,7 +190,7 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -333,17 +333,17 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -479,7 +479,7 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -568,12 +568,12 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Apicolypse/source/ApicolypseProc.cpp b/plugins/MacVST/Apicolypse/source/ApicolypseProc.cpp index b6cdb8513..bc9e99ab5 100755 --- a/plugins/MacVST/Apicolypse/source/ApicolypseProc.cpp +++ b/plugins/MacVST/Apicolypse/source/ApicolypseProc.cpp @@ -37,8 +37,8 @@ void Apicolypse::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -213,8 +213,8 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/AtmosphereBuss/source/AtmosphereBuss.h b/plugins/MacVST/AtmosphereBuss/source/AtmosphereBuss.h index 79a5d23d8..ebaf0919c 100755 --- a/plugins/MacVST/AtmosphereBuss/source/AtmosphereBuss.h +++ b/plugins/MacVST/AtmosphereBuss/source/AtmosphereBuss.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/MacVST/AtmosphereBuss/source/AtmosphereBussProc.cpp b/plugins/MacVST/AtmosphereBuss/source/AtmosphereBussProc.cpp index 16d7a3198..add056764 100755 --- a/plugins/MacVST/AtmosphereBuss/source/AtmosphereBussProc.cpp +++ b/plugins/MacVST/AtmosphereBuss/source/AtmosphereBussProc.cpp @@ -18,10 +18,10 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -249,14 +249,14 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -279,10 +279,10 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -510,16 +510,14 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannel.h b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannel.h index 1e95258b9..4ed29b1c1 100755 --- a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannel.h +++ b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannel.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp index bbdf44cc9..763853004 100755 --- a/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp +++ b/plugins/MacVST/AtmosphereChannel/source/AtmosphereChannelProc.cpp @@ -18,10 +18,10 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -244,14 +244,14 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -274,10 +274,10 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -500,16 +500,14 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Aura/source/Aura.cpp b/plugins/MacVST/Aura/source/Aura.cpp index 8663d3bb1..b26d8a86f 100755 --- a/plugins/MacVST/Aura/source/Aura.cpp +++ b/plugins/MacVST/Aura/source/Aura.cpp @@ -24,8 +24,8 @@ Aura::Aura(audioMasterCallback audioMaster) : lastSampleR = 0.0; previousVelocityR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Aura/source/Aura.h b/plugins/MacVST/Aura/source/Aura.h index 22d4653d0..e0feff0c2 100755 --- a/plugins/MacVST/Aura/source/Aura.h +++ b/plugins/MacVST/Aura/source/Aura.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; + double lastSampleL; double previousVelocityL; - long double lastSampleR; + double lastSampleR; double previousVelocityR; double bL[21]; diff --git a/plugins/MacVST/Aura/source/AuraProc.cpp b/plugins/MacVST/Aura/source/AuraProc.cpp index 089a8731b..e6d4f4e7a 100755 --- a/plugins/MacVST/Aura/source/AuraProc.cpp +++ b/plugins/MacVST/Aura/source/AuraProc.cpp @@ -27,8 +27,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -83,44 +83,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -208,14 +172,14 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,8 +211,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -303,44 +267,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -428,16 +356,14 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/AutoPan/source/AutoPanProc.cpp b/plugins/MacVST/AutoPan/source/AutoPanProc.cpp index 8301a2b25..632f9bfaa 100755 --- a/plugins/MacVST/AutoPan/source/AutoPanProc.cpp +++ b/plugins/MacVST/AutoPan/source/AutoPanProc.cpp @@ -25,12 +25,12 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -44,8 +44,8 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -95,12 +95,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -114,8 +114,8 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -129,12 +129,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/AverMatrix/source/AverMatrixProc.cpp b/plugins/MacVST/AverMatrix/source/AverMatrixProc.cpp index 381ea9c35..af0105057 100755 --- a/plugins/MacVST/AverMatrix/source/AverMatrixProc.cpp +++ b/plugins/MacVST/AverMatrix/source/AverMatrixProc.cpp @@ -48,15 +48,15 @@ void AverMatrix::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; @@ -140,15 +140,15 @@ void AverMatrix::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; diff --git a/plugins/MacVST/Average/source/Average.cpp b/plugins/MacVST/Average/source/Average.cpp index 2f39ca1db..64f301f56 100755 --- a/plugins/MacVST/Average/source/Average.cpp +++ b/plugins/MacVST/Average/source/Average.cpp @@ -17,8 +17,8 @@ Average::Average(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Average/source/Average.h b/plugins/MacVST/Average/source/Average.h index 9932e99d9..1cdc884ba 100755 --- a/plugins/MacVST/Average/source/Average.h +++ b/plugins/MacVST/Average/source/Average.h @@ -57,8 +57,8 @@ private: double f[11]; double bR[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Average/source/AverageProc.cpp b/plugins/MacVST/Average/source/AverageProc.cpp index 17f478362..fce6a3af4 100755 --- a/plugins/MacVST/Average/source/AverageProc.cpp +++ b/plugins/MacVST/Average/source/AverageProc.cpp @@ -57,44 +57,8 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -151,14 +115,14 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //in the floating point system. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -218,44 +182,8 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -311,16 +239,14 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/BassAmp/source/BassAmpProc.cpp b/plugins/MacVST/BassAmp/source/BassAmpProc.cpp index a84fcce3a..025fa038a 100755 --- a/plugins/MacVST/BassAmp/source/BassAmpProc.cpp +++ b/plugins/MacVST/BassAmp/source/BassAmpProc.cpp @@ -36,8 +36,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-37) LinputSample = fpd * 1.18e-37; if (fabs(RinputSample)<1.18e-37) RinputSample = fpd * 1.18e-37; @@ -408,8 +408,8 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-43) LinputSample = fpd * 1.18e-43; if (fabs(RinputSample)<1.18e-43) RinputSample = fpd * 1.18e-43; diff --git a/plugins/MacVST/BassDrive/source/BassDriveProc.cpp b/plugins/MacVST/BassDrive/source/BassDriveProc.cpp index 3e199ea59..68f67e7f7 100755 --- a/plugins/MacVST/BassDrive/source/BassDriveProc.cpp +++ b/plugins/MacVST/BassDrive/source/BassDriveProc.cpp @@ -25,8 +25,8 @@ void BassDrive::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -349,8 +349,8 @@ void BassDrive::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/BassKit/source/BassKit.cpp b/plugins/MacVST/BassKit/source/BassKit.cpp index 008f045da..0eec1c5eb 100755 --- a/plugins/MacVST/BassKit/source/BassKit.cpp +++ b/plugins/MacVST/BassKit/source/BassKit.cpp @@ -68,8 +68,8 @@ BassKit::BassKit(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/BassKit/source/BassKit.h b/plugins/MacVST/BassKit/source/BassKit.h index f421d3d4d..c192cfa11 100755 --- a/plugins/MacVST/BassKit/source/BassKit.h +++ b/plugins/MacVST/BassKit/source/BassKit.h @@ -105,8 +105,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/BassKit/source/BassKitProc.cpp b/plugins/MacVST/BassKit/source/BassKitProc.cpp index 9199c82d3..3044c5cec 100755 --- a/plugins/MacVST/BassKit/source/BassKitProc.cpp +++ b/plugins/MacVST/BassKit/source/BassKitProc.cpp @@ -33,8 +33,8 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -204,14 +204,14 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,8 +249,8 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -420,16 +420,14 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Baxandall/source/Baxandall.h b/plugins/MacVST/Baxandall/source/Baxandall.h index 380e3d09f..a30751cfc 100755 --- a/plugins/MacVST/Baxandall/source/Baxandall.h +++ b/plugins/MacVST/Baxandall/source/Baxandall.h @@ -56,15 +56,15 @@ private: uint32_t fpd; //default stuff - long double trebleAL[9]; - long double trebleBL[9]; - long double bassAL[9]; - long double bassBL[9]; + double trebleAL[9]; + double trebleBL[9]; + double bassAL[9]; + double bassBL[9]; - long double trebleAR[9]; - long double trebleBR[9]; - long double bassAR[9]; - long double bassBR[9]; + double trebleAR[9]; + double trebleBR[9]; + double bassAR[9]; + double bassBR[9]; bool flip; float A; diff --git a/plugins/MacVST/Baxandall/source/BaxandallProc.cpp b/plugins/MacVST/Baxandall/source/BaxandallProc.cpp index 9f75cced2..f52cba8ec 100755 --- a/plugins/MacVST/Baxandall/source/BaxandallProc.cpp +++ b/plugins/MacVST/Baxandall/source/BaxandallProc.cpp @@ -45,8 +45,8 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -59,10 +59,10 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { @@ -182,8 +182,8 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -196,10 +196,10 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { diff --git a/plugins/MacVST/Beam/source/BeamProc.cpp b/plugins/MacVST/Beam/source/BeamProc.cpp index 5871eb5c1..15eda5357 100755 --- a/plugins/MacVST/Beam/source/BeamProc.cpp +++ b/plugins/MacVST/Beam/source/BeamProc.cpp @@ -35,8 +35,8 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Biquad/source/Biquad.h b/plugins/MacVST/Biquad/source/Biquad.h index 17993cd4c..2476d2595 100755 --- a/plugins/MacVST/Biquad/source/Biquad.h +++ b/plugins/MacVST/Biquad/source/Biquad.h @@ -55,7 +55,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[11]; //note that this stereo form doesn't require L and R forms! + double biquad[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Biquad/source/BiquadProc.cpp b/plugins/MacVST/Biquad/source/BiquadProc.cpp index 0dfbfe46f..cff2485a6 100755 --- a/plugins/MacVST/Biquad/source/BiquadProc.cpp +++ b/plugins/MacVST/Biquad/source/BiquadProc.cpp @@ -88,12 +88,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -101,16 +101,16 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -120,12 +120,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -245,12 +245,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -258,16 +258,16 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -277,12 +277,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacVST/Biquad2/source/Biquad2.h b/plugins/MacVST/Biquad2/source/Biquad2.h index 20c1d1ceb..1c715f1a7 100755 --- a/plugins/MacVST/Biquad2/source/Biquad2.h +++ b/plugins/MacVST/Biquad2/source/Biquad2.h @@ -56,7 +56,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; //note that this stereo form doesn't require L and R forms! + double biquad[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Biquad2/source/Biquad2Proc.cpp b/plugins/MacVST/Biquad2/source/Biquad2Proc.cpp index 837a072b8..9e9d6bce8 100755 --- a/plugins/MacVST/Biquad2/source/Biquad2Proc.cpp +++ b/plugins/MacVST/Biquad2/source/Biquad2Proc.cpp @@ -79,12 +79,12 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -134,10 +134,10 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -291,12 +291,12 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -346,10 +346,10 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; diff --git a/plugins/MacVST/BiquadDouble/source/BiquadDouble.h b/plugins/MacVST/BiquadDouble/source/BiquadDouble.h index 525d753a0..486a9b642 100755 --- a/plugins/MacVST/BiquadDouble/source/BiquadDouble.h +++ b/plugins/MacVST/BiquadDouble/source/BiquadDouble.h @@ -56,8 +56,8 @@ private: std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/BiquadDouble/source/BiquadDoubleProc.cpp b/plugins/MacVST/BiquadDouble/source/BiquadDoubleProc.cpp index c5318a700..055743d43 100755 --- a/plugins/MacVST/BiquadDouble/source/BiquadDoubleProc.cpp +++ b/plugins/MacVST/BiquadDouble/source/BiquadDoubleProc.cpp @@ -89,24 +89,24 @@ void BiquadDouble::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -238,24 +238,24 @@ void BiquadDouble::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalf.h b/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalf.h index cd9dacc2e..e3024989d 100755 --- a/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalf.h +++ b/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalf.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadAL[9]; - long double biquadAR[9]; - long double biquadBL[9]; - long double biquadBR[9]; + double biquadAL[9]; + double biquadAR[9]; + double biquadBL[9]; + double biquadBR[9]; bool flip; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp b/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp index e126dcf7e..87d9763c1 100755 --- a/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp +++ b/plugins/MacVST/BiquadOneHalf/source/BiquadOneHalfProc.cpp @@ -87,19 +87,19 @@ void BiquadOneHalf::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { @@ -239,20 +239,20 @@ void BiquadOneHalf::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { diff --git a/plugins/MacVST/BiquadPlus/source/BiquadPlus.h b/plugins/MacVST/BiquadPlus/source/BiquadPlus.h index bec774331..0ef273e12 100755 --- a/plugins/MacVST/BiquadPlus/source/BiquadPlus.h +++ b/plugins/MacVST/BiquadPlus/source/BiquadPlus.h @@ -80,7 +80,7 @@ private: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/BiquadPlus/source/BiquadPlusProc.cpp b/plugins/MacVST/BiquadPlus/source/BiquadPlusProc.cpp index 34f5c68fb..b2ad19c4d 100755 --- a/plugins/MacVST/BiquadPlus/source/BiquadPlusProc.cpp +++ b/plugins/MacVST/BiquadPlus/source/BiquadPlusProc.cpp @@ -107,20 +107,20 @@ void BiquadPlus::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -239,20 +239,20 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -268,12 +268,12 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/BiquadTriple/source/BiquadTriple.h b/plugins/MacVST/BiquadTriple/source/BiquadTriple.h index acd55ebb6..b23660d14 100755 --- a/plugins/MacVST/BiquadTriple/source/BiquadTriple.h +++ b/plugins/MacVST/BiquadTriple/source/BiquadTriple.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/BiquadTriple/source/BiquadTripleProc.cpp b/plugins/MacVST/BiquadTriple/source/BiquadTripleProc.cpp index f6d97f74f..84ee1b7f5 100755 --- a/plugins/MacVST/BiquadTriple/source/BiquadTripleProc.cpp +++ b/plugins/MacVST/BiquadTriple/source/BiquadTripleProc.cpp @@ -90,24 +90,24 @@ void BiquadTriple::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -251,23 +251,23 @@ void BiquadTriple::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/MacVST/BitGlitter/source/BitGlitterProc.cpp b/plugins/MacVST/BitGlitter/source/BitGlitterProc.cpp index 288c269bf..38afa37d9 100755 --- a/plugins/MacVST/BitGlitter/source/BitGlitterProc.cpp +++ b/plugins/MacVST/BitGlitter/source/BitGlitterProc.cpp @@ -32,12 +32,12 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section @@ -68,7 +68,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -97,7 +97,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; @@ -252,12 +252,12 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section inputSampleL *= ingain; @@ -287,7 +287,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -316,7 +316,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; diff --git a/plugins/MacVST/Bite/source/Bite.cpp b/plugins/MacVST/Bite/source/Bite.cpp index c9d0fcbc2..1defea7df 100755 --- a/plugins/MacVST/Bite/source/Bite.cpp +++ b/plugins/MacVST/Bite/source/Bite.cpp @@ -34,8 +34,8 @@ Bite::Bite(audioMasterCallback audioMaster) : sampleHR = 0.0; sampleIR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Bite/source/Bite.h b/plugins/MacVST/Bite/source/Bite.h index 288ac7f80..895aab027 100755 --- a/plugins/MacVST/Bite/source/Bite.h +++ b/plugins/MacVST/Bite/source/Bite.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sampleAL; double sampleBL; diff --git a/plugins/MacVST/Bite/source/BiteProc.cpp b/plugins/MacVST/Bite/source/BiteProc.cpp index 64e0ac419..66747041e 100755 --- a/plugins/MacVST/Bite/source/BiteProc.cpp +++ b/plugins/MacVST/Bite/source/BiteProc.cpp @@ -50,44 +50,8 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -116,14 +80,14 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -178,44 +142,8 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -244,16 +172,14 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/BlockParty/source/BlockPartyProc.cpp b/plugins/MacVST/BlockParty/source/BlockPartyProc.cpp index 12c19d4a3..37c3a6545 100755 --- a/plugins/MacVST/BlockParty/source/BlockPartyProc.cpp +++ b/plugins/MacVST/BlockParty/source/BlockPartyProc.cpp @@ -29,8 +29,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); @@ -590,8 +590,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -629,8 +629,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/MacVST/BrassRider/source/BrassRiderProc.cpp b/plugins/MacVST/BrassRider/source/BrassRiderProc.cpp index 3acd7834c..449a965fc 100755 --- a/plugins/MacVST/BrassRider/source/BrassRiderProc.cpp +++ b/plugins/MacVST/BrassRider/source/BrassRiderProc.cpp @@ -21,8 +21,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -60,8 +60,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -70,7 +70,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -79,7 +79,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -102,7 +102,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); @@ -163,8 +163,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -202,8 +202,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -212,7 +212,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -221,7 +221,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -244,7 +244,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/MacVST/BrightAmbience/source/BrightAmbienceProc.cpp b/plugins/MacVST/BrightAmbience/source/BrightAmbienceProc.cpp index 63bfecbf8..dc4ecd233 100755 --- a/plugins/MacVST/BrightAmbience/source/BrightAmbienceProc.cpp +++ b/plugins/MacVST/BrightAmbience/source/BrightAmbienceProc.cpp @@ -23,8 +23,8 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -174,7 +174,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -315,7 +315,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; @@ -355,8 +355,8 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -506,7 +506,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -647,7 +647,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; diff --git a/plugins/MacVST/BrightAmbience2/source/BrightAmbience2.h b/plugins/MacVST/BrightAmbience2/source/BrightAmbience2.h index c49b14e20..860fe9551 100755 --- a/plugins/MacVST/BrightAmbience2/source/BrightAmbience2.h +++ b/plugins/MacVST/BrightAmbience2/source/BrightAmbience2.h @@ -64,9 +64,9 @@ private: int gcount; float pL[32768]; float pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; float A; float B; diff --git a/plugins/MacVST/BrightAmbience2/source/BrightAmbience2Proc.cpp b/plugins/MacVST/BrightAmbience2/source/BrightAmbience2Proc.cpp index 72b7adf6c..95daad017 100755 --- a/plugins/MacVST/BrightAmbience2/source/BrightAmbience2Proc.cpp +++ b/plugins/MacVST/BrightAmbience2/source/BrightAmbience2Proc.cpp @@ -22,14 +22,14 @@ void BrightAmbience2::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; @@ -90,14 +90,14 @@ void BrightAmbience2::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/MacVST/BrightAmbience3/source/BrightAmbience3.h b/plugins/MacVST/BrightAmbience3/source/BrightAmbience3.h index ab479927b..cd9a6abd0 100755 --- a/plugins/MacVST/BrightAmbience3/source/BrightAmbience3.h +++ b/plugins/MacVST/BrightAmbience3/source/BrightAmbience3.h @@ -62,10 +62,10 @@ private: int gcount; double pL[32768]; double pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/MacVST/BrightAmbience3/source/BrightAmbience3Proc.cpp b/plugins/MacVST/BrightAmbience3/source/BrightAmbience3Proc.cpp index 6c912ad33..dd6875d28 100755 --- a/plugins/MacVST/BrightAmbience3/source/BrightAmbience3Proc.cpp +++ b/plugins/MacVST/BrightAmbience3/source/BrightAmbience3Proc.cpp @@ -43,17 +43,17 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -67,7 +67,7 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -202,17 +202,17 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -226,7 +226,7 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -307,12 +307,12 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/BuildATPDF/source/BuildATPDFProc.cpp b/plugins/MacVST/BuildATPDF/source/BuildATPDFProc.cpp index dfea1258a..0b61354b3 100755 --- a/plugins/MacVST/BuildATPDF/source/BuildATPDFProc.cpp +++ b/plugins/MacVST/BuildATPDF/source/BuildATPDFProc.cpp @@ -32,44 +32,8 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -149,44 +113,8 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacVST/BussColors4/source/BussColors4.cpp b/plugins/MacVST/BussColors4/source/BussColors4.cpp index c7de380ea..731e1331f 100755 --- a/plugins/MacVST/BussColors4/source/BussColors4.cpp +++ b/plugins/MacVST/BussColors4/source/BussColors4.cpp @@ -44,8 +44,8 @@ BussColors4::BussColors4(audioMasterCallback audioMaster) : slowdynR = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/BussColors4/source/BussColors4.h b/plugins/MacVST/BussColors4/source/BussColors4.h index 6452555a5..694ce678b 100755 --- a/plugins/MacVST/BussColors4/source/BussColors4.h +++ b/plugins/MacVST/BussColors4/source/BussColors4.h @@ -68,8 +68,8 @@ private: double slowdynR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/BussColors4/source/BussColors4Proc.cpp b/plugins/MacVST/BussColors4/source/BussColors4Proc.cpp index b1b945144..983bcc510 100755 --- a/plugins/MacVST/BussColors4/source/BussColors4Proc.cpp +++ b/plugins/MacVST/BussColors4/source/BussColors4Proc.cpp @@ -32,8 +32,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -58,44 +58,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -792,14 +756,14 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -836,8 +800,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -862,44 +826,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1596,16 +1524,14 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ButterComp/source/ButterComp.cpp b/plugins/MacVST/ButterComp/source/ButterComp.cpp index b3123e2e2..deac8039a 100755 --- a/plugins/MacVST/ButterComp/source/ButterComp.cpp +++ b/plugins/MacVST/ButterComp/source/ButterComp.cpp @@ -26,8 +26,8 @@ ButterComp::ButterComp(audioMasterCallback audioMaster) : controlBnegR = 1.0; targetposR = 1.0; targetnegR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ButterComp/source/ButterComp.h b/plugins/MacVST/ButterComp/source/ButterComp.h index 5c9862b3e..12c693fe2 100755 --- a/plugins/MacVST/ButterComp/source/ButterComp.h +++ b/plugins/MacVST/ButterComp/source/ButterComp.h @@ -65,8 +65,8 @@ private: double controlBnegR; double targetposR; double targetnegR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ButterComp/source/ButterCompProc.cpp b/plugins/MacVST/ButterComp/source/ButterCompProc.cpp index d87030c41..06c02ad31 100755 --- a/plugins/MacVST/ButterComp/source/ButterCompProc.cpp +++ b/plugins/MacVST/ButterComp/source/ButterCompProc.cpp @@ -24,8 +24,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -34,8 +34,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -54,44 +54,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -178,14 +142,14 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -214,8 +178,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -224,8 +188,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -244,44 +208,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -368,16 +296,14 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ButterComp2/source/ButterComp2.cpp b/plugins/MacVST/ButterComp2/source/ButterComp2.cpp index 0484416d5..b7bf3f1c0 100755 --- a/plugins/MacVST/ButterComp2/source/ButterComp2.cpp +++ b/plugins/MacVST/ButterComp2/source/ButterComp2.cpp @@ -32,8 +32,8 @@ ButterComp2::ButterComp2(audioMasterCallback audioMaster) : A = 0.0; B = 0.5; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ButterComp2/source/ButterComp2.h b/plugins/MacVST/ButterComp2/source/ButterComp2.h index 188adb5c3..d1f8721c1 100755 --- a/plugins/MacVST/ButterComp2/source/ButterComp2.h +++ b/plugins/MacVST/ButterComp2/source/ButterComp2.h @@ -54,23 +54,23 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double controlAposL; - long double controlAnegL; - long double controlBposL; - long double controlBnegL; - long double targetposL; - long double targetnegL; - long double lastOutputL; - long double controlAposR; - long double controlAnegR; - long double controlBposR; - long double controlBnegR; - long double targetposR; - long double targetnegR; - long double lastOutputR; + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double lastOutputL; + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double lastOutputR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ButterComp2/source/ButterComp2Proc.cpp b/plugins/MacVST/ButterComp2/source/ButterComp2Proc.cpp index 67a63675c..f5520a44a 100755 --- a/plugins/MacVST/ButterComp2/source/ButterComp2Proc.cpp +++ b/plugins/MacVST/ButterComp2/source/ButterComp2Proc.cpp @@ -30,8 +30,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,30 +75,30 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -138,23 +138,23 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -187,8 +187,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -223,14 +223,14 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -265,8 +265,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -310,30 +310,30 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -373,23 +373,23 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -422,8 +422,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -458,16 +458,14 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/C5RawBuss/source/C5RawBuss.cpp b/plugins/MacVST/C5RawBuss/source/C5RawBuss.cpp index 8fba0ef0f..1515cfdec 100755 --- a/plugins/MacVST/C5RawBuss/source/C5RawBuss.cpp +++ b/plugins/MacVST/C5RawBuss/source/C5RawBuss.cpp @@ -17,8 +17,8 @@ C5RawBuss::C5RawBuss(audioMasterCallback audioMaster) : lastSampleBussL = 0.0; lastFXBussR = 0.0; lastSampleBussR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/C5RawBuss/source/C5RawBuss.h b/plugins/MacVST/C5RawBuss/source/C5RawBuss.h index f4d01fe1e..dfc108b22 100755 --- a/plugins/MacVST/C5RawBuss/source/C5RawBuss.h +++ b/plugins/MacVST/C5RawBuss/source/C5RawBuss.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXBussL; double lastSampleBussL; diff --git a/plugins/MacVST/C5RawBuss/source/C5RawBussProc.cpp b/plugins/MacVST/C5RawBuss/source/C5RawBussProc.cpp index fab4612e2..cc884ee73 100755 --- a/plugins/MacVST/C5RawBuss/source/C5RawBussProc.cpp +++ b/plugins/MacVST/C5RawBuss/source/C5RawBussProc.cpp @@ -15,7 +15,7 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -108,14 +72,14 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl //build new signal off what was present in output last time //slew aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -135,7 +99,7 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -144,51 +108,15 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -228,16 +156,14 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt //build new signal off what was present in output last time //slew aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/C5RawChannel/source/C5RawChannel.cpp b/plugins/MacVST/C5RawChannel/source/C5RawChannel.cpp index ffc2ecfe7..a25bbd81d 100755 --- a/plugins/MacVST/C5RawChannel/source/C5RawChannel.cpp +++ b/plugins/MacVST/C5RawChannel/source/C5RawChannel.cpp @@ -17,8 +17,8 @@ C5RawChannel::C5RawChannel(audioMasterCallback audioMaster) : lastSampleChannelL = 0.0; lastFXChannelR = 0.0; lastSampleChannelR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/C5RawChannel/source/C5RawChannel.h b/plugins/MacVST/C5RawChannel/source/C5RawChannel.h index 3ce3e845b..8ed6e152e 100755 --- a/plugins/MacVST/C5RawChannel/source/C5RawChannel.h +++ b/plugins/MacVST/C5RawChannel/source/C5RawChannel.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXChannelL; double lastSampleChannelL; diff --git a/plugins/MacVST/C5RawChannel/source/C5RawChannelProc.cpp b/plugins/MacVST/C5RawChannel/source/C5RawChannelProc.cpp index b2679ffb6..d8e91ece8 100755 --- a/plugins/MacVST/C5RawChannel/source/C5RawChannelProc.cpp +++ b/plugins/MacVST/C5RawChannel/source/C5RawChannelProc.cpp @@ -15,7 +15,7 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -107,14 +71,14 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -134,7 +98,7 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -143,51 +107,15 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -226,16 +154,14 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/CStrip/source/CStrip.cpp b/plugins/MacVST/CStrip/source/CStrip.cpp index 2049ab870..88b4e1748 100755 --- a/plugins/MacVST/CStrip/source/CStrip.cpp +++ b/plugins/MacVST/CStrip/source/CStrip.cpp @@ -153,8 +153,8 @@ CStrip::CStrip(audioMasterCallback audioMaster) : nvgRA = nvgRB = 0.0; //end ButterComp - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/CStrip/source/CStrip.h b/plugins/MacVST/CStrip/source/CStrip.h index cc9f722af..3e4f6219e 100755 --- a/plugins/MacVST/CStrip/source/CStrip.h +++ b/plugins/MacVST/CStrip/source/CStrip.h @@ -63,8 +63,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/CStrip/source/CStripProc.cpp b/plugins/MacVST/CStrip/source/CStripProc.cpp index 60ce59c56..0a758963e 100755 --- a/plugins/MacVST/CStrip/source/CStripProc.cpp +++ b/plugins/MacVST/CStrip/source/CStripProc.cpp @@ -20,10 +20,10 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -111,44 +111,8 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -726,14 +690,14 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -758,10 +722,10 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -849,44 +813,8 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -1464,16 +1392,14 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Calibre/source/CalibreProc.cpp b/plugins/MacVST/Calibre/source/CalibreProc.cpp index a7d6cd0db..14350eff2 100755 --- a/plugins/MacVST/Calibre/source/CalibreProc.cpp +++ b/plugins/MacVST/Calibre/source/CalibreProc.cpp @@ -37,8 +37,8 @@ void Calibre::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Calibre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Capacitor/source/Capacitor.cpp b/plugins/MacVST/Capacitor/source/Capacitor.cpp index 0ade9c9db..525bf3763 100755 --- a/plugins/MacVST/Capacitor/source/Capacitor.cpp +++ b/plugins/MacVST/Capacitor/source/Capacitor.cpp @@ -51,8 +51,8 @@ Capacitor::Capacitor(audioMasterCallback audioMaster) : lastHighpass = 1000.0; lastWet = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Capacitor/source/Capacitor.h b/plugins/MacVST/Capacitor/source/Capacitor.h index 0799d39d2..7407eb5d1 100755 --- a/plugins/MacVST/Capacitor/source/Capacitor.h +++ b/plugins/MacVST/Capacitor/source/Capacitor.h @@ -94,8 +94,8 @@ private: double lastHighpass; double lastWet; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Capacitor/source/CapacitorProc.cpp b/plugins/MacVST/Capacitor/source/CapacitorProc.cpp index 6b3582b09..f851b2c9e 100755 --- a/plugins/MacVST/Capacitor/source/CapacitorProc.cpp +++ b/plugins/MacVST/Capacitor/source/CapacitorProc.cpp @@ -31,8 +31,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; float drySampleL; float drySampleR; @@ -40,44 +40,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -179,14 +143,14 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -222,8 +186,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -232,44 +196,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -370,16 +298,14 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Capacitor2/source/Capacitor2Proc.cpp b/plugins/MacVST/Capacitor2/source/Capacitor2Proc.cpp index 7799c21a8..899aaaa4a 100755 --- a/plugins/MacVST/Capacitor2/source/Capacitor2Proc.cpp +++ b/plugins/MacVST/Capacitor2/source/Capacitor2Proc.cpp @@ -30,12 +30,12 @@ void Capacitor2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); @@ -193,12 +193,12 @@ void Capacitor2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); diff --git a/plugins/MacVST/Chamber/source/ChamberProc.cpp b/plugins/MacVST/Chamber/source/ChamberProc.cpp index 1dbe7bae0..c536ef030 100755 --- a/plugins/MacVST/Chamber/source/ChamberProc.cpp +++ b/plugins/MacVST/Chamber/source/ChamberProc.cpp @@ -58,12 +58,12 @@ void Chamber::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -314,12 +314,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -501,12 +501,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Channel4/source/Channel4.h b/plugins/MacVST/Channel4/source/Channel4.h index 0338d0a77..e8ca7a260 100755 --- a/plugins/MacVST/Channel4/source/Channel4.h +++ b/plugins/MacVST/Channel4/source/Channel4.h @@ -53,10 +53,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/MacVST/Channel4/source/Channel4Proc.cpp b/plugins/MacVST/Channel4/source/Channel4Proc.cpp index 380e52c9e..a57623d4f 100755 --- a/plugins/MacVST/Channel4/source/Channel4Proc.cpp +++ b/plugins/MacVST/Channel4/source/Channel4Proc.cpp @@ -25,53 +25,17 @@ void Channel4::processReplacing(float **inputs, float **outputs, VstInt32 sample const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -165,53 +129,17 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/MacVST/Channel5/source/Channel5.cpp b/plugins/MacVST/Channel5/source/Channel5.cpp index 26b592a7d..21581df74 100755 --- a/plugins/MacVST/Channel5/source/Channel5.cpp +++ b/plugins/MacVST/Channel5/source/Channel5.cpp @@ -15,8 +15,8 @@ Channel5::Channel5(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/MacVST/Channel5/source/Channel5.h b/plugins/MacVST/Channel5/source/Channel5.h index 07516f7a7..510f34f6a 100755 --- a/plugins/MacVST/Channel5/source/Channel5.h +++ b/plugins/MacVST/Channel5/source/Channel5.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/MacVST/Channel5/source/Channel5Proc.cpp b/plugins/MacVST/Channel5/source/Channel5Proc.cpp index 174ee28c5..b029d9303 100755 --- a/plugins/MacVST/Channel5/source/Channel5Proc.cpp +++ b/plugins/MacVST/Channel5/source/Channel5Proc.cpp @@ -23,8 +23,8 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -79,7 +79,7 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); @@ -158,8 +158,8 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -214,7 +214,7 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); diff --git a/plugins/MacVST/Channel6/source/Channel6Proc.cpp b/plugins/MacVST/Channel6/source/Channel6Proc.cpp index b0ad39368..777666f14 100755 --- a/plugins/MacVST/Channel6/source/Channel6Proc.cpp +++ b/plugins/MacVST/Channel6/source/Channel6Proc.cpp @@ -23,8 +23,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -45,8 +45,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -54,7 +54,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -63,7 +63,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section @@ -123,8 +123,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -145,8 +145,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -154,7 +154,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -163,7 +163,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section diff --git a/plugins/MacVST/Channel7/source/Channel7Proc.cpp b/plugins/MacVST/Channel7/source/Channel7Proc.cpp index b19f42671..e9e9a6852 100755 --- a/plugins/MacVST/Channel7/source/Channel7Proc.cpp +++ b/plugins/MacVST/Channel7/source/Channel7Proc.cpp @@ -26,8 +26,8 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -46,16 +46,16 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -63,11 +63,11 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -132,8 +132,8 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -152,16 +152,16 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -169,11 +169,11 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/MacVST/Channel8/source/Channel8Proc.cpp b/plugins/MacVST/Channel8/source/Channel8Proc.cpp index 8442ad2d8..afb1a48fe 100755 --- a/plugins/MacVST/Channel8/source/Channel8Proc.cpp +++ b/plugins/MacVST/Channel8/source/Channel8Proc.cpp @@ -27,8 +27,8 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -50,16 +50,16 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -67,11 +67,11 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -157,8 +157,8 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -180,16 +180,16 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -197,11 +197,11 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/MacVST/Channel9/source/Channel9.h b/plugins/MacVST/Channel9/source/Channel9.h index 5772f32ff..1232f66f6 100755 --- a/plugins/MacVST/Channel9/source/Channel9.h +++ b/plugins/MacVST/Channel9/source/Channel9.h @@ -68,8 +68,8 @@ private: double lastSampleAR; double lastSampleBR; double lastSampleCR; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; double iirAmount; double threshold; double cutoff; diff --git a/plugins/MacVST/Channel9/source/Channel9Proc.cpp b/plugins/MacVST/Channel9/source/Channel9Proc.cpp index 7c37fea56..5ca21ec9c 100755 --- a/plugins/MacVST/Channel9/source/Channel9Proc.cpp +++ b/plugins/MacVST/Channel9/source/Channel9Proc.cpp @@ -46,11 +46,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -83,16 +83,16 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -100,11 +100,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -218,11 +218,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -255,16 +255,16 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -272,11 +272,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -333,12 +333,12 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Chorus/source/Chorus.cpp b/plugins/MacVST/Chorus/source/Chorus.cpp index 1f3965afd..d2a630dff 100755 --- a/plugins/MacVST/Chorus/source/Chorus.cpp +++ b/plugins/MacVST/Chorus/source/Chorus.cpp @@ -28,8 +28,8 @@ Chorus::Chorus(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Chorus/source/Chorus.h b/plugins/MacVST/Chorus/source/Chorus.h index 5508ac3a3..933415bca 100755 --- a/plugins/MacVST/Chorus/source/Chorus.h +++ b/plugins/MacVST/Chorus/source/Chorus.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 16386; float dL[totalsamples]; diff --git a/plugins/MacVST/Chorus/source/ChorusProc.cpp b/plugins/MacVST/Chorus/source/ChorusProc.cpp index 368ade75c..8f02bebbc 100755 --- a/plugins/MacVST/Chorus/source/ChorusProc.cpp +++ b/plugins/MacVST/Chorus/source/ChorusProc.cpp @@ -31,8 +31,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -40,44 +40,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -176,8 +140,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -185,44 +149,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither fpFlip = !fpFlip; *out1 = inputSampleL; diff --git a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.cpp b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.cpp index 318b6782b..a9f898ec9 100755 --- a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.cpp +++ b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.cpp @@ -28,8 +28,8 @@ ChorusEnsemble::ChorusEnsemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.h b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.h index e7df33253..8b796e8eb 100755 --- a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.h +++ b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsemble.h @@ -68,8 +68,8 @@ private: double airOddR; double airFactorR; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp index 166324483..8ee1eea32 100755 --- a/plugins/MacVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp +++ b/plugins/MacVST/ChorusEnsemble/source/ChorusEnsembleProc.cpp @@ -30,8 +30,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -44,44 +44,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -174,14 +138,14 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -216,8 +180,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -230,44 +194,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -360,16 +288,14 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ChromeOxide/source/ChromeOxideProc.cpp b/plugins/MacVST/ChromeOxide/source/ChromeOxideProc.cpp index 6c2d99f53..be036a80e 100755 --- a/plugins/MacVST/ChromeOxide/source/ChromeOxideProc.cpp +++ b/plugins/MacVST/ChromeOxide/source/ChromeOxideProc.cpp @@ -46,8 +46,8 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -207,8 +207,8 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Cider/source/CiderProc.cpp b/plugins/MacVST/Cider/source/CiderProc.cpp index e5631e4b7..9222a2ea7 100755 --- a/plugins/MacVST/Cider/source/CiderProc.cpp +++ b/plugins/MacVST/Cider/source/CiderProc.cpp @@ -37,8 +37,8 @@ void Cider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Cider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/ClipOnly2/source/ClipOnly2.h b/plugins/MacVST/ClipOnly2/source/ClipOnly2.h index 451dba2fb..efe560d03 100755 --- a/plugins/MacVST/ClipOnly2/source/ClipOnly2.h +++ b/plugins/MacVST/ClipOnly2/source/ClipOnly2.h @@ -51,12 +51,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacVST/Coils/source/Coils.h b/plugins/MacVST/Coils/source/Coils.h index 08171fbee..8a4469ee2 100755 --- a/plugins/MacVST/Coils/source/Coils.h +++ b/plugins/MacVST/Coils/source/Coils.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/Coils/source/CoilsProc.cpp b/plugins/MacVST/Coils/source/CoilsProc.cpp index 409fd66d7..d963e9053 100755 --- a/plugins/MacVST/Coils/source/CoilsProc.cpp +++ b/plugins/MacVST/Coils/source/CoilsProc.cpp @@ -32,14 +32,14 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -51,7 +51,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); @@ -116,14 +116,14 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -135,7 +135,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/MacVST/Coils2/source/Coils2.h b/plugins/MacVST/Coils2/source/Coils2.h index 92cf19efc..0e3f61a3c 100755 --- a/plugins/MacVST/Coils2/source/Coils2.h +++ b/plugins/MacVST/Coils2/source/Coils2.h @@ -54,10 +54,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double hysteresisL; - long double hysteresisR; + double biquadA[15]; + double biquadB[15]; + double hysteresisL; + double hysteresisR; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/Coils2/source/Coils2Proc.cpp b/plugins/MacVST/Coils2/source/Coils2Proc.cpp index 2ae3bf41d..d4466f4bc 100755 --- a/plugins/MacVST/Coils2/source/Coils2Proc.cpp +++ b/plugins/MacVST/Coils2/source/Coils2Proc.cpp @@ -22,7 +22,7 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -42,15 +42,15 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -59,10 +59,10 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -121,7 +121,7 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -141,15 +141,15 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -158,10 +158,10 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -187,12 +187,12 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Cojones/source/Cojones.cpp b/plugins/MacVST/Cojones/source/Cojones.cpp index f1a8359e6..bd6001fa7 100755 --- a/plugins/MacVST/Cojones/source/Cojones.cpp +++ b/plugins/MacVST/Cojones/source/Cojones.cpp @@ -24,8 +24,8 @@ Cojones::Cojones(audioMasterCallback audioMaster) : storedR[0] = storedR[1] = 0.0; diffR[0] = diffR[1] = diffR[2] = diffR[3] = diffR[4] = diffR[5] = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Cojones/source/Cojones.h b/plugins/MacVST/Cojones/source/Cojones.h index 10650f832..519304f48 100755 --- a/plugins/MacVST/Cojones/source/Cojones.h +++ b/plugins/MacVST/Cojones/source/Cojones.h @@ -56,15 +56,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double storedL[2]; - long double diffL[6]; + double storedL[2]; + double diffL[6]; - long double storedR[2]; - long double diffR[6]; + double storedR[2]; + double diffR[6]; float A; float B; diff --git a/plugins/MacVST/Cojones/source/CojonesProc.cpp b/plugins/MacVST/Cojones/source/CojonesProc.cpp index f1af80356..24606e3af 100755 --- a/plugins/MacVST/Cojones/source/CojonesProc.cpp +++ b/plugins/MacVST/Cojones/source/CojonesProc.cpp @@ -24,8 +24,8 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,17 +88,17 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -158,14 +158,14 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -194,8 +194,8 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,17 +258,17 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -328,16 +328,14 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Compresaturator/source/CompresaturatorProc.cpp b/plugins/MacVST/Compresaturator/source/CompresaturatorProc.cpp index f39d52e6a..921f25b11 100755 --- a/plugins/MacVST/Compresaturator/source/CompresaturatorProc.cpp +++ b/plugins/MacVST/Compresaturator/source/CompresaturatorProc.cpp @@ -25,8 +25,8 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -64,13 +64,13 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin drive L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -82,7 +82,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with @@ -240,8 +240,8 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -279,13 +279,13 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -297,7 +297,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/MacVST/Console4Buss/source/Console4Buss.cpp b/plugins/MacVST/Console4Buss/source/Console4Buss.cpp index 0c8e00c34..4db7b1432 100755 --- a/plugins/MacVST/Console4Buss/source/Console4Buss.cpp +++ b/plugins/MacVST/Console4Buss/source/Console4Buss.cpp @@ -22,8 +22,8 @@ Console4Buss::Console4Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/MacVST/Console4Buss/source/Console4BussProc.cpp b/plugins/MacVST/Console4Buss/source/Console4BussProc.cpp index dde872ab2..2b863eaf1 100755 --- a/plugins/MacVST/Console4Buss/source/Console4BussProc.cpp +++ b/plugins/MacVST/Console4Buss/source/Console4BussProc.cpp @@ -18,11 +18,11 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -36,44 +36,8 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -149,11 +113,11 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -166,44 +130,8 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -249,16 +177,14 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Console4Channel/source/Console4Channel.cpp b/plugins/MacVST/Console4Channel/source/Console4Channel.cpp index 2e524a1e5..6e8f95441 100755 --- a/plugins/MacVST/Console4Channel/source/Console4Channel.cpp +++ b/plugins/MacVST/Console4Channel/source/Console4Channel.cpp @@ -20,8 +20,8 @@ Console4Channel::Console4Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/MacVST/Console4Channel/source/Console4ChannelProc.cpp b/plugins/MacVST/Console4Channel/source/Console4ChannelProc.cpp index 3538710ed..eed5c8d67 100755 --- a/plugins/MacVST/Console4Channel/source/Console4ChannelProc.cpp +++ b/plugins/MacVST/Console4Channel/source/Console4ChannelProc.cpp @@ -18,10 +18,10 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; // replace inputgain with gain, serves same purpose. Stereo inputsample. if (settingchase != gain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -101,14 +65,14 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,10 +95,10 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; if (settingchase != gain) { chasespeed *= 2.0; @@ -148,44 +112,8 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -214,16 +142,14 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Console5Buss/source/Console5Buss.cpp b/plugins/MacVST/Console5Buss/source/Console5Buss.cpp index 7e937a84b..69a467ab8 100755 --- a/plugins/MacVST/Console5Buss/source/Console5Buss.cpp +++ b/plugins/MacVST/Console5Buss/source/Console5Buss.cpp @@ -22,8 +22,8 @@ Console5Buss::Console5Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Console5Buss/source/Console5Buss.h b/plugins/MacVST/Console5Buss/source/Console5Buss.h index 0166f3370..81f9d0eac 100755 --- a/plugins/MacVST/Console5Buss/source/Console5Buss.h +++ b/plugins/MacVST/Console5Buss/source/Console5Buss.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Console5Buss/source/Console5BussProc.cpp b/plugins/MacVST/Console5Buss/source/Console5BussProc.cpp index 21069e81e..a61c2e7cb 100755 --- a/plugins/MacVST/Console5Buss/source/Console5BussProc.cpp +++ b/plugins/MacVST/Console5Buss/source/Console5BussProc.cpp @@ -25,8 +25,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -148,14 +112,14 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -185,8 +149,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -199,44 +163,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -308,16 +236,14 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Console5Channel/source/Console5Channel.cpp b/plugins/MacVST/Console5Channel/source/Console5Channel.cpp index 1a8f6fb00..b38d63844 100755 --- a/plugins/MacVST/Console5Channel/source/Console5Channel.cpp +++ b/plugins/MacVST/Console5Channel/source/Console5Channel.cpp @@ -22,8 +22,8 @@ Console5Channel::Console5Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Console5Channel/source/Console5Channel.h b/plugins/MacVST/Console5Channel/source/Console5Channel.h index bbc58b357..17e48be47 100755 --- a/plugins/MacVST/Console5Channel/source/Console5Channel.h +++ b/plugins/MacVST/Console5Channel/source/Console5Channel.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Console5Channel/source/Console5ChannelProc.cpp b/plugins/MacVST/Console5Channel/source/Console5ChannelProc.cpp index a01017008..bab2c5971 100755 --- a/plugins/MacVST/Console5Channel/source/Console5ChannelProc.cpp +++ b/plugins/MacVST/Console5Channel/source/Console5ChannelProc.cpp @@ -25,8 +25,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp index 350a6b379..25995665f 100755 --- a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp +++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.cpp @@ -22,8 +22,8 @@ Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h index 3265f5ca6..f3a777fbb 100755 --- a/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h +++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkCh.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp b/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp index ba3a84275..60469e11e 100755 --- a/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp +++ b/plugins/MacVST/Console5DarkCh/source/Console5DarkChProc.cpp @@ -25,8 +25,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Console6Buss/source/Console6BussProc.cpp b/plugins/MacVST/Console6Buss/source/Console6BussProc.cpp index ea597bf6a..03f8fb9a6 100755 --- a/plugins/MacVST/Console6Buss/source/Console6BussProc.cpp +++ b/plugins/MacVST/Console6Buss/source/Console6BussProc.cpp @@ -18,8 +18,8 @@ void Console6Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Console6Channel/source/Console6ChannelProc.cpp b/plugins/MacVST/Console6Channel/source/Console6ChannelProc.cpp index 65d2e793c..2d835fc8c 100755 --- a/plugins/MacVST/Console6Channel/source/Console6ChannelProc.cpp +++ b/plugins/MacVST/Console6Channel/source/Console6ChannelProc.cpp @@ -18,8 +18,8 @@ void Console6Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Console7Buss/source/Console7Buss.h b/plugins/MacVST/Console7Buss/source/Console7Buss.h index 7fa80b088..0be4fcf81 100755 --- a/plugins/MacVST/Console7Buss/source/Console7Buss.h +++ b/plugins/MacVST/Console7Buss/source/Console7Buss.h @@ -55,8 +55,8 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Console7Buss/source/Console7BussProc.cpp b/plugins/MacVST/Console7Buss/source/Console7BussProc.cpp index 0ef605a6e..6008a31b0 100755 --- a/plugins/MacVST/Console7Buss/source/Console7BussProc.cpp +++ b/plugins/MacVST/Console7Buss/source/Console7BussProc.cpp @@ -14,7 +14,7 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -42,15 +42,15 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -104,7 +104,7 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -132,15 +132,15 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -169,12 +169,12 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Console7Cascade/source/Console7Cascade.h b/plugins/MacVST/Console7Cascade/source/Console7Cascade.h index 13ef6e55e..05254a102 100755 --- a/plugins/MacVST/Console7Cascade/source/Console7Cascade.h +++ b/plugins/MacVST/Console7Cascade/source/Console7Cascade.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Console7Cascade/source/Console7CascadeProc.cpp b/plugins/MacVST/Console7Cascade/source/Console7CascadeProc.cpp index d210ca9a8..f004da812 100755 --- a/plugins/MacVST/Console7Cascade/source/Console7CascadeProc.cpp +++ b/plugins/MacVST/Console7Cascade/source/Console7CascadeProc.cpp @@ -14,7 +14,7 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Console7Channel/source/Console7Channel.h b/plugins/MacVST/Console7Channel/source/Console7Channel.h index 7833df454..7c8703c47 100755 --- a/plugins/MacVST/Console7Channel/source/Console7Channel.h +++ b/plugins/MacVST/Console7Channel/source/Console7Channel.h @@ -55,7 +55,7 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Console7Channel/source/Console7ChannelProc.cpp b/plugins/MacVST/Console7Channel/source/Console7ChannelProc.cpp index 18976ea5e..b683073da 100755 --- a/plugins/MacVST/Console7Channel/source/Console7ChannelProc.cpp +++ b/plugins/MacVST/Console7Channel/source/Console7ChannelProc.cpp @@ -14,7 +14,7 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -36,15 +36,15 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -94,7 +94,7 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -116,15 +116,15 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -149,12 +149,12 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Console7Crunch/source/Console7Crunch.h b/plugins/MacVST/Console7Crunch/source/Console7Crunch.h index fad7640a6..cb1c47ff2 100755 --- a/plugins/MacVST/Console7Crunch/source/Console7Crunch.h +++ b/plugins/MacVST/Console7Crunch/source/Console7Crunch.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Console7Crunch/source/Console7CrunchProc.cpp b/plugins/MacVST/Console7Crunch/source/Console7CrunchProc.cpp index f4c07fc9d..7dac81098 100755 --- a/plugins/MacVST/Console7Crunch/source/Console7CrunchProc.cpp +++ b/plugins/MacVST/Console7Crunch/source/Console7CrunchProc.cpp @@ -14,7 +14,7 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp index 6653b9192..d634bfc08 100755 --- a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp +++ b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.cpp @@ -36,8 +36,8 @@ CrunchyGrooveWear::CrunchyGrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h index 3489e5bd3..3ccd654a6 100755 --- a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h +++ b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp index 3c9762ef2..632ee3f59 100755 --- a/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp +++ b/plugins/MacVST/CrunchyGrooveWear/source/CrunchyGrooveWearProc.cpp @@ -99,51 +99,15 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -431,14 +395,14 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -542,51 +506,15 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -874,16 +802,14 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Crystal/source/Crystal.cpp b/plugins/MacVST/Crystal/source/Crystal.cpp index 705fe2a99..67db8482c 100755 --- a/plugins/MacVST/Crystal/source/Crystal.cpp +++ b/plugins/MacVST/Crystal/source/Crystal.cpp @@ -19,8 +19,8 @@ Crystal::Crystal(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bL[count] = 0; bR[count] = 0;} lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Crystal/source/Crystal.h b/plugins/MacVST/Crystal/source/Crystal.h index 45ebb6ad0..524bbc595 100755 --- a/plugins/MacVST/Crystal/source/Crystal.h +++ b/plugins/MacVST/Crystal/source/Crystal.h @@ -60,8 +60,8 @@ private: double bR[35]; double lastSampleR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Crystal/source/CrystalProc.cpp b/plugins/MacVST/Crystal/source/CrystalProc.cpp index 7e696a70f..f5d6746b1 100755 --- a/plugins/MacVST/Crystal/source/CrystalProc.cpp +++ b/plugins/MacVST/Crystal/source/CrystalProc.cpp @@ -37,8 +37,8 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -191,14 +191,14 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -240,8 +240,8 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -394,16 +394,14 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Dark/source/DarkProc.cpp b/plugins/MacVST/Dark/source/DarkProc.cpp index 955a53f85..811fdf384 100755 --- a/plugins/MacVST/Dark/source/DarkProc.cpp +++ b/plugins/MacVST/Dark/source/DarkProc.cpp @@ -34,8 +34,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -149,8 +149,8 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/DarkNoise/source/DarkNoiseProc.cpp b/plugins/MacVST/DarkNoise/source/DarkNoiseProc.cpp index be7b9d0b5..cb4f3428f 100755 --- a/plugins/MacVST/DarkNoise/source/DarkNoiseProc.cpp +++ b/plugins/MacVST/DarkNoise/source/DarkNoiseProc.cpp @@ -51,12 +51,12 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -92,8 +92,8 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -184,12 +184,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -225,8 +225,8 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -255,12 +255,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/DeBess/source/DeBess.h b/plugins/MacVST/DeBess/source/DeBess.h index b60d94f0a..26e8bb620 100755 --- a/plugins/MacVST/DeBess/source/DeBess.h +++ b/plugins/MacVST/DeBess/source/DeBess.h @@ -56,13 +56,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double sL[41], mL[41], cL[41]; + double sL[41], mL[41], cL[41]; double ratioAL; double ratioBL; double iirSampleAL; double iirSampleBL; - long double sR[41], mR[41], cR[41]; + double sR[41], mR[41], cR[41]; double ratioAR; double ratioBR; double iirSampleAR; diff --git a/plugins/MacVST/DeBess/source/DeBessProc.cpp b/plugins/MacVST/DeBess/source/DeBessProc.cpp index 05d4b5668..075c9de3e 100755 --- a/plugins/MacVST/DeBess/source/DeBessProc.cpp +++ b/plugins/MacVST/DeBess/source/DeBessProc.cpp @@ -28,8 +28,8 @@ void DeBess::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -130,8 +130,8 @@ void DeBess::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/DeEss/source/DeEss.cpp b/plugins/MacVST/DeEss/source/DeEss.cpp index 64a9503df..f57f5c63c 100755 --- a/plugins/MacVST/DeEss/source/DeEss.cpp +++ b/plugins/MacVST/DeEss/source/DeEss.cpp @@ -32,8 +32,8 @@ DeEss::DeEss(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/DeEss/source/DeEss.h b/plugins/MacVST/DeEss/source/DeEss.h index dcab1e6c3..93afbe7b9 100755 --- a/plugins/MacVST/DeEss/source/DeEss.h +++ b/plugins/MacVST/DeEss/source/DeEss.h @@ -103,8 +103,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/DeEss/source/DeEssProc.cpp b/plugins/MacVST/DeEss/source/DeEssProc.cpp index 9b030a4c6..3f9adf647 100755 --- a/plugins/MacVST/DeEss/source/DeEssProc.cpp +++ b/plugins/MacVST/DeEss/source/DeEssProc.cpp @@ -28,8 +28,8 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -148,14 +148,14 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,8 +188,8 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -308,16 +308,14 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DeHiss/source/DeHissProc.cpp b/plugins/MacVST/DeHiss/source/DeHissProc.cpp index 405566e8a..41074f9c5 100755 --- a/plugins/MacVST/DeHiss/source/DeHissProc.cpp +++ b/plugins/MacVST/DeHiss/source/DeHissProc.cpp @@ -35,12 +35,12 @@ void DeHiss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; @@ -166,12 +166,12 @@ void DeHiss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; diff --git a/plugins/MacVST/DeRez/source/DeRez.cpp b/plugins/MacVST/DeRez/source/DeRez.cpp index cb9b514a8..f24f99df9 100755 --- a/plugins/MacVST/DeRez/source/DeRez.cpp +++ b/plugins/MacVST/DeRez/source/DeRez.cpp @@ -23,8 +23,8 @@ DeRez::DeRez(audioMasterCallback audioMaster) : incrementA = 0.0; incrementB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/DeRez/source/DeRez.h b/plugins/MacVST/DeRez/source/DeRez.h index 8ebdcd9d6..85cfe1c66 100755 --- a/plugins/MacVST/DeRez/source/DeRez.h +++ b/plugins/MacVST/DeRez/source/DeRez.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/DeRez/source/DeRezProc.cpp b/plugins/MacVST/DeRez/source/DeRezProc.cpp index cbe42d57d..36cb20004 100755 --- a/plugins/MacVST/DeRez/source/DeRezProc.cpp +++ b/plugins/MacVST/DeRez/source/DeRezProc.cpp @@ -26,48 +26,12 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -75,8 +39,8 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -90,7 +54,7 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -130,14 +94,14 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,48 +132,12 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -217,8 +145,8 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -232,7 +160,7 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -272,16 +200,14 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DeRez2/source/DeRez2Proc.cpp b/plugins/MacVST/DeRez2/source/DeRez2Proc.cpp index 889fd79b4..d43944d9e 100755 --- a/plugins/MacVST/DeRez2/source/DeRez2Proc.cpp +++ b/plugins/MacVST/DeRez2/source/DeRez2Proc.cpp @@ -28,12 +28,12 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -42,8 +42,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -57,8 +57,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; @@ -206,12 +206,12 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -220,8 +220,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -235,8 +235,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; diff --git a/plugins/MacVST/Deckwrecka/source/DeckwreckaProc.cpp b/plugins/MacVST/Deckwrecka/source/DeckwreckaProc.cpp index 6b109e1ed..e7146df5d 100755 --- a/plugins/MacVST/Deckwrecka/source/DeckwreckaProc.cpp +++ b/plugins/MacVST/Deckwrecka/source/DeckwreckaProc.cpp @@ -32,8 +32,8 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -217,8 +217,8 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Density/source/Density.cpp b/plugins/MacVST/Density/source/Density.cpp index bac4fb24b..01ad61f14 100755 --- a/plugins/MacVST/Density/source/Density.cpp +++ b/plugins/MacVST/Density/source/Density.cpp @@ -21,8 +21,8 @@ Density::Density(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Density/source/Density.h b/plugins/MacVST/Density/source/Density.h index b634c4475..0f188b3bb 100755 --- a/plugins/MacVST/Density/source/Density.h +++ b/plugins/MacVST/Density/source/Density.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacVST/Density/source/DensityProc.cpp b/plugins/MacVST/Density/source/DensityProc.cpp index f229a9ded..5db9e5022 100755 --- a/plugins/MacVST/Density/source/DensityProc.cpp +++ b/plugins/MacVST/Density/source/DensityProc.cpp @@ -27,53 +27,17 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -187,53 +151,17 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Density2/source/Density2.h b/plugins/MacVST/Density2/source/Density2.h index cca180d09..eb0ca981c 100755 --- a/plugins/MacVST/Density2/source/Density2.h +++ b/plugins/MacVST/Density2/source/Density2.h @@ -59,25 +59,25 @@ private: uint32_t fpdR; //default stuff - long double last3SampleL; - long double last2SampleL; - long double last1SampleL; - long double ataAL; - long double ataBL; - long double ataCL; - long double lastDiffSampleL; - long double iirSampleAL; - long double iirSampleBL; + double last3SampleL; + double last2SampleL; + double last1SampleL; + double ataAL; + double ataBL; + double ataCL; + double lastDiffSampleL; + double iirSampleAL; + double iirSampleBL; - long double last3SampleR; - long double last2SampleR; - long double last1SampleR; - long double ataAR; - long double ataBR; - long double ataCR; - long double lastDiffSampleR; - long double iirSampleAR; - long double iirSampleBR; + double last3SampleR; + double last2SampleR; + double last1SampleR; + double ataAR; + double ataBR; + double ataCR; + double lastDiffSampleR; + double iirSampleAR; + double iirSampleBR; float A; float B; diff --git a/plugins/MacVST/Density2/source/Density2Proc.cpp b/plugins/MacVST/Density2/source/Density2Proc.cpp index e266cd26a..bd79936ab 100755 --- a/plugins/MacVST/Density2/source/Density2Proc.cpp +++ b/plugins/MacVST/Density2/source/Density2Proc.cpp @@ -27,18 +27,18 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -46,7 +46,7 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -83,12 +83,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -128,12 +128,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -184,18 +184,18 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -203,7 +203,7 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -240,12 +240,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -285,12 +285,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -303,12 +303,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet); //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Desk/source/Desk.cpp b/plugins/MacVST/Desk/source/Desk.cpp index 9582f0459..a23bbc3b5 100755 --- a/plugins/MacVST/Desk/source/Desk.cpp +++ b/plugins/MacVST/Desk/source/Desk.cpp @@ -18,8 +18,8 @@ Desk::Desk(audioMasterCallback audioMaster) : lastSampleR = 0.0; lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Desk/source/Desk.h b/plugins/MacVST/Desk/source/Desk.h index f7f933df0..b33f2bf52 100755 --- a/plugins/MacVST/Desk/source/Desk.h +++ b/plugins/MacVST/Desk/source/Desk.h @@ -51,15 +51,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacVST/Desk/source/DeskProc.cpp b/plugins/MacVST/Desk/source/DeskProc.cpp index d53894b86..328e06643 100755 --- a/plugins/MacVST/Desk/source/DeskProc.cpp +++ b/plugins/MacVST/Desk/source/DeskProc.cpp @@ -30,53 +30,17 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR /= gain; //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -190,53 +154,17 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR /= gain; //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Desk4/source/Desk4.cpp b/plugins/MacVST/Desk4/source/Desk4.cpp index 0a05d870b..ebf1daadb 100755 --- a/plugins/MacVST/Desk4/source/Desk4.cpp +++ b/plugins/MacVST/Desk4/source/Desk4.cpp @@ -30,8 +30,8 @@ Desk4::Desk4(audioMasterCallback audioMaster) : lastSlewR = 0.0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Desk4/source/Desk4.h b/plugins/MacVST/Desk4/source/Desk4.h index 802ee4733..8b1a72406 100755 --- a/plugins/MacVST/Desk4/source/Desk4.h +++ b/plugins/MacVST/Desk4/source/Desk4.h @@ -70,8 +70,8 @@ private: double lastSlewR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Desk4/source/Desk4Proc.cpp b/plugins/MacVST/Desk4/source/Desk4Proc.cpp index fd165b697..0426cc218 100755 --- a/plugins/MacVST/Desk4/source/Desk4Proc.cpp +++ b/plugins/MacVST/Desk4/source/Desk4Proc.cpp @@ -48,51 +48,15 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,14 +190,14 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -286,51 +250,15 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -464,16 +392,14 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DigitalBlack/source/DigitalBlackProc.cpp b/plugins/MacVST/DigitalBlack/source/DigitalBlackProc.cpp index 758a5d899..8caeff273 100755 --- a/plugins/MacVST/DigitalBlack/source/DigitalBlackProc.cpp +++ b/plugins/MacVST/DigitalBlack/source/DigitalBlackProc.cpp @@ -24,12 +24,12 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -67,7 +67,7 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); @@ -125,12 +125,12 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -168,7 +168,7 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/MacVST/Distance/source/Distance.cpp b/plugins/MacVST/Distance/source/Distance.cpp index 7ccd8fba2..ca1806e47 100755 --- a/plugins/MacVST/Distance/source/Distance.cpp +++ b/plugins/MacVST/Distance/source/Distance.cpp @@ -16,8 +16,8 @@ Distance::Distance(audioMasterCallback audioMaster) : B = 1.0; thirdresultL = prevresultL = lastclampL = clampL = changeL = lastL = 0.0; thirdresultR = prevresultR = lastclampR = clampR = changeR = lastR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Distance/source/Distance.h b/plugins/MacVST/Distance/source/Distance.h index 5566f8485..021335d65 100755 --- a/plugins/MacVST/Distance/source/Distance.h +++ b/plugins/MacVST/Distance/source/Distance.h @@ -67,8 +67,8 @@ private: double prevresultR; double lastR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Distance/source/DistanceProc.cpp b/plugins/MacVST/Distance/source/DistanceProc.cpp index 32eb3fa9d..30065e778 100755 --- a/plugins/MacVST/Distance/source/DistanceProc.cpp +++ b/plugins/MacVST/Distance/source/DistanceProc.cpp @@ -28,53 +28,17 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -123,14 +87,14 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -163,53 +127,17 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -258,16 +186,14 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Distance2/source/Distance2.cpp b/plugins/MacVST/Distance2/source/Distance2.cpp index d6e26d85e..8e1e63871 100755 --- a/plugins/MacVST/Distance2/source/Distance2.cpp +++ b/plugins/MacVST/Distance2/source/Distance2.cpp @@ -61,8 +61,8 @@ Distance2::Distance2(audioMasterCallback audioMaster) : thresholdL = 1.763323098246125; thresholdM = 1.939655408070737; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Distance2/source/Distance2.h b/plugins/MacVST/Distance2/source/Distance2.h index dba008f6a..17d29134d 100755 --- a/plugins/MacVST/Distance2/source/Distance2.h +++ b/plugins/MacVST/Distance2/source/Distance2.h @@ -54,51 +54,51 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; double thirdSampleL; double lastSampleL; diff --git a/plugins/MacVST/Distance2/source/Distance2Proc.cpp b/plugins/MacVST/Distance2/source/Distance2Proc.cpp index 473f3c86e..0a92a9268 100755 --- a/plugins/MacVST/Distance2/source/Distance2Proc.cpp +++ b/plugins/MacVST/Distance2/source/Distance2Proc.cpp @@ -43,8 +43,8 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -97,7 +97,7 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -266,14 +266,14 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -321,8 +321,8 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -375,7 +375,7 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -544,16 +544,14 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Distortion/source/Distortion.h b/plugins/MacVST/Distortion/source/Distortion.h index 53ccfde6c..c0f2d7553 100755 --- a/plugins/MacVST/Distortion/source/Distortion.h +++ b/plugins/MacVST/Distortion/source/Distortion.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousInL[9]; - long double previousOutL[9]; - long double previousInR[9]; - long double previousOutR[9]; + double previousInL[9]; + double previousOutL[9]; + double previousInR[9]; + double previousOutR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/Distortion/source/DistortionProc.cpp b/plugins/MacVST/Distortion/source/DistortionProc.cpp index 31b455c6e..8d6a4f8b0 100755 --- a/plugins/MacVST/Distortion/source/DistortionProc.cpp +++ b/plugins/MacVST/Distortion/source/DistortionProc.cpp @@ -23,18 +23,18 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -74,14 +74,14 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -90,7 +90,7 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; @@ -144,18 +144,18 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -195,14 +195,14 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -211,7 +211,7 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; diff --git a/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp b/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp index a7121e8ac..80e204250 100755 --- a/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp +++ b/plugins/MacVST/DitherFloat/source/DitherFloatProc.cpp @@ -19,9 +19,9 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -63,8 +63,8 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); @@ -104,9 +104,9 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -148,8 +148,8 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); diff --git a/plugins/MacVST/DitherMeDiskers/source/DitherMeDiskers.h b/plugins/MacVST/DitherMeDiskers/source/DitherMeDiskers.h index 11f769eb2..4ba134f9a 100755 --- a/plugins/MacVST/DitherMeDiskers/source/DitherMeDiskers.h +++ b/plugins/MacVST/DitherMeDiskers/source/DitherMeDiskers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/MacVST/DitherMeTimbers/source/DitherMeTimbers.h b/plugins/MacVST/DitherMeTimbers/source/DitherMeTimbers.h index 58daf0f03..03d712ee0 100755 --- a/plugins/MacVST/DitherMeTimbers/source/DitherMeTimbers.h +++ b/plugins/MacVST/DitherMeTimbers/source/DitherMeTimbers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/MacVST/Ditherbox/source/Ditherbox.h b/plugins/MacVST/Ditherbox/source/Ditherbox.h index fa54082b1..164f37bab 100755 --- a/plugins/MacVST/Ditherbox/source/Ditherbox.h +++ b/plugins/MacVST/Ditherbox/source/Ditherbox.h @@ -54,8 +54,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double contingentErrL; double contingentErrR; double currentDitherL; @@ -68,10 +68,10 @@ private: double NSOddR; double prevR; double nsR[16]; - long double lastSampleL; - long double outSampleL; - long double lastSampleR; - long double outSampleR; + double lastSampleL; + double outSampleL; + double lastSampleR; + double outSampleR; double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp b/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp index 4906413e8..8851aeaa0 100755 --- a/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp +++ b/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp @@ -15,31 +15,31 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -48,46 +48,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; float drySampleL = inputSampleL; float drySampleR = inputSampleR; @@ -1020,31 +984,31 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -1053,46 +1017,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; diff --git a/plugins/MacVST/DoublePaul/source/DoublePaulProc.cpp b/plugins/MacVST/DoublePaul/source/DoublePaulProc.cpp index 66de94f5c..0ba4cae2b 100755 --- a/plugins/MacVST/DoublePaul/source/DoublePaulProc.cpp +++ b/plugins/MacVST/DoublePaul/source/DoublePaulProc.cpp @@ -17,51 +17,15 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -136,51 +100,15 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacVST/Drive/source/Drive.cpp b/plugins/MacVST/Drive/source/Drive.cpp index ac5f228ae..e88a7b678 100755 --- a/plugins/MacVST/Drive/source/Drive.cpp +++ b/plugins/MacVST/Drive/source/Drive.cpp @@ -21,8 +21,8 @@ Drive::Drive(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Drive/source/Drive.h b/plugins/MacVST/Drive/source/Drive.h index 525a09eb0..5b9bf5910 100755 --- a/plugins/MacVST/Drive/source/Drive.h +++ b/plugins/MacVST/Drive/source/Drive.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/MacVST/Drive/source/DriveProc.cpp b/plugins/MacVST/Drive/source/DriveProc.cpp index 074ccfd3c..d30635b48 100755 --- a/plugins/MacVST/Drive/source/DriveProc.cpp +++ b/plugins/MacVST/Drive/source/DriveProc.cpp @@ -27,53 +27,17 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -127,14 +91,14 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,53 +130,17 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -266,16 +194,14 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DrumSlam/source/DrumSlam.cpp b/plugins/MacVST/DrumSlam/source/DrumSlam.cpp index 5b8861982..7449845c9 100755 --- a/plugins/MacVST/DrumSlam/source/DrumSlam.cpp +++ b/plugins/MacVST/DrumSlam/source/DrumSlam.cpp @@ -36,8 +36,8 @@ DrumSlam::DrumSlam(audioMasterCallback audioMaster) : iirSampleHR = 0.0; lastSampleR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/DrumSlam/source/DrumSlam.h b/plugins/MacVST/DrumSlam/source/DrumSlam.h index 418282d59..3d83fce09 100755 --- a/plugins/MacVST/DrumSlam/source/DrumSlam.h +++ b/plugins/MacVST/DrumSlam/source/DrumSlam.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/MacVST/DrumSlam/source/DrumSlamProc.cpp b/plugins/MacVST/DrumSlam/source/DrumSlamProc.cpp index 2e86142c7..ab071ac1e 100755 --- a/plugins/MacVST/DrumSlam/source/DrumSlamProc.cpp +++ b/plugins/MacVST/DrumSlam/source/DrumSlamProc.cpp @@ -28,54 +28,18 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -147,10 +111,10 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -219,14 +183,14 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -259,54 +223,18 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -378,10 +306,10 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -450,16 +378,14 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DubCenter/source/DubCenter.cpp b/plugins/MacVST/DubCenter/source/DubCenter.cpp index 098e72313..ed7ff1c06 100755 --- a/plugins/MacVST/DubCenter/source/DubCenter.cpp +++ b/plugins/MacVST/DubCenter/source/DubCenter.cpp @@ -80,8 +80,8 @@ DubCenter::DubCenter(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/DubCenter/source/DubCenter.h b/plugins/MacVST/DubCenter/source/DubCenter.h index 9d7c7e6fb..54b9eeb59 100755 --- a/plugins/MacVST/DubCenter/source/DubCenter.h +++ b/plugins/MacVST/DubCenter/source/DubCenter.h @@ -117,8 +117,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/DubCenter/source/DubCenterProc.cpp b/plugins/MacVST/DubCenter/source/DubCenterProc.cpp index b0c49a397..49806b773 100755 --- a/plugins/MacVST/DubCenter/source/DubCenterProc.cpp +++ b/plugins/MacVST/DubCenter/source/DubCenterProc.cpp @@ -49,8 +49,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,8 +88,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -306,14 +306,14 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -366,8 +366,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -405,8 +405,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -623,16 +623,14 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DubSub/source/DubSub.cpp b/plugins/MacVST/DubSub/source/DubSub.cpp index 6dc87fcbe..e53c47dcc 100755 --- a/plugins/MacVST/DubSub/source/DubSub.cpp +++ b/plugins/MacVST/DubSub/source/DubSub.cpp @@ -118,8 +118,8 @@ DubSub::DubSub(audioMasterCallback audioMaster) : oscGateL = 1.0; oscGateR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/DubSub/source/DubSub.h b/plugins/MacVST/DubSub/source/DubSub.h index 0e26cfad4..4f3f6af8c 100755 --- a/plugins/MacVST/DubSub/source/DubSub.h +++ b/plugins/MacVST/DubSub/source/DubSub.h @@ -159,8 +159,8 @@ private: double oscGateR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/DubSub/source/DubSubProc.cpp b/plugins/MacVST/DubSub/source/DubSubProc.cpp index 7a0349d51..4195d3b38 100755 --- a/plugins/MacVST/DubSub/source/DubSubProc.cpp +++ b/plugins/MacVST/DubSub/source/DubSubProc.cpp @@ -53,8 +53,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -92,8 +92,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aDubSub. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -392,14 +392,14 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -457,8 +457,8 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -795,16 +795,14 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/DustBunny/source/DustBunnyProc.cpp b/plugins/MacVST/DustBunny/source/DustBunnyProc.cpp index 27a8d66c0..d4667fdec 100755 --- a/plugins/MacVST/DustBunny/source/DustBunnyProc.cpp +++ b/plugins/MacVST/DustBunny/source/DustBunnyProc.cpp @@ -25,44 +25,8 @@ void DustBunny::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -144,52 +108,16 @@ void DustBunny::processDoubleReplacing(double **inputs, double **outputs, VstInt unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); bunny = (bunny*bunny); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/MacVST/Dyno/source/DynoProc.cpp b/plugins/MacVST/Dyno/source/DynoProc.cpp index f01381c06..3e9052c73 100755 --- a/plugins/MacVST/Dyno/source/DynoProc.cpp +++ b/plugins/MacVST/Dyno/source/DynoProc.cpp @@ -18,8 +18,8 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); @@ -65,8 +65,8 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); diff --git a/plugins/MacVST/EQ/source/EQ.cpp b/plugins/MacVST/EQ/source/EQ.cpp index f2e4e0134..702dd33d4 100755 --- a/plugins/MacVST/EQ/source/EQ.cpp +++ b/plugins/MacVST/EQ/source/EQ.cpp @@ -111,8 +111,8 @@ EQ::EQ(audioMasterCallback audioMaster) : flip = false; flipthree = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/EQ/source/EQ.h b/plugins/MacVST/EQ/source/EQ.h index 26fade4aa..7d533787f 100755 --- a/plugins/MacVST/EQ/source/EQ.h +++ b/plugins/MacVST/EQ/source/EQ.h @@ -59,8 +59,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/EQ/source/EQProc.cpp b/plugins/MacVST/EQ/source/EQProc.cpp index 917dc7e77..220314936 100755 --- a/plugins/MacVST/EQ/source/EQProc.cpp +++ b/plugins/MacVST/EQ/source/EQProc.cpp @@ -21,8 +21,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -69,44 +69,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -431,14 +395,14 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -464,8 +428,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -512,44 +476,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -874,16 +802,14 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/EdIsDim/source/EdIsDim.cpp b/plugins/MacVST/EdIsDim/source/EdIsDim.cpp index eb6abd32d..8a4f6db6f 100755 --- a/plugins/MacVST/EdIsDim/source/EdIsDim.cpp +++ b/plugins/MacVST/EdIsDim/source/EdIsDim.cpp @@ -13,8 +13,8 @@ EdIsDim::EdIsDim(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/EdIsDim/source/EdIsDim.h b/plugins/MacVST/EdIsDim/source/EdIsDim.h index 4f6270586..7b887d69e 100755 --- a/plugins/MacVST/EdIsDim/source/EdIsDim.h +++ b/plugins/MacVST/EdIsDim/source/EdIsDim.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/EdIsDim/source/EdIsDimProc.cpp b/plugins/MacVST/EdIsDim/source/EdIsDimProc.cpp index 0d033eb65..2273bfcaa 100755 --- a/plugins/MacVST/EdIsDim/source/EdIsDimProc.cpp +++ b/plugins/MacVST/EdIsDim/source/EdIsDimProc.cpp @@ -15,10 +15,10 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -27,44 +27,8 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -74,7 +38,7 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -99,10 +63,10 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -111,44 +75,8 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; @@ -159,7 +87,7 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/MacVST/Elation/source/ElationProc.cpp b/plugins/MacVST/Elation/source/ElationProc.cpp index dd2878dd9..359c931b3 100755 --- a/plugins/MacVST/Elation/source/ElationProc.cpp +++ b/plugins/MacVST/Elation/source/ElationProc.cpp @@ -34,12 +34,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; @@ -314,12 +314,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; diff --git a/plugins/MacVST/ElectroHat/source/ElectroHat.cpp b/plugins/MacVST/ElectroHat/source/ElectroHat.cpp index 6be41e4b1..0ca7bd6c1 100755 --- a/plugins/MacVST/ElectroHat/source/ElectroHat.cpp +++ b/plugins/MacVST/ElectroHat/source/ElectroHat.cpp @@ -25,8 +25,8 @@ ElectroHat::ElectroHat(audioMasterCallback audioMaster) : lok = 0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ElectroHat/source/ElectroHat.h b/plugins/MacVST/ElectroHat/source/ElectroHat.h index 85315cd63..b07061904 100755 --- a/plugins/MacVST/ElectroHat/source/ElectroHat.h +++ b/plugins/MacVST/ElectroHat/source/ElectroHat.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedSampleL; diff --git a/plugins/MacVST/ElectroHat/source/ElectroHatProc.cpp b/plugins/MacVST/ElectroHat/source/ElectroHatProc.cpp index ee5a3070f..d99dc44ab 100755 --- a/plugins/MacVST/ElectroHat/source/ElectroHatProc.cpp +++ b/plugins/MacVST/ElectroHat/source/ElectroHatProc.cpp @@ -25,8 +25,8 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -123,14 +123,14 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -160,8 +160,8 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -258,16 +258,14 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Energy/source/Energy.cpp b/plugins/MacVST/Energy/source/Energy.cpp index 8571e56c1..8d8ab6081 100755 --- a/plugins/MacVST/Energy/source/Energy.cpp +++ b/plugins/MacVST/Energy/source/Energy.cpp @@ -160,8 +160,8 @@ Energy::Energy(audioMasterCallback audioMaster) : PrevAR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Energy/source/Energy.h b/plugins/MacVST/Energy/source/Energy.h index b039c608c..0500e8391 100755 --- a/plugins/MacVST/Energy/source/Energy.h +++ b/plugins/MacVST/Energy/source/Energy.h @@ -60,8 +60,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double duoEvenL; diff --git a/plugins/MacVST/Energy/source/EnergyProc.cpp b/plugins/MacVST/Energy/source/EnergyProc.cpp index a0a86f85f..dbe218778 100755 --- a/plugins/MacVST/Energy/source/EnergyProc.cpp +++ b/plugins/MacVST/Energy/source/EnergyProc.cpp @@ -27,8 +27,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -742,14 +742,14 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -781,8 +781,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -821,8 +821,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -1496,16 +1496,14 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Energy2/source/Energy2Proc.cpp b/plugins/MacVST/Energy2/source/Energy2Proc.cpp index a256b2ca4..5b5933828 100755 --- a/plugins/MacVST/Energy2/source/Energy2Proc.cpp +++ b/plugins/MacVST/Energy2/source/Energy2Proc.cpp @@ -36,17 +36,17 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -678,17 +678,17 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -1273,12 +1273,12 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Ensemble/source/Ensemble.cpp b/plugins/MacVST/Ensemble/source/Ensemble.cpp index b90bf6e69..1b701ecc2 100755 --- a/plugins/MacVST/Ensemble/source/Ensemble.cpp +++ b/plugins/MacVST/Ensemble/source/Ensemble.cpp @@ -29,8 +29,8 @@ Ensemble::Ensemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Ensemble/source/Ensemble.h b/plugins/MacVST/Ensemble/source/Ensemble.h index 7697d9317..7d0af8926 100755 --- a/plugins/MacVST/Ensemble/source/Ensemble.h +++ b/plugins/MacVST/Ensemble/source/Ensemble.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 65540; float dL[totalsamples]; diff --git a/plugins/MacVST/Ensemble/source/EnsembleProc.cpp b/plugins/MacVST/Ensemble/source/EnsembleProc.cpp index e9a3a4392..ec4b9c8db 100755 --- a/plugins/MacVST/Ensemble/source/EnsembleProc.cpp +++ b/plugins/MacVST/Ensemble/source/EnsembleProc.cpp @@ -38,8 +38,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -56,44 +56,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -153,14 +117,14 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -203,8 +167,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -221,44 +185,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -318,16 +246,14 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/EveryTrim/source/EveryTrim.cpp b/plugins/MacVST/EveryTrim/source/EveryTrim.cpp index b0a98d48c..fcb71bec3 100755 --- a/plugins/MacVST/EveryTrim/source/EveryTrim.cpp +++ b/plugins/MacVST/EveryTrim/source/EveryTrim.cpp @@ -17,8 +17,8 @@ EveryTrim::EveryTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/EveryTrim/source/EveryTrim.h b/plugins/MacVST/EveryTrim/source/EveryTrim.h index 4efc3cd6b..aec024775 100755 --- a/plugins/MacVST/EveryTrim/source/EveryTrim.h +++ b/plugins/MacVST/EveryTrim/source/EveryTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/EveryTrim/source/EveryTrimProc.cpp b/plugins/MacVST/EveryTrim/source/EveryTrimProc.cpp index 3c30eda6b..1bb858da7 100755 --- a/plugins/MacVST/EveryTrim/source/EveryTrimProc.cpp +++ b/plugins/MacVST/EveryTrim/source/EveryTrimProc.cpp @@ -21,10 +21,10 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Facet/source/FacetProc.cpp b/plugins/MacVST/Facet/source/FacetProc.cpp index 53e92ce39..fb5cdbd6e 100755 --- a/plugins/MacVST/Facet/source/FacetProc.cpp +++ b/plugins/MacVST/Facet/source/FacetProc.cpp @@ -18,8 +18,8 @@ void Facet::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Facet::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/FathomFive/source/FathomFiveProc.cpp b/plugins/MacVST/FathomFive/source/FathomFiveProc.cpp index f509c2188..fee6aba1e 100755 --- a/plugins/MacVST/FathomFive/source/FathomFiveProc.cpp +++ b/plugins/MacVST/FathomFive/source/FathomFiveProc.cpp @@ -25,51 +25,15 @@ void FathomFive::processReplacing(float **inputs, float **outputs, VstInt32 samp if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} @@ -143,51 +107,15 @@ void FathomFive::processDoubleReplacing(double **inputs, double **outputs, VstIn if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} diff --git a/plugins/MacVST/Floor/source/Floor.cpp b/plugins/MacVST/Floor/source/Floor.cpp index ff12e691c..7bb4a8ddb 100755 --- a/plugins/MacVST/Floor/source/Floor.cpp +++ b/plugins/MacVST/Floor/source/Floor.cpp @@ -39,8 +39,8 @@ Floor::Floor(audioMasterCallback audioMaster) : iirSample2DR = 0.0; iirSample2ER = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Floor/source/Floor.h b/plugins/MacVST/Floor/source/Floor.h index dc6b58c54..c80bb7c7f 100755 --- a/plugins/MacVST/Floor/source/Floor.h +++ b/plugins/MacVST/Floor/source/Floor.h @@ -78,8 +78,8 @@ private: double iirSample2DR; double iirSample2ER; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Floor/source/FloorProc.cpp b/plugins/MacVST/Floor/source/FloorProc.cpp index 865446b5f..0cfa58c69 100755 --- a/plugins/MacVST/Floor/source/FloorProc.cpp +++ b/plugins/MacVST/Floor/source/FloorProc.cpp @@ -36,8 +36,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,8 +75,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -247,14 +247,14 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -295,8 +295,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -334,8 +334,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -506,16 +506,14 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Focus/source/Focus.h b/plugins/MacVST/Focus/source/Focus.h index cd7e72a97..7b2cf706d 100755 --- a/plugins/MacVST/Focus/source/Focus.h +++ b/plugins/MacVST/Focus/source/Focus.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/Focus/source/FocusProc.cpp b/plugins/MacVST/Focus/source/FocusProc.cpp index f25a32814..9e1c9c070 100755 --- a/plugins/MacVST/Focus/source/FocusProc.cpp +++ b/plugins/MacVST/Focus/source/FocusProc.cpp @@ -32,18 +32,18 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -62,8 +62,8 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -98,14 +98,14 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -170,18 +170,18 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -200,8 +200,8 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -236,14 +236,14 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; diff --git a/plugins/MacVST/Fracture/source/Fracture.cpp b/plugins/MacVST/Fracture/source/Fracture.cpp index 03f3b1968..302b4dc54 100755 --- a/plugins/MacVST/Fracture/source/Fracture.cpp +++ b/plugins/MacVST/Fracture/source/Fracture.cpp @@ -16,8 +16,8 @@ Fracture::Fracture(audioMasterCallback audioMaster) : B = 0.5; //2 from 1 to 3: (B*2.999)+1 C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Fracture/source/Fracture.h b/plugins/MacVST/Fracture/source/Fracture.h index 49d271858..54aac5a86 100755 --- a/plugins/MacVST/Fracture/source/Fracture.h +++ b/plugins/MacVST/Fracture/source/Fracture.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Fracture/source/FractureProc.cpp b/plugins/MacVST/Fracture/source/FractureProc.cpp index 5c1aaa941..e7b6e7225 100755 --- a/plugins/MacVST/Fracture/source/FractureProc.cpp +++ b/plugins/MacVST/Fracture/source/FractureProc.cpp @@ -23,53 +23,17 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -98,14 +62,14 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -136,53 +100,17 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -211,16 +139,14 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/FromTape/source/FromTape.cpp b/plugins/MacVST/FromTape/source/FromTape.cpp index 40b787673..4573e48be 100755 --- a/plugins/MacVST/FromTape/source/FromTape.cpp +++ b/plugins/MacVST/FromTape/source/FromTape.cpp @@ -82,8 +82,8 @@ FromTape::FromTape(audioMasterCallback audioMaster) : flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/FromTape/source/FromTape.h b/plugins/MacVST/FromTape/source/FromTape.h index 40efabc1b..cd63776b9 100755 --- a/plugins/MacVST/FromTape/source/FromTape.h +++ b/plugins/MacVST/FromTape/source/FromTape.h @@ -120,8 +120,8 @@ private: double iirSampleYR; double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/FromTape/source/FromTapeProc.cpp b/plugins/MacVST/FromTape/source/FromTapeProc.cpp index 2d268ef27..0f4db6e85 100755 --- a/plugins/MacVST/FromTape/source/FromTapeProc.cpp +++ b/plugins/MacVST/FromTape/source/FromTapeProc.cpp @@ -37,52 +37,16 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -221,14 +185,14 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -270,51 +234,15 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -454,16 +382,14 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Galactic/source/GalacticProc.cpp b/plugins/MacVST/Galactic/source/GalacticProc.cpp index ccb0aef48..19344f0e4 100755 --- a/plugins/MacVST/Galactic/source/GalacticProc.cpp +++ b/plugins/MacVST/Galactic/source/GalacticProc.cpp @@ -47,12 +47,12 @@ void Galactic::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -279,12 +279,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -453,12 +453,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Gatelope/source/Gatelope.cpp b/plugins/MacVST/Gatelope/source/Gatelope.cpp index 41ed2af14..225c337d5 100755 --- a/plugins/MacVST/Gatelope/source/Gatelope.cpp +++ b/plugins/MacVST/Gatelope/source/Gatelope.cpp @@ -28,8 +28,8 @@ Gatelope::Gatelope(audioMasterCallback audioMaster) : treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Gatelope/source/Gatelope.h b/plugins/MacVST/Gatelope/source/Gatelope.h index 06a0c5571..273e19f6f 100755 --- a/plugins/MacVST/Gatelope/source/Gatelope.h +++ b/plugins/MacVST/Gatelope/source/Gatelope.h @@ -67,8 +67,8 @@ private: double treblefreq; double bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Gatelope/source/GatelopeProc.cpp b/plugins/MacVST/Gatelope/source/GatelopeProc.cpp index f42904218..b5f1d67d7 100755 --- a/plugins/MacVST/Gatelope/source/GatelopeProc.cpp +++ b/plugins/MacVST/Gatelope/source/GatelopeProc.cpp @@ -36,8 +36,8 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -196,14 +196,14 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -244,8 +244,8 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -404,16 +404,14 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/GlitchShifter/source/GlitchShifterProc.cpp b/plugins/MacVST/GlitchShifter/source/GlitchShifterProc.cpp index 9059dc5db..852c3bc0f 100755 --- a/plugins/MacVST/GlitchShifter/source/GlitchShifterProc.cpp +++ b/plugins/MacVST/GlitchShifter/source/GlitchShifterProc.cpp @@ -26,12 +26,12 @@ void GlitchShifter::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -343,12 +343,12 @@ void GlitchShifter::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} diff --git a/plugins/MacVST/Golem/source/Golem.cpp b/plugins/MacVST/Golem/source/Golem.cpp index c99c5cd92..22d4cb6f5 100755 --- a/plugins/MacVST/Golem/source/Golem.cpp +++ b/plugins/MacVST/Golem/source/Golem.cpp @@ -17,8 +17,8 @@ Golem::Golem(audioMasterCallback audioMaster) : C = 0.0; for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/Golem/source/Golem.h b/plugins/MacVST/Golem/source/Golem.h index e02ab7822..4416d3463 100755 --- a/plugins/MacVST/Golem/source/Golem.h +++ b/plugins/MacVST/Golem/source/Golem.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff double p[4099]; diff --git a/plugins/MacVST/Golem/source/GolemProc.cpp b/plugins/MacVST/Golem/source/GolemProc.cpp index 1d7e9f5f9..316632391 100755 --- a/plugins/MacVST/Golem/source/GolemProc.cpp +++ b/plugins/MacVST/Golem/source/GolemProc.cpp @@ -33,51 +33,15 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -112,14 +76,14 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = inputSampleL; //the output is totally mono - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -157,51 +121,15 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -236,16 +164,14 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = inputSampleL; //the output is totally mono - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Gringer/source/Gringer.h b/plugins/MacVST/Gringer/source/Gringer.h index 3306f47eb..53d8dce83 100755 --- a/plugins/MacVST/Gringer/source/Gringer.h +++ b/plugins/MacVST/Gringer/source/Gringer.h @@ -54,10 +54,10 @@ private: uint32_t fpd; //default stuff - long double inbandL[9]; - long double outbandL[9]; - long double inbandR[9]; - long double outbandR[9]; + double inbandL[9]; + double outbandL[9]; + double inbandR[9]; + double outbandR[9]; }; diff --git a/plugins/MacVST/Gringer/source/GringerProc.cpp b/plugins/MacVST/Gringer/source/GringerProc.cpp index 2a40f387c..b76693f2e 100755 --- a/plugins/MacVST/Gringer/source/GringerProc.cpp +++ b/plugins/MacVST/Gringer/source/GringerProc.cpp @@ -58,8 +58,8 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -67,7 +67,7 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); @@ -173,8 +173,8 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -182,7 +182,7 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); diff --git a/plugins/MacVST/GrooveWear/source/GrooveWear.cpp b/plugins/MacVST/GrooveWear/source/GrooveWear.cpp index cbe1fc57a..b15478506 100755 --- a/plugins/MacVST/GrooveWear/source/GrooveWear.cpp +++ b/plugins/MacVST/GrooveWear/source/GrooveWear.cpp @@ -36,8 +36,8 @@ GrooveWear::GrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/GrooveWear/source/GrooveWear.h b/plugins/MacVST/GrooveWear/source/GrooveWear.h index 4bf97453c..fe207c7b6 100755 --- a/plugins/MacVST/GrooveWear/source/GrooveWear.h +++ b/plugins/MacVST/GrooveWear/source/GrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/MacVST/GrooveWear/source/GrooveWearProc.cpp b/plugins/MacVST/GrooveWear/source/GrooveWearProc.cpp index e663203a4..98eeec25e 100755 --- a/plugins/MacVST/GrooveWear/source/GrooveWearProc.cpp +++ b/plugins/MacVST/GrooveWear/source/GrooveWearProc.cpp @@ -98,51 +98,15 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -430,14 +394,14 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -540,51 +504,15 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -872,16 +800,14 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.cpp b/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.cpp index b0388ab94..309ce7e4e 100755 --- a/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.cpp +++ b/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new G GuitarConditioner::GuitarConditioner(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; lastSampleTL = 0.0; lastSampleBL = 0.0; //for Slews. T for treble, B for bass diff --git a/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.h b/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.h index 3be09e141..fca5a3c07 100755 --- a/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.h +++ b/plugins/MacVST/GuitarConditioner/source/GuitarConditioner.h @@ -49,8 +49,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff bool fpFlip; double lastSampleTL; diff --git a/plugins/MacVST/GuitarConditioner/source/GuitarConditionerProc.cpp b/plugins/MacVST/GuitarConditioner/source/GuitarConditionerProc.cpp index b25d600d1..6bfd3bbc4 100755 --- a/plugins/MacVST/GuitarConditioner/source/GuitarConditionerProc.cpp +++ b/plugins/MacVST/GuitarConditioner/source/GuitarConditionerProc.cpp @@ -18,12 +18,12 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -40,44 +40,8 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -165,14 +129,14 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -195,12 +159,12 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -218,44 +182,8 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -342,16 +270,14 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs inputSampleR = trebleR + bassR; //final merge fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/HardVacuum/source/HardVacuum.cpp b/plugins/MacVST/HardVacuum/source/HardVacuum.cpp index 9c14f8993..533cb5610 100755 --- a/plugins/MacVST/HardVacuum/source/HardVacuum.cpp +++ b/plugins/MacVST/HardVacuum/source/HardVacuum.cpp @@ -19,8 +19,8 @@ HardVacuum::HardVacuum(audioMasterCallback audioMaster) : E = 1.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/HardVacuum/source/HardVacuum.h b/plugins/MacVST/HardVacuum/source/HardVacuum.h index 7f4c098cb..f159aadb8 100755 --- a/plugins/MacVST/HardVacuum/source/HardVacuum.h +++ b/plugins/MacVST/HardVacuum/source/HardVacuum.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/HardVacuum/source/HardVacuumProc.cpp b/plugins/MacVST/HardVacuum/source/HardVacuumProc.cpp index e0e07e2b2..87a1b1edb 100755 --- a/plugins/MacVST/HardVacuum/source/HardVacuumProc.cpp +++ b/plugins/MacVST/HardVacuum/source/HardVacuumProc.cpp @@ -36,51 +36,15 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -173,14 +137,14 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -221,52 +185,16 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -359,16 +287,14 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/HermeTrim/source/HermeTrim.cpp b/plugins/MacVST/HermeTrim/source/HermeTrim.cpp index 117cc4599..77103be7b 100755 --- a/plugins/MacVST/HermeTrim/source/HermeTrim.cpp +++ b/plugins/MacVST/HermeTrim/source/HermeTrim.cpp @@ -17,8 +17,8 @@ HermeTrim::HermeTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/HermeTrim/source/HermeTrim.h b/plugins/MacVST/HermeTrim/source/HermeTrim.h index f0bc8ed52..6db22a3b5 100755 --- a/plugins/MacVST/HermeTrim/source/HermeTrim.h +++ b/plugins/MacVST/HermeTrim/source/HermeTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/HermeTrim/source/HermeTrimProc.cpp b/plugins/MacVST/HermeTrim/source/HermeTrimProc.cpp index 66d314485..dccb829c6 100755 --- a/plugins/MacVST/HermeTrim/source/HermeTrimProc.cpp +++ b/plugins/MacVST/HermeTrim/source/HermeTrimProc.cpp @@ -21,10 +21,10 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Hermepass/source/Hermepass.cpp b/plugins/MacVST/Hermepass/source/Hermepass.cpp index 4e4a5322e..c18a227be 100755 --- a/plugins/MacVST/Hermepass/source/Hermepass.cpp +++ b/plugins/MacVST/Hermepass/source/Hermepass.cpp @@ -33,8 +33,8 @@ Hermepass::Hermepass(audioMasterCallback audioMaster) : iirGR = 0.0; iirHR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Hermepass/source/Hermepass.h b/plugins/MacVST/Hermepass/source/Hermepass.h index 1000bb9da..d3f2970cc 100755 --- a/plugins/MacVST/Hermepass/source/Hermepass.h +++ b/plugins/MacVST/Hermepass/source/Hermepass.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirAL; double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one diff --git a/plugins/MacVST/Hermepass/source/HermepassProc.cpp b/plugins/MacVST/Hermepass/source/HermepassProc.cpp index fddffe31d..178979fbf 100755 --- a/plugins/MacVST/Hermepass/source/HermepassProc.cpp +++ b/plugins/MacVST/Hermepass/source/HermepassProc.cpp @@ -17,8 +17,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -64,8 +64,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -74,44 +74,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -176,14 +140,14 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -205,8 +169,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -252,8 +216,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -262,44 +226,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -364,16 +292,14 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/HighGlossDither/source/HighGlossDitherProc.cpp b/plugins/MacVST/HighGlossDither/source/HighGlossDitherProc.cpp index 2529939de..fee894a81 100755 --- a/plugins/MacVST/HighGlossDither/source/HighGlossDitherProc.cpp +++ b/plugins/MacVST/HighGlossDither/source/HighGlossDitherProc.cpp @@ -16,51 +16,15 @@ void HighGlossDither::processReplacing(float **inputs, float **outputs, VstInt32 int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -111,51 +75,15 @@ void HighGlossDither::processDoubleReplacing(double **inputs, double **outputs, int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacVST/HighImpact/source/HighImpact.cpp b/plugins/MacVST/HighImpact/source/HighImpact.cpp index 960d80c7b..446f34127 100755 --- a/plugins/MacVST/HighImpact/source/HighImpact.cpp +++ b/plugins/MacVST/HighImpact/source/HighImpact.cpp @@ -17,8 +17,8 @@ HighImpact::HighImpact(audioMasterCallback audioMaster) : C = 0.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/HighImpact/source/HighImpact.h b/plugins/MacVST/HighImpact/source/HighImpact.h index a57230b85..71123e03c 100755 --- a/plugins/MacVST/HighImpact/source/HighImpact.h +++ b/plugins/MacVST/HighImpact/source/HighImpact.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/HighImpact/source/HighImpactProc.cpp b/plugins/MacVST/HighImpact/source/HighImpactProc.cpp index f24804a5e..c6ac619a9 100755 --- a/plugins/MacVST/HighImpact/source/HighImpactProc.cpp +++ b/plugins/MacVST/HighImpact/source/HighImpactProc.cpp @@ -15,10 +15,10 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -35,44 +35,8 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -158,14 +122,14 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,10 +152,10 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -208,44 +172,8 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -331,16 +259,14 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Highpass/source/Highpass.cpp b/plugins/MacVST/Highpass/source/Highpass.cpp index 86ebe241c..a87a3f0ce 100755 --- a/plugins/MacVST/Highpass/source/Highpass.cpp +++ b/plugins/MacVST/Highpass/source/Highpass.cpp @@ -19,8 +19,8 @@ Highpass::Highpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/Highpass/source/Highpass.h b/plugins/MacVST/Highpass/source/Highpass.h index 673f951fe..468baa479 100755 --- a/plugins/MacVST/Highpass/source/Highpass.h +++ b/plugins/MacVST/Highpass/source/Highpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Highpass/source/HighpassProc.cpp b/plugins/MacVST/Highpass/source/HighpassProc.cpp index 371ed57a4..92c60aa8b 100755 --- a/plugins/MacVST/Highpass/source/HighpassProc.cpp +++ b/plugins/MacVST/Highpass/source/HighpassProc.cpp @@ -40,44 +40,8 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -118,14 +82,14 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -170,44 +134,8 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -248,16 +176,14 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/MacVST/Highpass2/source/Highpass2Proc.cpp b/plugins/MacVST/Highpass2/source/Highpass2Proc.cpp index adc3ba169..e5f6a8066 100755 --- a/plugins/MacVST/Highpass2/source/Highpass2Proc.cpp +++ b/plugins/MacVST/Highpass2/source/Highpass2Proc.cpp @@ -38,8 +38,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -208,8 +208,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -247,8 +247,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/MacVST/Holt/source/Holt.h b/plugins/MacVST/Holt/source/Holt.h index bf14fca9d..d9d61e929 100755 --- a/plugins/MacVST/Holt/source/Holt.h +++ b/plugins/MacVST/Holt/source/Holt.h @@ -59,23 +59,23 @@ private: uint32_t fpd; //default stuff - long double previousSampleAL; - long double previousTrendAL; - long double previousSampleBL; - long double previousTrendBL; - long double previousSampleCL; - long double previousTrendCL; - long double previousSampleDL; - long double previousTrendDL; + double previousSampleAL; + double previousTrendAL; + double previousSampleBL; + double previousTrendBL; + double previousSampleCL; + double previousTrendCL; + double previousSampleDL; + double previousTrendDL; - long double previousSampleAR; - long double previousTrendAR; - long double previousSampleBR; - long double previousTrendBR; - long double previousSampleCR; - long double previousTrendCR; - long double previousSampleDR; - long double previousTrendDR; + double previousSampleAR; + double previousTrendAR; + double previousSampleBR; + double previousTrendBR; + double previousSampleCR; + double previousTrendCR; + double previousSampleDR; + double previousTrendDR; float A; diff --git a/plugins/MacVST/Holt/source/HoltProc.cpp b/plugins/MacVST/Holt/source/HoltProc.cpp index efe13495a..ca90811ad 100755 --- a/plugins/MacVST/Holt/source/HoltProc.cpp +++ b/plugins/MacVST/Holt/source/HoltProc.cpp @@ -20,8 +20,8 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -42,14 +42,14 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); @@ -157,8 +157,8 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -179,14 +179,14 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); diff --git a/plugins/MacVST/Hombre/source/Hombre.cpp b/plugins/MacVST/Hombre/source/Hombre.cpp index 8b03ed124..ebf3e4b36 100755 --- a/plugins/MacVST/Hombre/source/Hombre.cpp +++ b/plugins/MacVST/Hombre/source/Hombre.cpp @@ -17,8 +17,8 @@ Hombre::Hombre(audioMasterCallback audioMaster) : for(int count = 0; count < 4000; count++) {pL[count] = 0.0; pR[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Hombre/source/Hombre.h b/plugins/MacVST/Hombre/source/Hombre.h index e23f6f323..af14c14ed 100755 --- a/plugins/MacVST/Hombre/source/Hombre.h +++ b/plugins/MacVST/Hombre/source/Hombre.h @@ -58,8 +58,8 @@ private: double slide; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Hombre/source/HombreProc.cpp b/plugins/MacVST/Hombre/source/HombreProc.cpp index 16bf51377..5a24dde58 100755 --- a/plugins/MacVST/Hombre/source/HombreProc.cpp +++ b/plugins/MacVST/Hombre/source/HombreProc.cpp @@ -29,8 +29,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -38,44 +38,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -131,14 +95,14 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -172,8 +136,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -181,44 +145,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -274,16 +202,14 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Hull/source/Hull.h b/plugins/MacVST/Hull/source/Hull.h index bee68e58b..1d9df9e4d 100755 --- a/plugins/MacVST/Hull/source/Hull.h +++ b/plugins/MacVST/Hull/source/Hull.h @@ -53,11 +53,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bL[4005]; - long double bR[4005]; + double bL[4005]; + double bR[4005]; int bPointer; - long double cL[105]; - long double cR[105]; + double cL[105]; + double cR[105]; int cPointer; uint32_t fpdL; diff --git a/plugins/MacVST/Hull/source/HullProc.cpp b/plugins/MacVST/Hull/source/HullProc.cpp index ed19ddc25..4cdbe2d03 100755 --- a/plugins/MacVST/Hull/source/HullProc.cpp +++ b/plugins/MacVST/Hull/source/HullProc.cpp @@ -21,31 +21,31 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -69,8 +69,8 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -120,31 +120,31 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -168,8 +168,8 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -187,12 +187,12 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/HypersonX/source/HypersonXProc.cpp b/plugins/MacVST/HypersonX/source/HypersonXProc.cpp index 43ed3ec33..bd88aeefa 100755 --- a/plugins/MacVST/HypersonX/source/HypersonXProc.cpp +++ b/plugins/MacVST/HypersonX/source/HypersonXProc.cpp @@ -149,7 +149,7 @@ void HypersonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Hypersonic/source/HypersonicProc.cpp b/plugins/MacVST/Hypersonic/source/HypersonicProc.cpp index 7e914e796..d3361986c 100755 --- a/plugins/MacVST/Hypersonic/source/HypersonicProc.cpp +++ b/plugins/MacVST/Hypersonic/source/HypersonicProc.cpp @@ -319,7 +319,7 @@ void Hypersonic::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Infinity/source/Infinity.h b/plugins/MacVST/Infinity/source/Infinity.h index e17c3a139..6a3a0b593 100755 --- a/plugins/MacVST/Infinity/source/Infinity.h +++ b/plugins/MacVST/Infinity/source/Infinity.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacVST/Infinity/source/InfinityProc.cpp b/plugins/MacVST/Infinity/source/InfinityProc.cpp index 67dce7467..70c57ee1b 100755 --- a/plugins/MacVST/Infinity/source/InfinityProc.cpp +++ b/plugins/MacVST/Infinity/source/InfinityProc.cpp @@ -65,19 +65,19 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -88,15 +88,15 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -350,19 +350,19 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -373,15 +373,15 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -559,12 +559,12 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Infinity2/source/Infinity2.h b/plugins/MacVST/Infinity2/source/Infinity2.h index 2304eb777..60c0f9004 100755 --- a/plugins/MacVST/Infinity2/source/Infinity2.h +++ b/plugins/MacVST/Infinity2/source/Infinity2.h @@ -57,9 +57,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacVST/Infinity2/source/Infinity2Proc.cpp b/plugins/MacVST/Infinity2/source/Infinity2Proc.cpp index 81b745fab..cf8e5f6f8 100755 --- a/plugins/MacVST/Infinity2/source/Infinity2Proc.cpp +++ b/plugins/MacVST/Infinity2/source/Infinity2Proc.cpp @@ -65,32 +65,32 @@ void Infinity2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -366,32 +366,32 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -591,12 +591,12 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Infrasonic/source/Infrasonic.h b/plugins/MacVST/Infrasonic/source/Infrasonic.h index 940f13fc4..ef33b30ed 100755 --- a/plugins/MacVST/Infrasonic/source/Infrasonic.h +++ b/plugins/MacVST/Infrasonic/source/Infrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Infrasonic/source/InfrasonicProc.cpp b/plugins/MacVST/Infrasonic/source/InfrasonicProc.cpp index 0ebfbc7d0..135fd5e33 100755 --- a/plugins/MacVST/Infrasonic/source/InfrasonicProc.cpp +++ b/plugins/MacVST/Infrasonic/source/InfrasonicProc.cpp @@ -63,12 +63,12 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacVST/Interstage/source/Interstage.h b/plugins/MacVST/Interstage/source/Interstage.h index 146b84c0a..bb23c5c57 100755 --- a/plugins/MacVST/Interstage/source/Interstage.h +++ b/plugins/MacVST/Interstage/source/Interstage.h @@ -57,14 +57,14 @@ private: double iirSampleDL; double iirSampleEL; double iirSampleFL; - long double lastSampleL; + double lastSampleL; double iirSampleAR; double iirSampleBR; double iirSampleCR; double iirSampleDR; double iirSampleER; double iirSampleFR; - long double lastSampleR; + double lastSampleR; uint32_t fpd; bool flip; }; diff --git a/plugins/MacVST/Interstage/source/InterstageProc.cpp b/plugins/MacVST/Interstage/source/InterstageProc.cpp index df5bb385c..181983f57 100755 --- a/plugins/MacVST/Interstage/source/InterstageProc.cpp +++ b/plugins/MacVST/Interstage/source/InterstageProc.cpp @@ -24,12 +24,12 @@ void Interstage::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average @@ -111,12 +111,12 @@ void Interstage::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average diff --git a/plugins/MacVST/IronOxide5/source/IronOxide5.cpp b/plugins/MacVST/IronOxide5/source/IronOxide5.cpp index 914f53b5c..9d720380d 100755 --- a/plugins/MacVST/IronOxide5/source/IronOxide5.cpp +++ b/plugins/MacVST/IronOxide5/source/IronOxide5.cpp @@ -45,8 +45,8 @@ IronOxide5::IronOxide5(audioMasterCallback audioMaster) : rateof = 0.5; nextmax = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/IronOxide5/source/IronOxide5.h b/plugins/MacVST/IronOxide5/source/IronOxide5.h index 82d4c9ae3..8e1173796 100755 --- a/plugins/MacVST/IronOxide5/source/IronOxide5.h +++ b/plugins/MacVST/IronOxide5/source/IronOxide5.h @@ -101,8 +101,8 @@ private: double nextmax; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/IronOxide5/source/IronOxide5Proc.cpp b/plugins/MacVST/IronOxide5/source/IronOxide5Proc.cpp index e42d69f49..a79d2d315 100755 --- a/plugins/MacVST/IronOxide5/source/IronOxide5Proc.cpp +++ b/plugins/MacVST/IronOxide5/source/IronOxide5Proc.cpp @@ -62,8 +62,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -71,44 +71,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -419,14 +383,14 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp } //end invdrywet block with outputgain - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -493,8 +457,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -502,44 +466,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -850,16 +778,14 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn } //end invdrywet block with outputgain - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.cpp b/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.cpp index 8ce7103db..a52227101 100755 --- a/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.cpp +++ b/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.cpp @@ -23,8 +23,8 @@ IronOxideClassic::IronOxideClassic(audioMasterCallback audioMaster) : fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; iirSampleAR = iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.h b/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.h index bafb457f3..118b6fd9d 100755 --- a/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.h +++ b/plugins/MacVST/IronOxideClassic/source/IronOxideClassic.h @@ -72,8 +72,8 @@ private: int gcount; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/IronOxideClassic/source/IronOxideClassicProc.cpp b/plugins/MacVST/IronOxideClassic/source/IronOxideClassicProc.cpp index 97bbacae1..8f7d52f98 100755 --- a/plugins/MacVST/IronOxideClassic/source/IronOxideClassicProc.cpp +++ b/plugins/MacVST/IronOxideClassic/source/IronOxideClassicProc.cpp @@ -41,51 +41,15 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -342,14 +306,14 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,51 +359,15 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -696,16 +624,14 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2.h b/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2.h index 6d0a6b3ae..816678bb0 100755 --- a/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2.h +++ b/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2.h @@ -72,8 +72,8 @@ private: double slowIIRBR; double lastRefR[7]; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; int cycle; int gcount; diff --git a/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp b/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp index 1b4d68ec4..cbd05ac5f 100755 --- a/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp +++ b/plugins/MacVST/IronOxideClassic2/source/IronOxideClassic2Proc.cpp @@ -67,11 +67,11 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -107,14 +107,14 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -129,7 +129,7 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -479,11 +479,11 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -519,14 +519,14 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -541,7 +541,7 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -813,12 +813,12 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs flip = !flip; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Isolator/source/Isolator.h b/plugins/MacVST/Isolator/source/Isolator.h index 36bb24290..c353897e0 100755 --- a/plugins/MacVST/Isolator/source/Isolator.h +++ b/plugins/MacVST/Isolator/source/Isolator.h @@ -54,9 +54,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Isolator/source/IsolatorProc.cpp b/plugins/MacVST/Isolator/source/IsolatorProc.cpp index ec083b419..ca777d947 100755 --- a/plugins/MacVST/Isolator/source/IsolatorProc.cpp +++ b/plugins/MacVST/Isolator/source/IsolatorProc.cpp @@ -62,18 +62,18 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -82,7 +82,7 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -182,18 +182,18 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -202,7 +202,7 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacVST/Logical4/source/Logical4.cpp b/plugins/MacVST/Logical4/source/Logical4.cpp index 15d185bea..72da4ad93 100755 --- a/plugins/MacVST/Logical4/source/Logical4.cpp +++ b/plugins/MacVST/Logical4/source/Logical4.cpp @@ -78,8 +78,8 @@ Logical4::Logical4(audioMasterCallback audioMaster) : gcount = 0; //end Power Sags fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Logical4/source/Logical4Proc.cpp b/plugins/MacVST/Logical4/source/Logical4Proc.cpp index 5d079f36b..df5c110f4 100755 --- a/plugins/MacVST/Logical4/source/Logical4Proc.cpp +++ b/plugins/MacVST/Logical4/source/Logical4Proc.cpp @@ -17,8 +17,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -119,44 +119,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -871,14 +835,14 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -900,8 +864,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -1001,44 +965,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1752,16 +1680,14 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Loud/source/LoudProc.cpp b/plugins/MacVST/Loud/source/LoudProc.cpp index 85d98996d..906f51dbd 100755 --- a/plugins/MacVST/Loud/source/LoudProc.cpp +++ b/plugins/MacVST/Loud/source/LoudProc.cpp @@ -21,8 +21,8 @@ void Loud::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; @@ -138,8 +138,8 @@ void Loud::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; diff --git a/plugins/MacVST/Lowpass/source/Lowpass.cpp b/plugins/MacVST/Lowpass/source/Lowpass.cpp index 18064fcae..9b6a6f4eb 100755 --- a/plugins/MacVST/Lowpass/source/Lowpass.cpp +++ b/plugins/MacVST/Lowpass/source/Lowpass.cpp @@ -19,8 +19,8 @@ Lowpass::Lowpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/Lowpass/source/Lowpass.h b/plugins/MacVST/Lowpass/source/Lowpass.h index 40ac45681..f9d4ec8c7 100755 --- a/plugins/MacVST/Lowpass/source/Lowpass.h +++ b/plugins/MacVST/Lowpass/source/Lowpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Lowpass/source/LowpassProc.cpp b/plugins/MacVST/Lowpass/source/LowpassProc.cpp index bcc369049..ea450b239 100755 --- a/plugins/MacVST/Lowpass/source/LowpassProc.cpp +++ b/plugins/MacVST/Lowpass/source/LowpassProc.cpp @@ -41,44 +41,8 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -120,14 +84,14 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -173,44 +137,8 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -252,16 +180,14 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/MacVST/Lowpass2/source/Lowpass2Proc.cpp b/plugins/MacVST/Lowpass2/source/Lowpass2Proc.cpp index e46b16e75..1dd3af06f 100755 --- a/plugins/MacVST/Lowpass2/source/Lowpass2Proc.cpp +++ b/plugins/MacVST/Lowpass2/source/Lowpass2Proc.cpp @@ -38,8 +38,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -209,8 +209,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -248,8 +248,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/MacVST/Luxor/source/LuxorProc.cpp b/plugins/MacVST/Luxor/source/LuxorProc.cpp index 086b1741e..c8d0add39 100755 --- a/plugins/MacVST/Luxor/source/LuxorProc.cpp +++ b/plugins/MacVST/Luxor/source/LuxorProc.cpp @@ -37,8 +37,8 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/MV/source/MVProc.cpp b/plugins/MacVST/MV/source/MVProc.cpp index 00082b487..11da2fce9 100755 --- a/plugins/MacVST/MV/source/MVProc.cpp +++ b/plugins/MacVST/MV/source/MVProc.cpp @@ -31,8 +31,8 @@ void MV::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -827,8 +827,8 @@ void MV::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; diff --git a/plugins/MacVST/MackEQ/source/MackEQ.h b/plugins/MacVST/MackEQ/source/MackEQ.h index 9447e67f3..d413503b3 100755 --- a/plugins/MacVST/MackEQ/source/MackEQ.h +++ b/plugins/MacVST/MackEQ/source/MackEQ.h @@ -56,22 +56,22 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleCL; - long double iirSampleDL; - long double iirSampleEL; - long double iirSampleFL; - long double iirSampleAR; - long double iirSampleBR; - long double iirSampleCR; - long double iirSampleDR; - long double iirSampleER; - long double iirSampleFR; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/MackEQ/source/MackEQProc.cpp b/plugins/MacVST/MackEQ/source/MackEQProc.cpp index 6713aed49..00466fda1 100755 --- a/plugins/MacVST/MackEQ/source/MackEQProc.cpp +++ b/plugins/MacVST/MackEQ/source/MackEQProc.cpp @@ -73,12 +73,12 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -90,10 +90,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -123,10 +123,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -149,11 +149,11 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -294,12 +294,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -311,10 +311,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -344,10 +344,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -370,11 +370,11 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -431,12 +431,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Mackity/source/Mackity.h b/plugins/MacVST/Mackity/source/Mackity.h index f6ecb608a..338df8de9 100755 --- a/plugins/MacVST/Mackity/source/Mackity.h +++ b/plugins/MacVST/Mackity/source/Mackity.h @@ -54,12 +54,12 @@ private: std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; - long double biquadA[15]; - long double biquadB[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Mackity/source/MackityProc.cpp b/plugins/MacVST/Mackity/source/MackityProc.cpp index 97a9b7fb6..ff7c1631a 100755 --- a/plugins/MacVST/Mackity/source/MackityProc.cpp +++ b/plugins/MacVST/Mackity/source/MackityProc.cpp @@ -47,10 +47,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -61,10 +61,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -148,10 +148,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -162,10 +162,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -191,12 +191,12 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (outPad != 1.0) {inputSampleL *= outPad; inputSampleR *= outPad;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/MatrixVerb/source/MatrixVerb.h b/plugins/MacVST/MatrixVerb/source/MatrixVerb.h index 3b2c0a62b..3f3b8298c 100755 --- a/plugins/MacVST/MatrixVerb/source/MatrixVerb.h +++ b/plugins/MacVST/MatrixVerb/source/MatrixVerb.h @@ -58,9 +58,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacVST/MatrixVerb/source/MatrixVerbProc.cpp b/plugins/MacVST/MatrixVerb/source/MatrixVerbProc.cpp index 15ee2871e..4099a1853 100755 --- a/plugins/MacVST/MatrixVerb/source/MatrixVerbProc.cpp +++ b/plugins/MacVST/MatrixVerb/source/MatrixVerbProc.cpp @@ -77,12 +77,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -91,12 +91,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -108,15 +108,15 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -470,12 +470,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -484,12 +484,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -501,15 +501,15 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -775,12 +775,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Melt/source/Melt.cpp b/plugins/MacVST/Melt/source/Melt.cpp index 35ede1e0d..b2f8301bc 100755 --- a/plugins/MacVST/Melt/source/Melt.cpp +++ b/plugins/MacVST/Melt/source/Melt.cpp @@ -26,8 +26,8 @@ Melt::Melt(audioMasterCallback audioMaster) : slowCount = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Melt/source/Melt.h b/plugins/MacVST/Melt/source/Melt.h index af11f0fc5..07cf0075c 100755 --- a/plugins/MacVST/Melt/source/Melt.h +++ b/plugins/MacVST/Melt/source/Melt.h @@ -70,8 +70,8 @@ private: int slowCount; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Melt/source/MeltProc.cpp b/plugins/MacVST/Melt/source/MeltProc.cpp index 8a55732df..c990386b6 100755 --- a/plugins/MacVST/Melt/source/MeltProc.cpp +++ b/plugins/MacVST/Melt/source/MeltProc.cpp @@ -22,10 +22,10 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -63,44 +63,8 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -268,14 +232,14 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -302,10 +266,10 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -343,44 +307,8 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -548,16 +476,14 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/MidSide/source/MidSide.cpp b/plugins/MacVST/MidSide/source/MidSide.cpp index 8f61cffda..4bb31183d 100755 --- a/plugins/MacVST/MidSide/source/MidSide.cpp +++ b/plugins/MacVST/MidSide/source/MidSide.cpp @@ -13,8 +13,8 @@ MidSide::MidSide(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/MidSide/source/MidSide.h b/plugins/MacVST/MidSide/source/MidSide.h index 4d139c874..086fbea98 100755 --- a/plugins/MacVST/MidSide/source/MidSide.h +++ b/plugins/MacVST/MidSide/source/MidSide.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/MidSide/source/MidSideProc.cpp b/plugins/MacVST/MidSide/source/MidSideProc.cpp index cca7a5cda..46fb1397e 100755 --- a/plugins/MacVST/MidSide/source/MidSideProc.cpp +++ b/plugins/MacVST/MidSide/source/MidSideProc.cpp @@ -15,11 +15,11 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -28,44 +28,8 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -75,7 +39,7 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -100,11 +64,11 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -113,44 +77,8 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -160,7 +88,7 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/MacVST/MoNoam/source/MoNoamProc.cpp b/plugins/MacVST/MoNoam/source/MoNoamProc.cpp index 105d34b15..64cc63a99 100755 --- a/plugins/MacVST/MoNoam/source/MoNoamProc.cpp +++ b/plugins/MacVST/MoNoam/source/MoNoamProc.cpp @@ -18,13 +18,13 @@ void MoNoam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; @@ -69,13 +69,13 @@ void MoNoam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/MacVST/Mojo/source/MojoProc.cpp b/plugins/MacVST/Mojo/source/MojoProc.cpp index 60f986d64..6687feea8 100755 --- a/plugins/MacVST/Mojo/source/MojoProc.cpp +++ b/plugins/MacVST/Mojo/source/MojoProc.cpp @@ -18,8 +18,8 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); @@ -65,8 +65,8 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); diff --git a/plugins/MacVST/Monitoring/source/Monitoring.h b/plugins/MacVST/Monitoring/source/Monitoring.h index f92a46b42..8dd0210fc 100755 --- a/plugins/MacVST/Monitoring/source/Monitoring.h +++ b/plugins/MacVST/Monitoring/source/Monitoring.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD double aL[1503], bL[1503], cL[1503], dL[1503]; double aR[1503], bR[1503], cR[1503], dR[1503]; @@ -73,8 +73,8 @@ private: double iirSampleTR, iirSampleUR, iirSampleVR; double iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquadL[11]; - long double biquadR[11]; + double biquadL[11]; + double biquadR[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/MacVST/Monitoring/source/MonitoringProc.cpp b/plugins/MacVST/Monitoring/source/MonitoringProc.cpp index ddb1f6f98..397d31b12 100755 --- a/plugins/MacVST/Monitoring/source/MonitoringProc.cpp +++ b/plugins/MacVST/Monitoring/source/MonitoringProc.cpp @@ -48,8 +48,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -116,7 +116,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -289,8 +289,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -305,17 +305,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -337,9 +337,9 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -396,7 +396,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -415,17 +415,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -439,7 +439,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -448,7 +448,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -565,8 +565,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -633,7 +633,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -806,8 +806,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -822,17 +822,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -854,9 +854,9 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -913,7 +913,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -932,17 +932,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -956,7 +956,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -965,7 +965,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/MacVST/Monitoring2/source/Monitoring2.h b/plugins/MacVST/Monitoring2/source/Monitoring2.h index 34e9aac76..a1d6c5e4b 100755 --- a/plugins/MacVST/Monitoring2/source/Monitoring2.h +++ b/plugins/MacVST/Monitoring2/source/Monitoring2.h @@ -87,7 +87,7 @@ private: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/MacVST/Monitoring2/source/Monitoring2Proc.cpp b/plugins/MacVST/Monitoring2/source/Monitoring2Proc.cpp index d9af88b6a..82325d164 100755 --- a/plugins/MacVST/Monitoring2/source/Monitoring2Proc.cpp +++ b/plugins/MacVST/Monitoring2/source/Monitoring2Proc.cpp @@ -42,8 +42,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -113,7 +113,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -286,8 +286,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -302,17 +302,17 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -334,9 +334,9 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -393,7 +393,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -525,8 +525,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -596,7 +596,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -769,8 +769,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -785,17 +785,17 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -817,9 +817,9 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -876,7 +876,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/MacVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp b/plugins/MacVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp index c2e097a11..0336c96dc 100755 --- a/plugins/MacVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp +++ b/plugins/MacVST/MultiBandDistortion/source/MultiBandDistortionProc.cpp @@ -51,10 +51,10 @@ void MultiBandDistortion::processReplacing(float **inputs, float **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -296,10 +296,10 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -479,12 +479,12 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu inputSampleR *= outputGlobal; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp b/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp index 409f98398..a0a9a061d 100755 --- a/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp +++ b/plugins/MacVST/NCSeventeen/source/NCSeventeen.cpp @@ -31,8 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/NCSeventeen/source/NCSeventeen.h b/plugins/MacVST/NCSeventeen/source/NCSeventeen.h index b3ecd9486..100f02bdb 100755 --- a/plugins/MacVST/NCSeventeen/source/NCSeventeen.h +++ b/plugins/MacVST/NCSeventeen/source/NCSeventeen.h @@ -70,8 +70,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp b/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp index e124cb5ff..aebc1ba49 100755 --- a/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp +++ b/plugins/MacVST/NCSeventeen/source/NCSeventeenProc.cpp @@ -39,13 +39,13 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -59,44 +59,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -344,14 +308,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,13 +359,13 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -414,44 +378,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -699,16 +627,14 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp b/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp index e0b2d86d0..ffc731e21 100755 --- a/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp +++ b/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp @@ -14,8 +14,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -27,44 +27,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -248,8 +212,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -261,44 +225,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacVST/Neverland/source/NeverlandProc.cpp b/plugins/MacVST/Neverland/source/NeverlandProc.cpp index de15a19fa..58493f8a3 100755 --- a/plugins/MacVST/Neverland/source/NeverlandProc.cpp +++ b/plugins/MacVST/Neverland/source/NeverlandProc.cpp @@ -37,8 +37,8 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -214,8 +214,8 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; inputSampleL *= indrive; diff --git a/plugins/MacVST/Nikola/source/NikolaProc.cpp b/plugins/MacVST/Nikola/source/NikolaProc.cpp index 1b439c6e8..59738686d 100755 --- a/plugins/MacVST/Nikola/source/NikolaProc.cpp +++ b/plugins/MacVST/Nikola/source/NikolaProc.cpp @@ -20,12 +20,12 @@ void Nikola::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; @@ -1040,12 +1040,12 @@ void Nikola::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; else outlevelL = ((outlevelL * decay) + bridgerectifier) / (decay+1.0); diff --git a/plugins/MacVST/NodeDither/source/NodeDitherProc.cpp b/plugins/MacVST/NodeDither/source/NodeDitherProc.cpp index 3d6046485..50f3e85f9 100755 --- a/plugins/MacVST/NodeDither/source/NodeDitherProc.cpp +++ b/plugins/MacVST/NodeDither/source/NodeDitherProc.cpp @@ -25,8 +25,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -34,44 +34,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -135,8 +99,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -144,44 +108,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/MacVST/Noise/source/Noise.cpp b/plugins/MacVST/Noise/source/Noise.cpp index d955a290a..ebb384dbe 100755 --- a/plugins/MacVST/Noise/source/Noise.cpp +++ b/plugins/MacVST/Noise/source/Noise.cpp @@ -36,8 +36,8 @@ Noise::Noise(audioMasterCallback audioMaster) : flipR = false; filterflip = false; for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Noise/source/Noise.h b/plugins/MacVST/Noise/source/Noise.h index 67c32bcf5..d14ef6305 100755 --- a/plugins/MacVST/Noise/source/Noise.h +++ b/plugins/MacVST/Noise/source/Noise.h @@ -81,8 +81,8 @@ private: double f[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Noise/source/NoiseProc.cpp b/plugins/MacVST/Noise/source/NoiseProc.cpp index 31cba201a..0f75966cc 100755 --- a/plugins/MacVST/Noise/source/NoiseProc.cpp +++ b/plugins/MacVST/Noise/source/NoiseProc.cpp @@ -22,8 +22,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -111,44 +111,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -296,14 +260,14 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -330,8 +294,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -417,44 +381,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -602,16 +530,14 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.cpp b/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.cpp index eb05bc33a..48eac47c8 100755 --- a/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.cpp +++ b/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.cpp @@ -195,8 +195,8 @@ NonlinearSpace::NonlinearSpace(audioMasterCallback audioMaster) : countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.h b/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.h index dbaa0b3a4..b75c7a51d 100755 --- a/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.h +++ b/plugins/MacVST/NonlinearSpace/source/NonlinearSpace.h @@ -208,8 +208,8 @@ private: double nonlin; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/NonlinearSpace/source/NonlinearSpaceProc.cpp b/plugins/MacVST/NonlinearSpace/source/NonlinearSpaceProc.cpp index f9df9fcc2..c7efecbc4 100755 --- a/plugins/MacVST/NonlinearSpace/source/NonlinearSpaceProc.cpp +++ b/plugins/MacVST/NonlinearSpace/source/NonlinearSpaceProc.cpp @@ -17,10 +17,10 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -99,44 +99,8 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -743,14 +707,14 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; @@ -773,10 +737,10 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -855,44 +819,8 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1499,16 +1427,14 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; diff --git a/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCD.h b/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCD.h index 39f785e9e..d27f0cc5c 100755 --- a/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCD.h +++ b/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCD.h @@ -53,8 +53,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; }; diff --git a/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp b/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp index af4320013..f129dda8f 100755 --- a/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp +++ b/plugins/MacVST/NotJustAnotherCD/source/NotJustAnotherCDProc.cpp @@ -14,8 +14,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -29,44 +29,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -263,8 +227,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -278,44 +242,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; diff --git a/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDither.h b/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDither.h index 5ca0c0a85..184a9269e 100755 --- a/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDither.h +++ b/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDither.h @@ -55,8 +55,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp b/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp index 1a8071115..7e38de75c 100755 --- a/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp +++ b/plugins/MacVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp @@ -29,8 +29,8 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -43,18 +43,18 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -70,7 +70,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -81,7 +81,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -183,8 +183,8 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -197,18 +197,18 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -224,7 +224,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -235,7 +235,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleL; + double outputSampleL; if (totalA < totalB) {bynL[hotbinA] += 1; outputSampleL = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSampleL = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -282,7 +282,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleR; + double outputSampleR; if (totalA < totalB) {bynR[hotbinA] += 1; outputSampleR = floor(inputSampleR);} else {bynR[hotbinB] += 1; outputSampleR = floor(inputSampleR+1);} //assign the relevant one to the delay line diff --git a/plugins/MacVST/OneCornerClip/source/OneCornerClip.cpp b/plugins/MacVST/OneCornerClip/source/OneCornerClip.cpp index 59e28246f..ea15e1fe2 100755 --- a/plugins/MacVST/OneCornerClip/source/OneCornerClip.cpp +++ b/plugins/MacVST/OneCornerClip/source/OneCornerClip.cpp @@ -25,8 +25,8 @@ OneCornerClip::OneCornerClip(audioMasterCallback audioMaster) : limitPosR = 0.0; limitNegR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/OneCornerClip/source/OneCornerClip.h b/plugins/MacVST/OneCornerClip/source/OneCornerClip.h index 4f039fa00..a69f185b2 100755 --- a/plugins/MacVST/OneCornerClip/source/OneCornerClip.h +++ b/plugins/MacVST/OneCornerClip/source/OneCornerClip.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/MacVST/OneCornerClip/source/OneCornerClipProc.cpp b/plugins/MacVST/OneCornerClip/source/OneCornerClipProc.cpp index c45c69b91..194cab890 100755 --- a/plugins/MacVST/OneCornerClip/source/OneCornerClipProc.cpp +++ b/plugins/MacVST/OneCornerClip/source/OneCornerClipProc.cpp @@ -41,51 +41,15 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -154,14 +118,14 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither if (clipEngage == false) { @@ -214,52 +178,16 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -328,16 +256,14 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither if (clipEngage == false) { diff --git a/plugins/MacVST/PDBuss/source/PDBuss.cpp b/plugins/MacVST/PDBuss/source/PDBuss.cpp index 8b31d8b58..60bdec0bd 100755 --- a/plugins/MacVST/PDBuss/source/PDBuss.cpp +++ b/plugins/MacVST/PDBuss/source/PDBuss.cpp @@ -21,8 +21,8 @@ PDBuss::PDBuss(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PDBuss/source/PDBuss.h b/plugins/MacVST/PDBuss/source/PDBuss.h index 3e6d9b8da..0b962dcfb 100755 --- a/plugins/MacVST/PDBuss/source/PDBuss.h +++ b/plugins/MacVST/PDBuss/source/PDBuss.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacVST/PDBuss/source/PDBussProc.cpp b/plugins/MacVST/PDBuss/source/PDBussProc.cpp index 6da8fa0c4..00b05af39 100755 --- a/plugins/MacVST/PDBuss/source/PDBussProc.cpp +++ b/plugins/MacVST/PDBuss/source/PDBussProc.cpp @@ -21,8 +21,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -152,8 +116,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -166,44 +130,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -250,16 +178,14 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PDChannel/source/PDChannel.cpp b/plugins/MacVST/PDChannel/source/PDChannel.cpp index aef639d5e..6cf15db30 100755 --- a/plugins/MacVST/PDChannel/source/PDChannel.cpp +++ b/plugins/MacVST/PDChannel/source/PDChannel.cpp @@ -21,8 +21,8 @@ PDChannel::PDChannel(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PDChannel/source/PDChannel.h b/plugins/MacVST/PDChannel/source/PDChannel.h index ea233e26b..cd7c14fb7 100755 --- a/plugins/MacVST/PDChannel/source/PDChannel.h +++ b/plugins/MacVST/PDChannel/source/PDChannel.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacVST/PDChannel/source/PDChannelProc.cpp b/plugins/MacVST/PDChannel/source/PDChannelProc.cpp index fb5932de6..2277acc7d 100755 --- a/plugins/MacVST/PDChannel/source/PDChannelProc.cpp +++ b/plugins/MacVST/PDChannel/source/PDChannelProc.cpp @@ -21,8 +21,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -112,14 +76,14 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -145,8 +109,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -159,44 +123,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -236,16 +164,14 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Pafnuty/source/Pafnuty.cpp b/plugins/MacVST/Pafnuty/source/Pafnuty.cpp index 8c6f42d09..14eb30129 100755 --- a/plugins/MacVST/Pafnuty/source/Pafnuty.cpp +++ b/plugins/MacVST/Pafnuty/source/Pafnuty.cpp @@ -25,8 +25,8 @@ Pafnuty::Pafnuty(audioMasterCallback audioMaster) : K = 0.5; L = 0.5; M = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Pafnuty/source/Pafnuty.h b/plugins/MacVST/Pafnuty/source/Pafnuty.h index 3a832b773..80eba3e36 100755 --- a/plugins/MacVST/Pafnuty/source/Pafnuty.h +++ b/plugins/MacVST/Pafnuty/source/Pafnuty.h @@ -64,8 +64,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Pafnuty/source/PafnutyProc.cpp b/plugins/MacVST/Pafnuty/source/PafnutyProc.cpp index 710bcdc8f..79d2326a1 100755 --- a/plugins/MacVST/Pafnuty/source/PafnutyProc.cpp +++ b/plugins/MacVST/Pafnuty/source/PafnutyProc.cpp @@ -14,52 +14,52 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out1 = outputs[0]; float* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,14 +258,14 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -284,52 +284,52 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -528,16 +528,14 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PaulDither/source/PaulDitherProc.cpp b/plugins/MacVST/PaulDither/source/PaulDitherProc.cpp index 759c49820..476bfd332 100755 --- a/plugins/MacVST/PaulDither/source/PaulDitherProc.cpp +++ b/plugins/MacVST/PaulDither/source/PaulDitherProc.cpp @@ -31,8 +31,8 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -103,8 +103,8 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/PaulWide/source/PaulWideProc.cpp b/plugins/MacVST/PaulWide/source/PaulWideProc.cpp index c8ba4a921..13cd58f79 100755 --- a/plugins/MacVST/PaulWide/source/PaulWideProc.cpp +++ b/plugins/MacVST/PaulWide/source/PaulWideProc.cpp @@ -28,8 +28,8 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -46,14 +46,14 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises @@ -116,8 +116,8 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -134,14 +134,14 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/MacVST/PeaksOnly/source/PeaksOnlyProc.cpp b/plugins/MacVST/PeaksOnly/source/PeaksOnlyProc.cpp index 89aa62f35..39a49e8c1 100755 --- a/plugins/MacVST/PeaksOnly/source/PeaksOnlyProc.cpp +++ b/plugins/MacVST/PeaksOnly/source/PeaksOnlyProc.cpp @@ -26,8 +26,8 @@ void PeaksOnly::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -165,8 +165,8 @@ void PeaksOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/PhaseNudge/source/PhaseNudge.cpp b/plugins/MacVST/PhaseNudge/source/PhaseNudge.cpp index e9e5c8d6d..7c200bd4d 100755 --- a/plugins/MacVST/PhaseNudge/source/PhaseNudge.cpp +++ b/plugins/MacVST/PhaseNudge/source/PhaseNudge.cpp @@ -16,8 +16,8 @@ PhaseNudge::PhaseNudge(audioMasterCallback audioMaster) : B = 1.0; for(int count = 0; count < 1502; count++) {dL[count] = 0.0; dR[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PhaseNudge/source/PhaseNudge.h b/plugins/MacVST/PhaseNudge/source/PhaseNudge.h index 2926ccbea..a2f0dedbc 100755 --- a/plugins/MacVST/PhaseNudge/source/PhaseNudge.h +++ b/plugins/MacVST/PhaseNudge/source/PhaseNudge.h @@ -57,8 +57,8 @@ private: double dR[1503]; int one, maxdelay; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/PhaseNudge/source/PhaseNudgeProc.cpp b/plugins/MacVST/PhaseNudge/source/PhaseNudgeProc.cpp index 150ecd567..449d1f224 100755 --- a/plugins/MacVST/PhaseNudge/source/PhaseNudgeProc.cpp +++ b/plugins/MacVST/PhaseNudge/source/PhaseNudgeProc.cpp @@ -23,53 +23,17 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,53 +132,17 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PitchDelay/source/PitchDelay.h b/plugins/MacVST/PitchDelay/source/PitchDelay.h index b5c0fc1b2..2c6f52ffc 100755 --- a/plugins/MacVST/PitchDelay/source/PitchDelay.h +++ b/plugins/MacVST/PitchDelay/source/PitchDelay.h @@ -63,8 +63,8 @@ private: double regenSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; @@ -72,8 +72,8 @@ private: double regenSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/MacVST/PitchDelay/source/PitchDelayProc.cpp b/plugins/MacVST/PitchDelay/source/PitchDelayProc.cpp index 4dcdcbafe..be0bb419f 100755 --- a/plugins/MacVST/PitchDelay/source/PitchDelayProc.cpp +++ b/plugins/MacVST/PitchDelay/source/PitchDelayProc.cpp @@ -64,12 +64,12 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -294,12 +294,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -309,7 +309,7 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -449,12 +449,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/PocketVerbs/source/PocketVerbsProc.cpp b/plugins/MacVST/PocketVerbs/source/PocketVerbsProc.cpp index 4ea8f5120..c6ab00834 100755 --- a/plugins/MacVST/PocketVerbs/source/PocketVerbsProc.cpp +++ b/plugins/MacVST/PocketVerbs/source/PocketVerbsProc.cpp @@ -469,14 +469,14 @@ void PocketVerbs::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); @@ -9645,14 +9645,14 @@ void PocketVerbs::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); diff --git a/plugins/MacVST/Podcast/source/PodcastProc.cpp b/plugins/MacVST/Podcast/source/PodcastProc.cpp index e8fd9949a..4a4c4fdd6 100755 --- a/plugins/MacVST/Podcast/source/PodcastProc.cpp +++ b/plugins/MacVST/Podcast/source/PodcastProc.cpp @@ -30,12 +30,12 @@ void Podcast::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; @@ -189,12 +189,12 @@ void Podcast::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; diff --git a/plugins/MacVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp b/plugins/MacVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp index 5349f2eb0..eafe49669 100755 --- a/plugins/MacVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp +++ b/plugins/MacVST/PodcastDeluxe/source/PodcastDeluxeProc.cpp @@ -45,8 +45,8 @@ void PodcastDeluxe::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -371,8 +371,8 @@ void PodcastDeluxe::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Point/source/Point.cpp b/plugins/MacVST/Point/source/Point.cpp index f79547099..636dec5f7 100755 --- a/plugins/MacVST/Point/source/Point.cpp +++ b/plugins/MacVST/Point/source/Point.cpp @@ -24,8 +24,8 @@ Point::Point(audioMasterCallback audioMaster) : nibBR = 0.0; nobBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/Point/source/Point.h b/plugins/MacVST/Point/source/Point.h index ff898cb39..046c81f6b 100755 --- a/plugins/MacVST/Point/source/Point.h +++ b/plugins/MacVST/Point/source/Point.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double nibAL; diff --git a/plugins/MacVST/Point/source/PointProc.cpp b/plugins/MacVST/Point/source/PointProc.cpp index a3bbe3cf2..70173909f 100755 --- a/plugins/MacVST/Point/source/PointProc.cpp +++ b/plugins/MacVST/Point/source/PointProc.cpp @@ -27,51 +27,15 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -127,14 +91,14 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,51 +130,15 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -266,16 +194,14 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Pop/source/Pop.h b/plugins/MacVST/Pop/source/Pop.h index c598dfcaa..9784b4ee5 100755 --- a/plugins/MacVST/Pop/source/Pop.h +++ b/plugins/MacVST/Pop/source/Pop.h @@ -64,12 +64,12 @@ private: double muSpeedBL; double muCoefficientAL; double muCoefficientBL; - long double thickenL; - long double previousL; - long double previous2L; - long double previous3L; - long double previous4L; - long double previous5L; + double thickenL; + double previousL; + double previous2L; + double previous3L; + double previous4L; + double previous5L; double dL[10001]; double muVaryR; @@ -79,12 +79,12 @@ private: double muSpeedBR; double muCoefficientAR; double muCoefficientBR; - long double thickenR; - long double previousR; - long double previous2R; - long double previous3R; - long double previous4R; - long double previous5R; + double thickenR; + double previousR; + double previous2R; + double previous3R; + double previous4R; + double previous5R; double dR[10001]; int delay; diff --git a/plugins/MacVST/Pop/source/PopProc.cpp b/plugins/MacVST/Pop/source/PopProc.cpp index a7174cf46..44e7efd3a 100755 --- a/plugins/MacVST/Pop/source/PopProc.cpp +++ b/plugins/MacVST/Pop/source/PopProc.cpp @@ -34,14 +34,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -51,7 +51,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -66,7 +66,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -195,14 +195,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -211,7 +211,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm @@ -281,14 +281,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -298,7 +298,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -313,7 +313,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -442,14 +442,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -458,7 +458,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/MacVST/PowerSag/source/PowerSag.cpp b/plugins/MacVST/PowerSag/source/PowerSag.cpp index d1d0745bc..12c46489a 100755 --- a/plugins/MacVST/PowerSag/source/PowerSag.cpp +++ b/plugins/MacVST/PowerSag/source/PowerSag.cpp @@ -18,8 +18,8 @@ PowerSag::PowerSag(audioMasterCallback audioMaster) : gcount = 0; A = 0.0; B = 0.3; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PowerSag/source/PowerSag.h b/plugins/MacVST/PowerSag/source/PowerSag.h index 38839b650..106a02c34 100755 --- a/plugins/MacVST/PowerSag/source/PowerSag.h +++ b/plugins/MacVST/PowerSag/source/PowerSag.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double dL[9000]; double dR[9000]; diff --git a/plugins/MacVST/PowerSag/source/PowerSagProc.cpp b/plugins/MacVST/PowerSag/source/PowerSagProc.cpp index de43be625..61c9be8c7 100755 --- a/plugins/MacVST/PowerSag/source/PowerSagProc.cpp +++ b/plugins/MacVST/PowerSag/source/PowerSagProc.cpp @@ -23,51 +23,15 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -120,14 +84,14 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -155,51 +119,15 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -252,16 +180,14 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PowerSag2/source/PowerSag2Proc.cpp b/plugins/MacVST/PowerSag2/source/PowerSag2Proc.cpp index 645d7b259..69e12f697 100755 --- a/plugins/MacVST/PowerSag2/source/PowerSag2Proc.cpp +++ b/plugins/MacVST/PowerSag2/source/PowerSag2Proc.cpp @@ -20,12 +20,12 @@ void PowerSag2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); @@ -89,12 +89,12 @@ void PowerSag2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); diff --git a/plugins/MacVST/Precious/source/PreciousProc.cpp b/plugins/MacVST/Precious/source/PreciousProc.cpp index 01aeef35c..d15680a95 100755 --- a/plugins/MacVST/Precious/source/PreciousProc.cpp +++ b/plugins/MacVST/Precious/source/PreciousProc.cpp @@ -37,8 +37,8 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Preponderant/source/Preponderant.h b/plugins/MacVST/Preponderant/source/Preponderant.h index dd7949024..731430fb8 100755 --- a/plugins/MacVST/Preponderant/source/Preponderant.h +++ b/plugins/MacVST/Preponderant/source/Preponderant.h @@ -56,25 +56,25 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; - long double bassBalanceL; - long double midBalanceL; - long double highBalanceL; - long double bassTrackL; - long double midTrackL; - long double highTrackL; - long double quicknessL; + double bassBalanceL; + double midBalanceL; + double highBalanceL; + double bassTrackL; + double midTrackL; + double highTrackL; + double quicknessL; - long double bassBalanceR; - long double midBalanceR; - long double highBalanceR; - long double bassTrackR; - long double midTrackR; - long double highTrackR; - long double quicknessR; + double bassBalanceR; + double midBalanceR; + double highBalanceR; + double bassTrackR; + double midTrackR; + double highTrackR; + double quicknessR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Preponderant/source/PreponderantProc.cpp b/plugins/MacVST/Preponderant/source/PreponderantProc.cpp index d1956b1a6..9ea118e03 100755 --- a/plugins/MacVST/Preponderant/source/PreponderantProc.cpp +++ b/plugins/MacVST/Preponderant/source/PreponderantProc.cpp @@ -62,43 +62,43 @@ void Preponderant::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -258,43 +258,43 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -381,12 +381,12 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Pressure4/source/Pressure4.cpp b/plugins/MacVST/Pressure4/source/Pressure4.cpp index 10ed5facf..cdfc41d8b 100755 --- a/plugins/MacVST/Pressure4/source/Pressure4.cpp +++ b/plugins/MacVST/Pressure4/source/Pressure4.cpp @@ -16,8 +16,8 @@ Pressure4::Pressure4(audioMasterCallback audioMaster) : B = 0.2; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/MacVST/Pressure4/source/Pressure4.h b/plugins/MacVST/Pressure4/source/Pressure4.h index 6cf344845..1e30c3f88 100755 --- a/plugins/MacVST/Pressure4/source/Pressure4.h +++ b/plugins/MacVST/Pressure4/source/Pressure4.h @@ -62,8 +62,8 @@ private: double muSpeedB; double muCoefficientA; double muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/MacVST/Pressure4/source/Pressure4Proc.cpp b/plugins/MacVST/Pressure4/source/Pressure4Proc.cpp index 7e285df60..2c1445a6b 100755 --- a/plugins/MacVST/Pressure4/source/Pressure4Proc.cpp +++ b/plugins/MacVST/Pressure4/source/Pressure4Proc.cpp @@ -24,7 +24,7 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -44,51 +44,15 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -192,14 +156,14 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; @@ -228,7 +192,7 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -248,52 +212,16 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -397,16 +325,14 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; diff --git a/plugins/MacVST/Pressure5/source/Pressure5.h b/plugins/MacVST/Pressure5/source/Pressure5.h index de0e13480..479d94b12 100755 --- a/plugins/MacVST/Pressure5/source/Pressure5.h +++ b/plugins/MacVST/Pressure5/source/Pressure5.h @@ -82,15 +82,15 @@ private: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/MacVST/Pressure5/source/Pressure5Proc.cpp b/plugins/MacVST/Pressure5/source/Pressure5Proc.cpp index 42d8fe532..41fbf6480 100755 --- a/plugins/MacVST/Pressure5/source/Pressure5Proc.cpp +++ b/plugins/MacVST/Pressure5/source/Pressure5Proc.cpp @@ -49,18 +49,18 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -160,7 +160,7 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -276,18 +276,18 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -387,7 +387,7 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -443,12 +443,12 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt //final clip runs AFTER the Dry/Wet. It serves as a safety clip even if you're not full wet //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/PurestAir/source/PurestAir.h b/plugins/MacVST/PurestAir/source/PurestAir.h index 5b592c3b4..d077af8c5 100755 --- a/plugins/MacVST/PurestAir/source/PurestAir.h +++ b/plugins/MacVST/PurestAir/source/PurestAir.h @@ -56,23 +56,23 @@ private: uint32_t fpd; //default stuff - long double last1SampleL; - long double halfwaySampleL; - long double halfDrySampleL; - long double halfDiffSampleL; - long double diffSampleL; - long double lastSampleL; + double last1SampleL; + double halfwaySampleL; + double halfDrySampleL; + double halfDiffSampleL; + double diffSampleL; + double lastSampleL; double s1L; double s2L; double s3L; double applyL; - long double last1SampleR; - long double halfwaySampleR; - long double halfDrySampleR; - long double halfDiffSampleR; - long double diffSampleR; - long double lastSampleR; + double last1SampleR; + double halfwaySampleR; + double halfDrySampleR; + double halfDiffSampleR; + double diffSampleR; + double lastSampleR; double s1R; double s2R; double s3R; diff --git a/plugins/MacVST/PurestAir/source/PurestAirProc.cpp b/plugins/MacVST/PurestAir/source/PurestAirProc.cpp index 73939a77e..362e27217 100755 --- a/plugins/MacVST/PurestAir/source/PurestAirProc.cpp +++ b/plugins/MacVST/PurestAir/source/PurestAirProc.cpp @@ -23,12 +23,12 @@ void PurestAir::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; @@ -128,12 +128,12 @@ void PurestAir::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; diff --git a/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2Buss.h b/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2Buss.h index b65aa472f..d625c7545 100755 --- a/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2Buss.h +++ b/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2Buss.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp b/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp index 346bf2ae8..08b4a4904 100755 --- a/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp +++ b/plugins/MacVST/PurestConsole2Buss/source/PurestConsole2BussProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Buss::processReplacing(float **inputs, float **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -90,13 +90,13 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -115,12 +115,12 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2Channel.h b/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2Channel.h index ac89c047d..6c7a2753e 100755 --- a/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2Channel.h +++ b/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2Channel.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp b/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp index 124b27f16..127c7910b 100755 --- a/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp +++ b/plugins/MacVST/PurestConsole2Channel/source/PurestConsole2ChannelProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Channel::processReplacing(float **inputs, float **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -89,13 +89,13 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -113,12 +113,12 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp index 2d8e61900..c7b1ee68e 100755 --- a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp +++ b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleBuss::PurestConsoleBuss(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.h b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.h index 51495fcc9..2c49190a0 100755 --- a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.h +++ b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBuss.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp index 6211eeb29..95223c51e 100755 --- a/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp +++ b/plugins/MacVST/PurestConsoleBuss/source/PurestConsoleBussProc.cpp @@ -15,51 +15,15 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -71,14 +35,14 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -98,51 +62,15 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -154,16 +82,14 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp index 35649a6f6..909f43b68 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleChannel::PurestConsoleChannel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h index 51e728f59..aa984365d 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannel.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp index 2fc513aa3..4a500fadf 100755 --- a/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp +++ b/plugins/MacVST/PurestConsoleChannel/source/PurestConsoleChannelProc.cpp @@ -15,64 +15,28 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -92,66 +56,28 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PurestDrive/source/PurestDrive.cpp b/plugins/MacVST/PurestDrive/source/PurestDrive.cpp index a1d926444..08c592079 100755 --- a/plugins/MacVST/PurestDrive/source/PurestDrive.cpp +++ b/plugins/MacVST/PurestDrive/source/PurestDrive.cpp @@ -17,8 +17,8 @@ PurestDrive::PurestDrive(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestDrive/source/PurestDrive.h b/plugins/MacVST/PurestDrive/source/PurestDrive.h index abcd65bb4..2b84c79e1 100755 --- a/plugins/MacVST/PurestDrive/source/PurestDrive.h +++ b/plugins/MacVST/PurestDrive/source/PurestDrive.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double previousSampleL; diff --git a/plugins/MacVST/PurestDrive/source/PurestDriveProc.cpp b/plugins/MacVST/PurestDrive/source/PurestDriveProc.cpp index f5cc80477..39c9096f5 100755 --- a/plugins/MacVST/PurestDrive/source/PurestDriveProc.cpp +++ b/plugins/MacVST/PurestDrive/source/PurestDriveProc.cpp @@ -18,52 +18,16 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -87,14 +51,14 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -117,8 +81,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; @@ -126,44 +90,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -187,16 +115,14 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PurestEcho/source/PurestEcho.cpp b/plugins/MacVST/PurestEcho/source/PurestEcho.cpp index 6bcaa3f69..d54d53c1e 100755 --- a/plugins/MacVST/PurestEcho/source/PurestEcho.cpp +++ b/plugins/MacVST/PurestEcho/source/PurestEcho.cpp @@ -19,8 +19,8 @@ PurestEcho::PurestEcho(audioMasterCallback audioMaster) : E = 0.0; for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestEcho/source/PurestEcho.h b/plugins/MacVST/PurestEcho/source/PurestEcho.h index 870e15822..e16cde658 100755 --- a/plugins/MacVST/PurestEcho/source/PurestEcho.h +++ b/plugins/MacVST/PurestEcho/source/PurestEcho.h @@ -62,8 +62,8 @@ private: int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp b/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp index e8e141cd4..a64daf546 100755 --- a/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp +++ b/plugins/MacVST/PurestEcho/source/PurestEchoProc.cpp @@ -77,51 +77,15 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -174,14 +138,14 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -263,51 +227,15 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -360,16 +288,14 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/PurestFade/source/PurestFadeProc.cpp b/plugins/MacVST/PurestFade/source/PurestFadeProc.cpp index ef2f9fc09..31f0a9d17 100755 --- a/plugins/MacVST/PurestFade/source/PurestFadeProc.cpp +++ b/plugins/MacVST/PurestFade/source/PurestFadeProc.cpp @@ -31,24 +31,24 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -119,24 +119,24 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/PurestGain/source/PurestGain.cpp b/plugins/MacVST/PurestGain/source/PurestGain.cpp index b1b77fe18..d068d7fac 100755 --- a/plugins/MacVST/PurestGain/source/PurestGain.cpp +++ b/plugins/MacVST/PurestGain/source/PurestGain.cpp @@ -18,8 +18,8 @@ PurestGain::PurestGain(audioMasterCallback audioMaster) : settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestGain/source/PurestGain.h b/plugins/MacVST/PurestGain/source/PurestGain.h index 9e2baeab4..b9d3a2d47 100755 --- a/plugins/MacVST/PurestGain/source/PurestGain.h +++ b/plugins/MacVST/PurestGain/source/PurestGain.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/MacVST/PurestGain/source/PurestGainProc.cpp b/plugins/MacVST/PurestGain/source/PurestGainProc.cpp index 4aa6d96fb..2ca5b8478 100755 --- a/plugins/MacVST/PurestGain/source/PurestGainProc.cpp +++ b/plugins/MacVST/PurestGain/source/PurestGainProc.cpp @@ -44,8 +44,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; //A is 0-1 (you can't feed other values to VST hosts, it's always 0-1 internally) //B is 0-1 and you need to multiply it by 100 if you want to use the 'percent' @@ -74,44 +74,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -122,7 +86,7 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= outputgain; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -176,8 +140,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { @@ -200,44 +164,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -248,7 +176,7 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/MacVST/PurestSquish/source/PurestSquishProc.cpp b/plugins/MacVST/PurestSquish/source/PurestSquishProc.cpp index 1be853713..946d23963 100755 --- a/plugins/MacVST/PurestSquish/source/PurestSquishProc.cpp +++ b/plugins/MacVST/PurestSquish/source/PurestSquishProc.cpp @@ -18,10 +18,10 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -29,8 +29,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); @@ -522,10 +522,10 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -533,8 +533,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -572,8 +572,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/MacVST/PurestWarm/source/PurestWarm.cpp b/plugins/MacVST/PurestWarm/source/PurestWarm.cpp index eeee37b58..13dbe8bd6 100755 --- a/plugins/MacVST/PurestWarm/source/PurestWarm.cpp +++ b/plugins/MacVST/PurestWarm/source/PurestWarm.cpp @@ -13,8 +13,8 @@ PurestWarm::PurestWarm(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/PurestWarm/source/PurestWarm.h b/plugins/MacVST/PurestWarm/source/PurestWarm.h index 98bb0ce4e..83fd9c336 100755 --- a/plugins/MacVST/PurestWarm/source/PurestWarm.h +++ b/plugins/MacVST/PurestWarm/source/PurestWarm.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/PurestWarm/source/PurestWarmProc.cpp b/plugins/MacVST/PurestWarm/source/PurestWarmProc.cpp index 101c9319d..b34bfb596 100755 --- a/plugins/MacVST/PurestWarm/source/PurestWarmProc.cpp +++ b/plugins/MacVST/PurestWarm/source/PurestWarmProc.cpp @@ -17,51 +17,15 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -70,7 +34,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -82,7 +46,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -95,7 +59,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -108,7 +72,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -138,51 +102,15 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -191,7 +119,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -206,7 +134,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -221,7 +149,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -235,7 +163,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/MacVST/Pyewacket/source/Pyewacket.cpp b/plugins/MacVST/Pyewacket/source/Pyewacket.cpp index d500e7449..2be4313fe 100755 --- a/plugins/MacVST/Pyewacket/source/Pyewacket.cpp +++ b/plugins/MacVST/Pyewacket/source/Pyewacket.cpp @@ -18,8 +18,8 @@ Pyewacket::Pyewacket(audioMasterCallback audioMaster) : chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Pyewacket/source/Pyewacket.h b/plugins/MacVST/Pyewacket/source/Pyewacket.h index 087a198ee..5624c4b93 100755 --- a/plugins/MacVST/Pyewacket/source/Pyewacket.h +++ b/plugins/MacVST/Pyewacket/source/Pyewacket.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double chase; double lastrectifierL; diff --git a/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp b/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp index 8b3021a9e..8b21a91fb 100755 --- a/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp +++ b/plugins/MacVST/Pyewacket/source/PyewacketProc.cpp @@ -17,12 +17,12 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -41,44 +41,8 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -133,14 +97,14 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,12 +126,12 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -186,44 +150,8 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -278,16 +206,14 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/RawGlitters/source/RawGlittersProc.cpp b/plugins/MacVST/RawGlitters/source/RawGlittersProc.cpp index 4ee485fa4..a4414634e 100755 --- a/plugins/MacVST/RawGlitters/source/RawGlittersProc.cpp +++ b/plugins/MacVST/RawGlitters/source/RawGlittersProc.cpp @@ -27,8 +27,8 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -84,8 +84,8 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/RawTimbers/source/RawTimbersProc.cpp b/plugins/MacVST/RawTimbers/source/RawTimbersProc.cpp index 78e012e26..0a1b401c3 100755 --- a/plugins/MacVST/RawTimbers/source/RawTimbersProc.cpp +++ b/plugins/MacVST/RawTimbers/source/RawTimbersProc.cpp @@ -28,8 +28,8 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -87,8 +87,8 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Recurve/source/Recurve.h b/plugins/MacVST/Recurve/source/Recurve.h index 52a507738..bb90e4bac 100755 --- a/plugins/MacVST/Recurve/source/Recurve.h +++ b/plugins/MacVST/Recurve/source/Recurve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/Recurve/source/RecurveProc.cpp b/plugins/MacVST/Recurve/source/RecurveProc.cpp index 8a0b85d85..fc20e5b25 100755 --- a/plugins/MacVST/Recurve/source/RecurveProc.cpp +++ b/plugins/MacVST/Recurve/source/RecurveProc.cpp @@ -16,8 +16,8 @@ void Recurve::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -71,8 +71,8 @@ void Recurve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Remap/source/RemapProc.cpp b/plugins/MacVST/Remap/source/RemapProc.cpp index 594800c96..b9227743f 100755 --- a/plugins/MacVST/Remap/source/RemapProc.cpp +++ b/plugins/MacVST/Remap/source/RemapProc.cpp @@ -21,18 +21,18 @@ void Remap::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; @@ -95,18 +95,18 @@ void Remap::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; diff --git a/plugins/MacVST/ResEQ/source/ResEQProc.cpp b/plugins/MacVST/ResEQ/source/ResEQProc.cpp index 99fa31999..c9c21c0dd 100755 --- a/plugins/MacVST/ResEQ/source/ResEQProc.cpp +++ b/plugins/MacVST/ResEQ/source/ResEQProc.cpp @@ -128,12 +128,12 @@ void ResEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; @@ -422,14 +422,14 @@ void ResEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; diff --git a/plugins/MacVST/Reverb/source/Reverb.h b/plugins/MacVST/Reverb/source/Reverb.h index a7b966d93..5d6f36229 100755 --- a/plugins/MacVST/Reverb/source/Reverb.h +++ b/plugins/MacVST/Reverb/source/Reverb.h @@ -53,9 +53,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/MacVST/Reverb/source/ReverbProc.cpp b/plugins/MacVST/Reverb/source/ReverbProc.cpp index 7140d1781..3dce2d8af 100755 --- a/plugins/MacVST/Reverb/source/ReverbProc.cpp +++ b/plugins/MacVST/Reverb/source/ReverbProc.cpp @@ -68,12 +68,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -82,12 +82,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -99,15 +99,15 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -446,12 +446,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -460,12 +460,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -477,15 +477,15 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -745,12 +745,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Righteous4/source/Righteous4.cpp b/plugins/MacVST/Righteous4/source/Righteous4.cpp index 3c50a7493..ffedc9292 100755 --- a/plugins/MacVST/Righteous4/source/Righteous4.cpp +++ b/plugins/MacVST/Righteous4/source/Righteous4.cpp @@ -105,8 +105,8 @@ Righteous4::Righteous4(audioMasterCallback audioMaster) : gwAR = 0.0; gwBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Righteous4/source/Righteous4.h b/plugins/MacVST/Righteous4/source/Righteous4.h index 8b9e44b57..4ddd61ec9 100755 --- a/plugins/MacVST/Righteous4/source/Righteous4.h +++ b/plugins/MacVST/Righteous4/source/Righteous4.h @@ -108,7 +108,7 @@ private: double rightSampleZ; double bynL[13]; - long double noiseShapingL; + double noiseShapingL; double lastSampleL; double IIRsampleL; double gwPrevL; @@ -116,15 +116,15 @@ private: double gwBL; double bynR[13]; - long double noiseShapingR; + double noiseShapingR; double lastSampleR; double IIRsampleR; double gwPrevR; double gwAR; double gwBR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp b/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp index feff69b52..3b330cb6d 100755 --- a/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp +++ b/plugins/MacVST/Righteous4/source/Righteous4Proc.cpp @@ -13,8 +13,8 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); @@ -42,46 +42,10 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -95,7 +59,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -300,14 +264,14 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp //output dither section if (bitDepth == 3) { - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out @@ -523,8 +487,8 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0002597;//scaleback of harmonic avg IIRscaleback /= overallscale; IIRscaleback = 1.0 - IIRscaleback; @@ -549,46 +513,10 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -602,7 +530,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -807,16 +735,14 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn //output dither section if (bitDepth == 3) { - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out diff --git a/plugins/MacVST/SideDull/source/SideDull.cpp b/plugins/MacVST/SideDull/source/SideDull.cpp index 479bdfd5d..1153e90bc 100755 --- a/plugins/MacVST/SideDull/source/SideDull.cpp +++ b/plugins/MacVST/SideDull/source/SideDull.cpp @@ -16,8 +16,8 @@ SideDull::SideDull(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/SideDull/source/SideDull.h b/plugins/MacVST/SideDull/source/SideDull.h index ef5e892c8..36950fd08 100755 --- a/plugins/MacVST/SideDull/source/SideDull.h +++ b/plugins/MacVST/SideDull/source/SideDull.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; float A; }; diff --git a/plugins/MacVST/SideDull/source/SideDullProc.cpp b/plugins/MacVST/SideDull/source/SideDullProc.cpp index 7b777444b..06f8ec15b 100755 --- a/plugins/MacVST/SideDull/source/SideDullProc.cpp +++ b/plugins/MacVST/SideDull/source/SideDullProc.cpp @@ -18,9 +18,9 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -28,44 +28,8 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -85,14 +49,14 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -115,9 +79,9 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -125,44 +89,8 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -182,16 +110,14 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Sidepass/source/Sidepass.cpp b/plugins/MacVST/Sidepass/source/Sidepass.cpp index a28c21233..8dc84167f 100755 --- a/plugins/MacVST/Sidepass/source/Sidepass.cpp +++ b/plugins/MacVST/Sidepass/source/Sidepass.cpp @@ -16,8 +16,8 @@ Sidepass::Sidepass(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Sidepass/source/Sidepass.h b/plugins/MacVST/Sidepass/source/Sidepass.h index 1b31b911e..4755073ea 100755 --- a/plugins/MacVST/Sidepass/source/Sidepass.h +++ b/plugins/MacVST/Sidepass/source/Sidepass.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/Sidepass/source/SidepassProc.cpp b/plugins/MacVST/Sidepass/source/SidepassProc.cpp index 834ae3e26..b6b664d3f 100755 --- a/plugins/MacVST/Sidepass/source/SidepassProc.cpp +++ b/plugins/MacVST/Sidepass/source/SidepassProc.cpp @@ -18,53 +18,17 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -84,14 +48,14 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -114,53 +78,17 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -180,16 +108,14 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.cpp b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.cpp index fd8a06a35..28ba08c34 100755 --- a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.cpp +++ b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.cpp @@ -19,8 +19,8 @@ SingleEndedTriode::SingleEndedTriode(audioMasterCallback audioMaster) : postsine = sin(0.5); - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.h b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.h index c162512f3..340d8dbd8 100755 --- a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.h +++ b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriode.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double postsine; diff --git a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp index ef6694c21..882fca727 100755 --- a/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp +++ b/plugins/MacVST/SingleEndedTriode/source/SingleEndedTriodeProc.cpp @@ -23,46 +23,10 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -73,7 +37,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -93,7 +57,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -109,7 +73,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -127,14 +91,14 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,46 +126,10 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -212,7 +140,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -232,7 +160,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -248,7 +176,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -266,16 +194,14 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Slew/source/SlewProc.cpp b/plugins/MacVST/Slew/source/SlewProc.cpp index 5618bb793..480beb3fd 100755 --- a/plugins/MacVST/Slew/source/SlewProc.cpp +++ b/plugins/MacVST/Slew/source/SlewProc.cpp @@ -33,44 +33,8 @@ void Slew::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; @@ -122,44 +86,8 @@ void Slew::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; diff --git a/plugins/MacVST/Slew2/source/Slew2Proc.cpp b/plugins/MacVST/Slew2/source/Slew2Proc.cpp index 07b1bb9d3..cea1b98e8 100755 --- a/plugins/MacVST/Slew2/source/Slew2Proc.cpp +++ b/plugins/MacVST/Slew2/source/Slew2Proc.cpp @@ -26,44 +26,8 @@ void Slew2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -173,44 +137,8 @@ void Slew2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/MacVST/Slew3/source/Slew3Proc.cpp b/plugins/MacVST/Slew3/source/Slew3Proc.cpp index eacd1386f..18177c5ea 100755 --- a/plugins/MacVST/Slew3/source/Slew3Proc.cpp +++ b/plugins/MacVST/Slew3/source/Slew3Proc.cpp @@ -22,8 +22,8 @@ void Slew3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void Slew3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/SlewOnly/source/SlewOnlyProc.cpp b/plugins/MacVST/SlewOnly/source/SlewOnlyProc.cpp index 5fc12c3a8..5676a6f91 100755 --- a/plugins/MacVST/SlewOnly/source/SlewOnlyProc.cpp +++ b/plugins/MacVST/SlewOnly/source/SlewOnlyProc.cpp @@ -14,54 +14,18 @@ void SlewOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; outputSampleR = (inputSampleR - lastSampleR)*trim; @@ -89,54 +53,18 @@ void SlewOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; diff --git a/plugins/MacVST/Smooth/source/SmoothProc.cpp b/plugins/MacVST/Smooth/source/SmoothProc.cpp index 1fb135570..81df54143 100755 --- a/plugins/MacVST/Smooth/source/SmoothProc.cpp +++ b/plugins/MacVST/Smooth/source/SmoothProc.cpp @@ -28,8 +28,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); @@ -214,8 +214,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -253,8 +253,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); diff --git a/plugins/MacVST/SoftGate/source/SoftGateProc.cpp b/plugins/MacVST/SoftGate/source/SoftGateProc.cpp index a09429bfc..ba8d6358c 100755 --- a/plugins/MacVST/SoftGate/source/SoftGateProc.cpp +++ b/plugins/MacVST/SoftGate/source/SoftGateProc.cpp @@ -26,8 +26,8 @@ void SoftGate::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void SoftGate::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/SpatializeDither/source/SpatializeDitherProc.cpp b/plugins/MacVST/SpatializeDither/source/SpatializeDitherProc.cpp index 4a611e8fa..bf9da7ef7 100755 --- a/plugins/MacVST/SpatializeDither/source/SpatializeDitherProc.cpp +++ b/plugins/MacVST/SpatializeDither/source/SpatializeDitherProc.cpp @@ -34,8 +34,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -125,8 +125,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Spiral/source/SpiralProc.cpp b/plugins/MacVST/Spiral/source/SpiralProc.cpp index 0ad97429c..f672d63d1 100755 --- a/plugins/MacVST/Spiral/source/SpiralProc.cpp +++ b/plugins/MacVST/Spiral/source/SpiralProc.cpp @@ -16,8 +16,8 @@ void Spiral::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -55,8 +55,8 @@ void Spiral::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/Spiral2/source/Spiral2.h b/plugins/MacVST/Spiral2/source/Spiral2.h index a65051eab..7da43323c 100755 --- a/plugins/MacVST/Spiral2/source/Spiral2.h +++ b/plugins/MacVST/Spiral2/source/Spiral2.h @@ -56,14 +56,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double prevSampleL; + double iirSampleAL; + double iirSampleBL; + double prevSampleL; uint32_t fpd; - long double iirSampleAR; - long double iirSampleBR; - long double prevSampleR; + double iirSampleAR; + double iirSampleBR; + double prevSampleR; bool flip; //default stuff diff --git a/plugins/MacVST/Spiral2/source/Spiral2Proc.cpp b/plugins/MacVST/Spiral2/source/Spiral2Proc.cpp index 2655f678a..36f15560c 100755 --- a/plugins/MacVST/Spiral2/source/Spiral2Proc.cpp +++ b/plugins/MacVST/Spiral2/source/Spiral2Proc.cpp @@ -26,14 +26,14 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -58,8 +58,8 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); @@ -124,14 +124,14 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -156,8 +156,8 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); diff --git a/plugins/MacVST/Srsly/source/Srsly.h b/plugins/MacVST/Srsly/source/Srsly.h index 0f1654320..6d1dcc7d9 100755 --- a/plugins/MacVST/Srsly/source/Srsly.h +++ b/plugins/MacVST/Srsly/source/Srsly.h @@ -56,17 +56,17 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Srsly/source/SrslyProc.cpp b/plugins/MacVST/Srsly/source/SrslyProc.cpp index 05f023843..f59ea964b 100755 --- a/plugins/MacVST/Srsly/source/SrslyProc.cpp +++ b/plugins/MacVST/Srsly/source/SrslyProc.cpp @@ -16,7 +16,7 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -127,81 +127,81 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -254,7 +254,7 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -365,81 +365,81 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -465,12 +465,12 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Srsly2/source/Srsly2.h b/plugins/MacVST/Srsly2/source/Srsly2.h index 78d5df5f7..f8c2bdbef 100755 --- a/plugins/MacVST/Srsly2/source/Srsly2.h +++ b/plugins/MacVST/Srsly2/source/Srsly2.h @@ -57,17 +57,17 @@ private: std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Srsly2/source/Srsly2Proc.cpp b/plugins/MacVST/Srsly2/source/Srsly2Proc.cpp index a1eb1ce15..13306512c 100755 --- a/plugins/MacVST/Srsly2/source/Srsly2Proc.cpp +++ b/plugins/MacVST/Srsly2/source/Srsly2Proc.cpp @@ -16,7 +16,7 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -132,81 +132,81 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -273,7 +273,7 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -389,81 +389,81 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -503,12 +503,12 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/StarChild/source/StarChild.cpp b/plugins/MacVST/StarChild/source/StarChild.cpp index 6e4bf3e9a..610c87efc 100755 --- a/plugins/MacVST/StarChild/source/StarChild.cpp +++ b/plugins/MacVST/StarChild/source/StarChild.cpp @@ -66,8 +66,8 @@ StarChild::StarChild(audioMasterCallback audioMaster) : increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/StarChild/source/StarChild.h b/plugins/MacVST/StarChild/source/StarChild.h index 630be3c82..157454b92 100755 --- a/plugins/MacVST/StarChild/source/StarChild.h +++ b/plugins/MacVST/StarChild/source/StarChild.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double d[45102]; diff --git a/plugins/MacVST/StarChild/source/StarChildProc.cpp b/plugins/MacVST/StarChild/source/StarChildProc.cpp index 047948abe..608c93157 100755 --- a/plugins/MacVST/StarChild/source/StarChildProc.cpp +++ b/plugins/MacVST/StarChild/source/StarChildProc.cpp @@ -76,44 +76,8 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -389,14 +353,14 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,44 +440,8 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -790,16 +718,14 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate b/plugins/MacVST/StereoChorus/StereoChorus.xcodeproj/project.xcworkspace/xcuserdata/christopherjohnson.xcuserdatad/UserInterfaceState.xcuserstate index 5c38f9460675438b0fec50998b84b4a658168d63..43e9cc934f4aee5f730e03f5cbe6b790181cd8af 100644 GIT binary patch literal 19471 zcmeHud0bP+7Vyknz(62jk;MRs5&|KRJs}A$fVfaMDvJv$MhF-Mf=N)RTIX6@Ypqqg z*v(b}_uAT8wRT^$cD1cqTWc4)*RHmGue)u(bMGYql=k(#@B8yJKSS=FnKNf*&VJ6! zX>IZbf=1)(2qOy7h(RohK#?eFs(PWvAMpBGrm5Zjy18C>s#FJkty9&$IrBVq!9YC1 z*KDbk%O+Ng^R#>Fi@Q4=M+1O@^=JKBMEqWjSUXdgO&o>xu zP)n(0)Rok7iclQ2g1U-YNnJ;+p>CkoQFl>yQ=6$RR0q{b?V}!~_EQI_gVaORA?gY0 zN$OeZRq8eBICX+LO}$5bOnpIpNqtBCKx3MsX_}!~T0%$BaypJ4NGH(>dN4hNcF<1R zMHkXT>0$J6dIViW7t^EZG4xn^JUxk?Ojps<=w|3$u~AgW1j8 z!|Y-1W$t74GWRnNFpn~iF^@A(FwZb2n75cS%=^s8%qPs}%-75}%=gTX%umd3%%3dH zMzV4?nN4R0vstW`&1LoMXm$)cmMvp1W5==M*$M1Kb`o38R;hZ z+u18vj$OsBVb`%Yu{X1~v3Ijw>^+M1e9 zq8Jp5WJrz@P|}o%75e#}_P})b+s(h#>bfR(Akc~8P&}as-H8&>K*EswiJ?}WSXMe} ziqAhk(CV)9l=|x0nmsMSTDiKw<|r6#E-1}68Vg3}TT4m`@=J^b#(ZmOvB_LgYAUwc z3PKYPLRrYT8!1p4N=F$;iBxDX8iF#Bny@5-M3MnSLZV1Ck&+k^yBldxHp)R-l#6sI z59K30G7uS&lV;LNmXVcY8`(~FlD)(R=#}_A?)j}gZ%Z&xTo?2%1Zh)WD<4$qX>hkS z1xM9;gFe3?g94*{{;J9212cqfo{GA;o@NgK5FaPEwUl}SL2rvY2$HT=p56z*XurGJ zQ{lbB(+#6mZXE9p1V{RsTbn#EVL2}#13}ms5p0P&0CJE=#~W;)>}mD+VasHp-J9ZV zsrM}k0G8sfV!z+r(g@hJ1WP@0+8WDR8ho|#l*yhtcq6VLG?ZTeK&tRGf#CJjcSDkd zHhLH;M#e5Q9F0IlB#y+Bgf3KqMxs)ZNbF<+zhU`P>wNVdJ)G(|Z&2SCy1v}g=nk|6 zDtvAJI?qVxS1Z^2UH{%43&f7Xx24?g<5fdNTPwfzi>K++CxrWDXgo4@pmAhi2bw@q zi0vdQ2co?kO-2={k|*0au&Xuj*Y9b9Q(EXDh$NGwTKW72Ze_Oy1 z5Z2%49W1C$U)S1t0!=|v(KIxDy2vywKp0cSpPoR~#0of|PH3)~I6Z|p*SHO`D>Ny7SJoN#AJ_JHeyR>nxZ_xyAi?`X`S}PyiZ!>@NBYmLg-Hkv3 z%6|KlwJh`oymOj7K#-S0X>zyw+Jd7N15fa#1N6zf6iS`n*VH61r{34l5byw#TnZ`B zt5=h^1@P&ANyTkJI6au?(q^9GNBf%Uy)BLX?baf{yLCK34xA9gHGkTIxNEJ%L&E-Ew%mr=>ACS449Q z;8PE$9XU=$WJonqZm`?1ShLUK~Ay4xxuh0dbPTF7zmR3_VVU zkx`_qFN;4Tu(P99KI|W}^BA|cCB&@!Z=OMWOO59Qkgi&J@&61m#P_|yzAS(pS}QO7 zpTX+qhW6-H^g1$bMX#abKu{;ia591vk>aiB6nX=={xm5eBZ1RPc|K1m_XE@V+e6Br z(%TFw%iRoYtiGtJT4c?UbKQP7C<^~%Uct;9>#g?`H#L<70&P6kW?eKWq*eNk$}E2D z$e<5@{^{)*OUxFhIZtIaJ8jFREwNY%oOvqavd}_4M4$D$kaOsBSjd-TG#LX68B1&e zzz?|NN2V?@=Bb=E)3T{coK{P3Sl^)^`-Sxr`WayTN-iVg0M__!Se{o8XH4T^ne8?U z0JB;PdI7@-Q=nKdCKEd_P0IUF9UdT@<)m8q(Esi%1#(-=3zk+;b=`Y_qp=+D#!?)E zW3h}}P9~EIQn?k!;dq>Y6G;_ulR2b`Kg^syN-!k11;sNS)R#U0?pSc4*R!Zrp4U&; za=&Mx*Vh)Pbo(1U-A2Ml-iqtLd+2CGq%+=ECm1@=UEL4#TJarkh=`bl7O24K{9dM! z>JFSirtk}iE3K}q;E}BcWXpn{W>JjdAvmiOXJR#(N@kMTApqGp7sL(D!CEqnOz*@x zoJVTN3}ToGV9M&j;PEziJ^os`9G-cI6Won0-e4PViVO~fx2Mm9J;O4K>Sqh`Ei|14 z+xtvcfE{EOsU?Q;%%W?=u7bG4!|?D~VSy${^DaD$m*;@V#hW3>TU-ok0+*0FqIn&U z!lUsRB*SBI8NLjUn-XPg=gYf{NDV1 zH&7CAiWd(Koy~0QM#e2$czzW86I_oQKx1MLY3aa?#0NA1R_a9F@(%hzbqgql`ZnP< zl(Z8!;}-10t#|?U;{Xnl1;kGRBuLuGLb8Y~-U+UR2F=6m_zJuP7vN=JFv&o2w392y z5+H=7#4z0(7}ex$JkIq6f|Xv2!(P+uuJZ*Jn~ZvsX{s0OT9Yl$6xy%r@eMrVt|eD?;B{nq zUm2En)D+Xx|CC%yyUNmh`nh@oncw>~(xdalRYI5(JCbn_;G*D{N) zCw-W%6K@B#kGt?zyp3EL`Bk65LI*UKLWYEX>6Z|Q;mE2D5Ahr|u zbC82y;4gWHt==7UPl}`F&k2PVF-0?MMB&hINHH8kyePIPgcR?M93YbqQlzP~bS7&- zcPv8^6)la41^23Z&qd!0Ox@xjNQpVX7XgT2NC`cyqOGpZV&r@jqgJlckM%Sy^aQjNJ(0P))8=o*O3 z-i|gwTy_gYWw$|8b{9lt522?a8had_hUn|Z=u>o#H@`(dQqK{cWNW`x<{UGpx@`feyRy*Z4fD zfooe!xG1K=>K|0^(p3xeLU?-DLB25DFLY@Awb+z5t?O z3+W(T@C`bwRzBqKxw*2v6=cJI=me-ir|iFn#CNI)w)6VxKlJ1s1fi!KpP&XH86}~j zcrM_L65e)5`KkWLd8AX=F-l6sh@0c-q@;q~Q|YUBx2xPimBnRpsLChEzYruU6~{Zs z@q{LtZYe|!q>}mA4ZQ21QpgSv1H30qDR7q9akluZMBFwsjv7o2p)x@g4J5nBJ>*_; zB@ZYZ>!GxQHroAP8%LsbXz0fgr1S#FJ^zm#LCPY4z3>0d5frz^jmeJV^GF1LPoih#Vph@1jbnQPgPgisGT`WxTaR9wCpC z$H2;=$%7m|Bp5ulSwK@_v`~m;f-wy*Ci&|j>Qx^O?^e3!fXNf&qcRXktCbJu2Zdt4 zeHv>=k2IE;N^RDBTY;%0-&$ZR&Mzq#>C7*+7;R>g#cnHhj1pC$I4g`Uar>vZ1KpnK z6mM{D1sHWr9%uodrT0wYh#pL;TD%L|JUv!EM5Lg*7`Ock^yE300<4`_F&X@2pP!Fe z2vH|q64c65`L04#u+ryin&bADg^(1Dj@}FC)s(b^cR8&E%kor9OjaxWc9eO` zlB47~^86m8p_-^>ss*j2TB!w;p9)Yxstsa+GV%g>nH(co9Qd%GaCjGo_j33khaZ9_ z5Jz%YRRu))Cb}1T8+i*td{x#GXa#%J=P!o1IXG|7t19RP@6GE8OyR9Nv0HeQ*e$6z zz{j`Up>T9Sj9&5fx#(E%-D=dqq`Mp8hWr*IfI8e+la?$A2;9SE;4B(1KdR)Mslt|2dWP}h=|_}v=Z2BBl{sT(|g zV2F_*VHr2v61vA%IH1$HN~;H@8D7gHM3Kix9qi2T=%# zX^xPS2*(HJ5(tJ-Ej*h-Du)*h;nnq-q{P$U^LxT0M38CxBqJyA{M{A^w{=4cE%jmQ zQSdaWN66b9)MMlwJ~qoECm8U7;s6gR)b%Oq8QyWKB=b6`!{pttw@MwQc*~o54i``_ zkoUluJlh3E41C}x|FKP57zhUH=bQD`YBBT;E}kGWjJ(J&+aP*oGF$A+LJ>6TBy}o` z)f?nPVhG{z7WH-*hj++FJvf}DKHw?&1#-57`jC9w)9?ue!MF};0r{juK*%<=M=c7@ zHuV+tO?a~N&UhArcoX2KOTXc|hJ?nAlFotaskYIUX{ZQ-j^lbu<# zKzxD--dN#RhZZK!&F|7F^7_mU^w@jzLZN)Q=)x!}7(57%Yv> z06{~ilOH;$8$r8)5XkCZvk6+MN4e6az8?B+U=^R>1=h8YlkNgC>=V$T@ z`IY=eE|A~JAG^>z+CUp=6a2N%R`|Aq_W6^;h{FuY<}l0Q2>x#*j|DFpM*00d|HV2$ zGq@oX4Wq@xZCQzK2JjfDDTDL+&5iDUj_k&?$lp}C)fpV z#-SR>eZzxb{n8WYQCk2{@u3{^o{jjsqIW|zJxb84&@)5~)9LxhxK}QxYv>vDOnMew zOV6g=^c=d5uBSb81Kmi^rM>h#4of&3#o=fUOF10F;aCpKI4tLI9EamMoWS8k4iDsT z5{HvHoWg@_qMPX!+J{!skV=Q|Al(Kew1{3zx5N7-98Tr%AP#FdoK3Pg$WO@lKROOi z;%Ta!! zZbPhRelcp=>lygGrQYoai%ZpA`_fa@(pLonxyt!jL(3C=1X;Ht7F3WBok#%ex*x)EN=P% z4y$=W%nBK+y>~yeh}i9oCACt*t`R)pzMtVaOy==Dx8syUo1BJ?!<43zMM2XxYhQBCg`p`Cb^ zevUuAqa4obpr7Y(zMxseZR`+T!B(V?4fQ zPte~k3dQ#!RzQEiVQV;8Kz~esg^WAsPv}qS&**dX=kyo!mmIcn*v{bs4m&vP2K)s^taRkG=dt;;h`KJ#^GWPk0+l%{nsvHo55>1KGMOfrWz5yZXQeNu{ADc zthlg-LkU(u{1SCk=wSX}Xq0qm zNd&_%ESkqea(Fn0NASE*M1&ORpbvi;g#MyB;SDB+iDhI+#>kmCCZ0(^lbL}`5?TpF z8bT|Swwu*s--r=}fnlzh454p+AI0}DvKa`er#r9kd6RuoLkMP18;8p{Jd%KsGLD0M zaaOI|5H^tdY@`TOAD%ND2@uGH8HBhlM!}>pAfdn(7|r3aKroDo84SF*0Ig)y(|abZ z63_t>03seGa2}&!vY|E#L_yD?i%EcPX7u_ynH*jQ{B57mgfB2UMorFgcnnM+r@LR{ zN*)hLAo0_l6jI`&DJ^3~lgVxlLz+=UrGSAlpZ-$Aos5&mpuZ+@WFZ4(H+*cb&(8I% zs4p3JGQ)Uq|G0mx+|1iXE*F$kltbPPnAGFvX+Nhr5QIFA#jNu3$DF6CgTfkBZqTzh zs1;AA2$+}wwwp*apjms2Ig`~Q`1wvt*w1H1F{4Efd-|kSPfJ+~h~z*w?K77#lfc<# z#xdiW3Cu(ePv&q1hbuW;wUsGnF2@%bc&z5|3<4HbJ+V#YH6QObfQ*4{30oRrg*#o8 zmb@V_P0){g=g@4^nOc6f8fFGFlbOZgDIA{4;b|P6z7-C@}bKll(;a5@T<1-(sK8?a~s0@YJUY+0D3h_t~o=JVW2+(<% zC2sIMp}Z}Gcr)Vz*)G(fFs&S(*`0A<0-(p4Ak)TSSdBZZ$C<^<(tZ>xvkYmNnPKeDho0z+pyP3_*7Nb2;qgFxbNL zIo!nI=Iu-uvz6Hf-#ZYzZQ-zw!z+Xz9dL@aUdAWPEh+*aJqXKptAhmb-B^fuK=2b@ z*3A#h6yNd4nJl^*UKxx79uUGh>2O4CP4)ail|z~NWDi8?g`#L7V-G?>tm|O*F$W=1 z#yrUEXAW=}j%xvj{awsMXeC<7;eb$43EL6R^FeW-dwL;^$Qzp7WCV?Zpn^zUX?qKl zOw@(mh@18#&wx*HPy?bl%^YTqFwZhaLFzxpJkPwqyhwiya{n0f3ZyE>q2VB|>$@u` z`^XVd%?)nor7-mYq4uP&Tmc*cypcp)_EFTyPSYKrcc%on_#;P6sGQS=GgbZZS%DQFGw-vq58 zWB$eboB3gSD>yx(*5WYX@bX%D?SFQI|6$d4?^uz3aj3LU)H^>jztn(PA2Iw?00*2tPzGizb3tc|s^1+0Sw z6L>9$Z{YAc4uh8mq7}Tnn>c(khi~EV#@%co=rH)OBiJIogq|IVG#tJaL?L`Qd^?Bl zB2Y!o;k!lU_W#T110c!&UzO3bmxDlN!F;)mh;{UA72>w?BA@?sSJ7vMT^@D@I}0N9 z>`V^d(ZSYoP;v&Y*MBaUXX{uf8iay*)k`E4xcq@muad`Xx!hq|Mz<@jcI|jU+y)$HMv70!&yW7@cH-oLkZehU^ zxrf8|hHVvgE4!m_%`Ll&fHk%UoVB9$<-M&U_Fne>i@NUPyWYol^{M)FJ;)vkWAQMD z?+;<|7|!ZqA7`InpXBfZ9Nx!4jo<9h2|vR=+Z#UQ-J2oD{&G0k#lFZM>(il*eU&`J z;RksHHZJXhz)ALv-d))@sb&rz;DLda0_Pr1GxK4taFPOIwf|W`T^y$kWh#VXI`%#M z<)k=fZQq1bM5HEMM0Zi`T)3w0FYe`@mCFW*Rdh0WTzopZ4rV& zqrHAUj}~b4f&1i#c+W__R9!T;p=fD>J1}3kW+KiR_KV9(#c9X*TZMUe zJFtE+RBwy@Cbl)t@%Rab@|TDK5<*F!GLIoqaUkSbk|;;=SNF;XLJ?lBE-znivkxu3 zY~1)sRn=3b&lD>R!5A|_S%-?R>EKH`R7UuS4+S<=6=3TE@3r5|64Up zAaCKM3%ZsIE?p#T$Za>C^TOF^l_VKEoyn@jEX ze4}|J)CoC97vwueTa3jPqp8GfG1hd~&p3_7Ww5dd6X7g-1MHkoc(VL*!{mxeFx*4O zETSQ9ad%0RvTs{&5JC^QK?-*wL+<${l{;`wz5RBfqNl(HS(pOH)M;Vz66fulS_rRe zX7nw!tSPK9E;iQ{n9NqY!`NLYsfLTJe4%6+*dmJ&fh+5qA-{MZ+=_Y;uK0Y8etwYq7kl{Td@t>u>(8dy7@4;Ze9Y{%}2w%g3It6JQpsMUk^D(zEJr%K8?@974bhQ zsHugk;ZiD&N~5x<(Nq~+{+QlJ9{VVl5 zT-#Pba;X$9WsijQd1VxSnf*tNSD1 znkIi;e-=bj&p^oXJpC(!nFwY8T)LJ)+${l|lRTz^na#ApMe25D3A2n@4i~DgVyDn;EMBWaK-s` z_6_!3_AL7W`w{y|#K4H*5sM?Pj<`1Bx`?$A>moKp+#Rt!Vqe7mh=UP_A~lhQNLS>@ z$g;?Zky9e;BikdFL@tY59?3;s6?t{!s>s!mYa-W1c1CWE+#b0za(CpO$onGikK7lz zKk{JYp~zE_{~nMsz%^jjfRzJw4tQ?BrxIEsmB=J97YFyORsM;uZR9%!Oswt`^sx`_V6^!Dd zu8O)kYE{&8QLjh65p_E1Oms%HE;>Kj5N(R~MK6uMI(k*~>gYAmYoj+t-xhsG^rq;$ zqqjsq8vSAPx6%~pV5wf}kdBg0l$J{;ODm<-(psroS|{~L8>L>UU%EuPQo2EUhjf$l zZs`_jr}Q4_z0$qX2c!>54@jSoJ}*5keNXy<^dsq~(sR-;q(4c2k^UzAJ!WW3SS8=GjWOPs`7zBgx5Ydc^J8p!Y;J6RtRdDMYmK$XUKU#sJ2iHC?2Oo1 zvGZeFWBswg*!I{ZvCCqY$F7at5_=@}SnQeDv#}q(eIFKd?hWD8^g*@LpjWG~2Gk-a86A$wEymh5fWyRwgEU&{WF z({iaiPi~P{$i4D~@p=kl!TlkZ+eiC_f@UDt})7qWop~EArRm zC*-foKaqbX|6Km1{A>An`FHYv$$yal6i3A=;;eDw;%3Lqi(4LdYusaTPsbgLdn4|n zxKHEG#eEs~b=>*53vqwMLt$pTEIu(lDLy4WJzg08$Un(?)Zn}PsG0+|7rZW_%GtWivK45+xYL}|4fKT7?2Q^AWcX}7?_Zp zkeZ-K7?aSNaCgFvg!>X6O?W2ZNW#&C=M!E{IG%7a;Z(w#3GXI+ns6@RhlC3Weh#l$f5Fn`lb3B-#=S5{D-iC6*+XCXP;=lsF~nXwvgZ$CJ(`eVX)j z(vL~MCr2eGC#NPWlGBrw$%B(Kla0ydWNWfL*^%r@9-2Hnxi0zIZ)G7HX#uRgkHKjPEG-Y&3S<1MS2`SYn(^6_uW~MZxEJz8Yw52Rc zX-`>_vMlAglpd7pHQmD^gdcZb;plx;=Gg z>h9D%srRMcpSmw~f9k>17gAqJJ(l`v>haW*si#s;r=CfDC-uG5uLs2qnmlO9pxuLB z9`utUL7`WSQIsnx6jh2Tih9K|#c~CwxJq%gVwGaGVvS<0Vx3}x;wHr{iu)AzEA}b& zD-J3SDIQfku6RmuSaDSGg5o8`F~$3ef2BpH4N9}56{k%|Tb8yb?Wwd^(>_c)pZ0y) zztet7`z7tSbY*%@x;9;xZcQ&vAD=!ky*zz#dS!Zbx;wot-ILy!?oFSc-kiQZ{lWC- z(%(w|B_kpuA!A@haz<)~A_Hz4WaMS&GmIJL3~Pox!;#_2xIANahCgFt#tNS&8llu9jg0OdsX+V z_Nk7k&Zyp1omG9P`dIbpU_3Z#aQ0yBU|nWoW^3l{nOibnQ0vu&>f!1l^+@$7^%%8J zy;QwUy+M7G`WE%A>f6=CotT}RJt#XZTbVs1J1aXUTbG@mU7lT^?aRI*dqejA>}Rsi=M2cv~bG0U|RcqHe zwT0R;ZMD{`4QQ8YS8La6Z_;km-mcxE?b2@3?$qwqKBj$E`<(V=?W@|;+COsXTy3sB z_p;oXxwCVujvtQbt82(x`1w}ZnHqi@l#)UVcW*6-Ax z)Souc28W^8P-+-sC^O74_zbOv1%`m(O2Zn%&4ybIcNp$6Y%%OI>@n;$JYd*wIB0m% z@TTEI!&io1jFgcz4lqU=V~xqiRHMR}0oMHxW07&Dkr;0`b{e~k+l>2+2aFFHA2B{| zeA4*5@tE;7<4NNw6rUsMO)MRQgwVGC%)|%FvZZh3s>NM>&?K2%P9Wp&?dcyRy=@rv))9a=; zO=nE+n$DU&Fnwi4<|MP)Y&4gfC!1@{4Q8*o$?P*PG`E|Vn3tKCn{PJnFh6X5#{8`L zdGm|rFD;Q4on@G%#^SRqvD|LiWZ7)#uxz#Lus2;Sk+c=YOHpv(^_twX|1)+v3jh2YnyeE^$P1M>&@1U*4wRjTDMyFTK8EG z*ph83Tb|8i8)h4An`xV4YqzbiU2VJ8cAf1e+kLhNZ2N7eY^QB++upN%VEfqineB7i zmv+V;X^*nU*yZ*F`#^h!JR47*_-S>`%?RA z`x^TV_VxC=?ECBo?1$`++MlpLZ9igv&i&SOp=BRK~JEl2m9QBT7htILV5pc9Q7CBZrRynS7 ztaYq+-00Zrc+By%TcDeSr_PQQ$J>q)Wb;R|Y>qXbguD4w8x!!ku==#j{ zx$8^U*REe(e-`3Gx^O^YRAEe^tT3f8t1!1PuTWoTDYO?l3SEU03ablmD%@0*-)-Sj P;$QatkZmviEi(KcjbLHf literal 12075 zcmbVS2Yi!N*S{le)1*n$B+XvUC}ngn%5G^v1WKi)lx0cVr)?l@Y6eg%as%ReQB)kS zib`AN>%;|4R9xUdhRP5H5tQXXMTX? z&&t{ZAV2^E0f+&y0hpYGdrrDj|`eqkxuCn_*ZE^r_UiEYm z%mZ;i2oyjGl0knk01O0!Ksv|(nIH>fgB&mf3YyGPpb?s&8CqZp zv_c!S!vQb{=E6Lf4-4QZSPV)?9$1bhy@1K)-3!S~@dxE+1~KZGB_o$y=u9Xt+C zz?1M4JPp5xKfoX1Pw)&p2me4ZC>BXkBGMuq(jx=PLAfXo<)Z>rhz6q~Gz1Mr!%#6Q zL8H-FbTyiYDo_<_KpbjBO{f{UkO#G)d1yWgqQz(lx(VHm?nKMceduA-iPoX@=qdC( zdKJBf-a+r8kI@eF3EGLiMc<+0=ma{6PNCE2d-MbP5uHW9p+C@{Scv1X2#awdPQg}e z!*=Yzskk3b!~JnSF2IF&FfPHP@i;sQSK_I-2G7K^uoH9Gh3DW_?7dc1ReZO(eG)Ked5;adH*GJ9eE;KDIEg{A3PS%qWL^GZqz z(@U}nv(ocQi?ee|O0$de@(UvqtAH7#tp{qL0a~B~dSC!XU?MRjmc$Vui6E(`ZS{@uc&ALB;F}pD<0|W$xfYHx;9n;PT1z>f-_`2$Q-iIQ8KW4C z@j6?$O4s#Vm`ANFYl73~AMI&rb8~dU3TEd%KivtQZHd#zHG~+u{OyyuHjkHXQDS7b zrn*`iJoA0EGRs?^j09<&U<8qOf>9)y z^xF+aQ|&1QWnc^#%k-y?E_Vj~_Hu5zee*a1h>|F3Wy2d?Zf;0sX66(h-Js0+W-r|& zPg^tRo#Sb4^?6z|>7LJ}EtzATuGY{;#sapgHoBb5UEpdk9!vler}O&QO3$E%f8=~q z$}8zcbt9O0biBV+r)*>aWu1?E0b4pZhA;u zL*%F@cZ(d6Y&8{joS$p) z?F!j=6PVKlnt_WLiH)R27`TB4$h$xbXeB0M?gDM#I$|Ly#5#+z8P`B{($(nVytOhJ zeP2-8+CJEE=$49*OpgK4EUXOZm!ttb+&hdrQjA&P8Bfp%1?G1xV=`U z=ppQ#wHw^V=A}!zbXWO}x&til1b31FBxet}8{7j{P!+!y+y};j2d4Q#=SHQU=6AJF zlyJ7R&1eWiAJsxKhzukOl5Hz~^=<8uV^0Yqi+cz>!mRgUu#%*cj4tpfc#LF{EYh!< zKhJ7jZ>}Iy6*CBaMQg!23P(}uajE`vgY{qoTif50(T$oYE4`(B9ckXqT$|2Nx==Expx2Rj(>d;mTKAAyg_ zFfyEsAR||UPry!U3%kiEQcOz7XlAdP3a_h$8bjnXsv?R-q2Q9PYM0MNb$)cS)9a+@ z;hpSkZQ^EK$y@_Iq8eO(DApF9Hgn1jyIJ7#IuVpb*AG5fsA&QbDdElSw71B2!2;nYtcI zX`rzSCP6t=Kqat{8X9PnkZEK(nL%dKXX`Y72;VD9$4__p%G|Cdb{@4d72jM+eLy`o z&NtOX{U67$U)i@K0`j#oIp18&QUE`71OYE)5^m&~jB&QO-0iip|kh?CS2>y-Jf27hyP zGv{h*_S;6?yE26Pwo%JS=pn+m5Dul_0SCh(ID|A1jx=_|VQ@Hw!zOYw14J57(Q}NB zn8MK&h26?P3$qpeh%31!7IM;U)?7AZQXBIzv`ckaSCz}}=0Z>pOTnBqundlYW8qbB z9BC#V;v@6P4L$x5PJk6m-ifdrP9iQchs^DU*TBiJlDJ6=X=U=JUN%FNc+?y{UK;$> z$_D;DVTrSTZY9@7ZJP$FwX*(yPtDI!?Q{n?+bCgZk3l`KI1sQzss2nj`?3W%VI8a| zZR9%QrM5PT9}KRsOeqPt+zpYVa>16%Mz%r^Y$JXWAoJKr89#LLkmxz*!Rs#@*#U2W z3&{e~POhgTNB$Tk@h-R+h~W}=6N@1moPOt|Bs8}!l1)Q|1u?NhhyAlG`pGz9qD-eZ z*c}72^9sXxPP|B*Ad%AeFuZMi@JNG^Vn0QTI%*R>n%^W4JgqWNU(az3T*K}pxk#bX zULh;$QYI4tiRn^nXqpmF#MR}MV?3>XN;%r&_IURgO=giL#cHGNEK{JfHjZ&Sn|$=0 z;gfAtD!=$7iHv1AwK7Y_Rh)Ys=XcdR%eer@Lg8_()Jz*`VwGOvaX0Kr?U&a7O2Kb< z>aMf_y|M40bWuiT7L{fy0~fl+kW`f{ODo9&GE792T~2O9+^(Df^gX{IIx@>=jf0CQ zD)rf;27dRth77o3J56lLE5~!~G~o%?Hg*mlQRVe``~=dfMiNc%Y_yt@Lvxoh8qZIr z^@}B<{H_c+A{=tt( zM=17zH^W2GJ=>3^YQ z0Y`|k2S;RZ7hFXRvJ-YO^=F|j^X{788qUrkH}PAw8m{4Yh3kT=L(z1Vr@`57ar!N} zL$U{3DkjQK@F2SZ%;}`%158r+_b0)e)qM0wGs#f=NaVeM`#gLVq^*N5z!%{rxEa0# zUxu%c+sVJkGI9sGlPo89t%I+@*Wnf*g`1eWCU=v2$O_7SS;$%UyO!Y@(*TahSU2+al2T4)Y)zo?g z4oo1Pzl-xR?V-cQ&~inE)8EWuN7p(vlxAK&hI)WN zC|-?7YD6?r+<;8Tj4UVxS&S%D3zSQo3@Mr<+PecUqVWZu0o?$kxl&bcra&G7{F0^pZ06es7@NZXOT@2 zg_we7Qs;=O(Nt7}rct$+L0%)TlP%;8st|9kMYHI^*V6w^R7c*TN4}l@|B!sd4xUw% zdybA(uByBo^TJd%sHo5^X?_Q;JZ95=`_O)LfE*-WlCQ`ia+rKgj*xH2 zQ3j7+Qm=Xt9z6y>Qx^hj|8DO2u(p~4#IxSQe+IzO1Zi~QxoUqJs(SS zc~`~C1hrJPTN|9-2Ij#SG2caPteU@xpUE%eS8{e8)?yvjV*~02`QTad8#zaQ4?-c?Nn|ug?l+Ty6vuK9=9Xsg zLWRVo?vl^8n1_r$66yt9QDVMOj zsZVcn2YmboZwBF$zyok5kY8Q`#aTET?83R^Jh?#i`y#d0P$}}f4n&nAdn=Kj;vzf* zi1AQ73=hX6@JKug9;7A^ktb4CyS7(W7P^HfTBvIDHZyNd!-55q8Y5$S`+_ir{27FC zy@I`qw?$319e)sn)*!UeTLP;1JVe_@xn@UA`w8A1 zHEIw3Gzc9*m>P*CBR-T5MP|Mc8odYa#|Q8i6a)`~GW-=jL~{>TSL3ydx!3a0t$@0T zYjp*D{M@YmKoy_w(X{cmOqX>9X#pPuVOkL8eulrsN9Y{i;G_5$o#!Av4j;uQ;Ey%* zn!?@SbWN^;7sXkLy90 z8H5AEILvF?8HTDq<6rQvK{zl72L)mJC9oPs(JLZfxKRLj+{^fT+>6=*K|I}rROrY9}MXdXc+f@LVAUgtw1j@ObLY+p{lKx{_bWV4M~Q8k?3(6ufI-z@wAghu?Nvt z=rB4)fAe$#ox+&9`$Bvb^>q_)Idx={aTTtnzhZLXxwwV?dg(ffpaDD|x6|J--GiUT zuTp>XvmjM4SWqdb5;z5of@Z-Sfk$wiz$XX@o)+vC92I;gI3YMK_(AZK;Ln)Y75f?wvo7YDm}g_2k9jd>bIi*zM`M+-qhsg9 z&X2u5_J-I+vBB6Su@A(qid_@CE_Org07UBEC zkA(Y$2ZUb;zZ9Mno)P{cJS#jW{3{;Di=Q6f6z__k8{ZPYG5+=V zH{#!le_Mn^i6V_iCo+gkB8#ZMXrL%vlqt#<<%-Hh0nrlCk>X}%?U3hyp^ycVOPSQgwGT9B^*fjF5z^- z4+%ddoJ}~Fa3SG$36jK1rHl2XZh$vu+CCC^K?NZyoe zmAoT)PqIz&fn=}bE6HKW5y?@>DarSeA0=lbzetVJ@zVKHBE3brO!}a7m9$H`TDn&H zr1WX&M(K0X7o@LC-;lm5-7VcO{X+Vs^pNyh>2c{v>1pW?(sR;_i6Bvus7zEPY7%vc zDT%g3M`FLk{)st>MTsSeS0}xc^h(m(NxPEvB^^pSopd4T_oP4NK#t@Bd8}L^PnN6Y zTDe|sl$+%#@-gzc^84glJu~~6mnWns2 z*{BREA5pGVZcsk1d{X(c@+0LAQJz(vQ(jR1uKY6@ zB%@?Oa%{3WIVX8Ua%*xh`I+Rc$-9ydC4ZfKGWlHc#pFL!K!sESl|&_1DODR}s}>)lI6KRd=YCtL|2U?#fx=1}#JzPCfU929hE>q7|d(=zR z52)9wUsvx^f3LwBoyMj~(+toI(qw4nYSwC=*1W3Os@bO5rP;0dRP&|gE6rie3C&5( zY0X*9dCf)5A6k)Ct<`GvTBFviP0`x4S=tYmrVsN1Z2NB6#NyY3_14&6@Om%78cBf4X{ z?{p`0zv(XMe%Jk_hkC3}&};Puy-A;<3nV6HaLHQ#8y!@SD;s(Fj~P4nC4 zcg^pcFIcceWJ$0jTI3d`CB;I25@N}-6j+KZB^IZp(X!NXkL6y=1D1y@D=ix=PgtI^ zY_z;+*=l*m^1fxeWw+(H<@*#tiX>%l%J7utlt)t5rff)gBIT)+_fqzx985WsawO$g z%JGylDZi$iOSzEpN6KGTp;c}*TJxowLY>s0G(Yn`>h+GKTE=UQ*GuC;En zer-KzJ!SpgdeQo)4cY{@Sewvhu=TeMvSrw^ZF#l=+ellfZLIBT+XUM*+qJgYwmMsr zZH}$Q=CLiXEw$ZlTV}h{w!(J5?Lphaw$-+cwr6e6**r(a&*caI!v_Eg( zWPi#2s(p)nul=z7JNqvVwZrCcIMN&g9T|?%jxmmLjtP!(M}=dWW45E-(dckF<~kNQ zu6NwvSmapdxYKdB<6cLnW3^+gV}s)<$19H49B(+@avX4c={V##;yCK~-tm*;7spx0 pU#b05Gg50(ovF8^E=zqj_3hMcsXIbpD?o_<78v>O$Y<)#{{dZm;Qasq diff --git a/plugins/MacVST/StereoFX/source/StereoFX.cpp b/plugins/MacVST/StereoFX/source/StereoFX.cpp index 704cbf375..8531bcdbe 100755 --- a/plugins/MacVST/StereoFX/source/StereoFX.cpp +++ b/plugins/MacVST/StereoFX/source/StereoFX.cpp @@ -17,8 +17,8 @@ StereoFX::StereoFX(audioMasterCallback audioMaster) : C = 0.0; iirSampleA = 0.0; iirSampleB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = false; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/StereoFX/source/StereoFX.h b/plugins/MacVST/StereoFX/source/StereoFX.h index 7a3605921..04d34a587 100755 --- a/plugins/MacVST/StereoFX/source/StereoFX.h +++ b/plugins/MacVST/StereoFX/source/StereoFX.h @@ -56,8 +56,8 @@ private: double iirSampleA; double iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff diff --git a/plugins/MacVST/StereoFX/source/StereoFXProc.cpp b/plugins/MacVST/StereoFX/source/StereoFXProc.cpp index 0e9de7478..0c3ae4962 100755 --- a/plugins/MacVST/StereoFX/source/StereoFXProc.cpp +++ b/plugins/MacVST/StereoFX/source/StereoFXProc.cpp @@ -17,10 +17,10 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -40,44 +40,8 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -135,14 +99,14 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -164,10 +128,10 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -187,44 +151,8 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -282,16 +210,14 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/StudioTan/source/StudioTan.h b/plugins/MacVST/StudioTan/source/StudioTan.h index 66caf4866..9e17ad768 100755 --- a/plugins/MacVST/StudioTan/source/StudioTan.h +++ b/plugins/MacVST/StudioTan/source/StudioTan.h @@ -52,15 +52,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13]; - long double noiseShapingL; - long double lastSampleL; - long double lastSample2L; + double bynL[13]; + double noiseShapingL; + double lastSampleL; + double lastSample2L; - long double bynR[13]; - long double noiseShapingR; - long double lastSampleR; - long double lastSample2R; + double bynR[13]; + double noiseShapingR; + double lastSampleR; + double lastSample2R; float A; diff --git a/plugins/MacVST/StudioTan/source/StudioTanProc.cpp b/plugins/MacVST/StudioTan/source/StudioTanProc.cpp index 3258f7b4f..de2418d10 100755 --- a/plugins/MacVST/StudioTan/source/StudioTanProc.cpp +++ b/plugins/MacVST/StudioTan/source/StudioTanProc.cpp @@ -30,12 +30,12 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -54,7 +54,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -66,7 +66,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -93,7 +93,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -252,11 +252,11 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; @@ -308,12 +308,12 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -332,7 +332,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -344,7 +344,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -371,7 +371,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -530,11 +530,11 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; diff --git a/plugins/MacVST/SubsOnly/source/SubsOnlyProc.cpp b/plugins/MacVST/SubsOnly/source/SubsOnlyProc.cpp index 23e79231f..3a7df87a0 100755 --- a/plugins/MacVST/SubsOnly/source/SubsOnlyProc.cpp +++ b/plugins/MacVST/SubsOnly/source/SubsOnlyProc.cpp @@ -22,51 +22,15 @@ void SubsOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; @@ -306,51 +270,15 @@ void SubsOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; diff --git a/plugins/MacVST/Surge/source/Surge.cpp b/plugins/MacVST/Surge/source/Surge.cpp index 222fbcf96..e330af883 100755 --- a/plugins/MacVST/Surge/source/Surge.cpp +++ b/plugins/MacVST/Surge/source/Surge.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new S Surge::Surge(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/MacVST/Surge/source/Surge.h b/plugins/MacVST/Surge/source/Surge.h index 7f42c9f74..18d47a94a 100755 --- a/plugins/MacVST/Surge/source/Surge.h +++ b/plugins/MacVST/Surge/source/Surge.h @@ -53,14 +53,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; float A; float B; diff --git a/plugins/MacVST/Surge/source/SurgeProc.cpp b/plugins/MacVST/Surge/source/SurgeProc.cpp index cd82badfb..53cac6996 100755 --- a/plugins/MacVST/Surge/source/SurgeProc.cpp +++ b/plugins/MacVST/Surge/source/SurgeProc.cpp @@ -18,10 +18,10 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -36,44 +36,8 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -117,14 +81,14 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -147,10 +111,10 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -164,44 +128,8 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -245,16 +173,14 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/SurgeTide/source/SurgeTide.cpp b/plugins/MacVST/SurgeTide/source/SurgeTide.cpp index 494e886b8..ba28ed38f 100755 --- a/plugins/MacVST/SurgeTide/source/SurgeTide.cpp +++ b/plugins/MacVST/SurgeTide/source/SurgeTide.cpp @@ -15,8 +15,8 @@ SurgeTide::SurgeTide(audioMasterCallback audioMaster) : A = 0.5; B = 0.3; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/MacVST/SurgeTide/source/SurgeTide.h b/plugins/MacVST/SurgeTide/source/SurgeTide.h index 8f8cd4241..f6a2b7cbf 100755 --- a/plugins/MacVST/SurgeTide/source/SurgeTide.h +++ b/plugins/MacVST/SurgeTide/source/SurgeTide.h @@ -54,12 +54,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; + double chaseA; + double chaseB; + double chaseC; float A; float B; diff --git a/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp b/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp index 59a92aa02..ea08259c9 100755 --- a/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp +++ b/plugins/MacVST/SurgeTide/source/SurgeTideProc.cpp @@ -18,10 +18,10 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -34,44 +34,8 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -107,14 +71,14 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -137,10 +101,10 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -153,44 +117,8 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,16 +154,14 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Swell/source/Swell.cpp b/plugins/MacVST/Swell/source/Swell.cpp index e197cfb5f..f1b5da9a3 100755 --- a/plugins/MacVST/Swell/source/Swell.cpp +++ b/plugins/MacVST/Swell/source/Swell.cpp @@ -21,8 +21,8 @@ Swell::Swell(audioMasterCallback audioMaster) : louderL = false; louderR = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Swell/source/Swell.h b/plugins/MacVST/Swell/source/Swell.h index 7c108b728..1acfaf86c 100755 --- a/plugins/MacVST/Swell/source/Swell.h +++ b/plugins/MacVST/Swell/source/Swell.h @@ -54,13 +54,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double swellL; - long double swellR; + double swellL; + double swellR; bool louderL; bool louderR; diff --git a/plugins/MacVST/Swell/source/SwellProc.cpp b/plugins/MacVST/Swell/source/SwellProc.cpp index 3ab1e9b43..447613b50 100755 --- a/plugins/MacVST/Swell/source/SwellProc.cpp +++ b/plugins/MacVST/Swell/source/SwellProc.cpp @@ -25,53 +25,17 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -94,14 +58,14 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,53 +95,17 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -200,16 +128,14 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TPDFDither/source/TPDFDitherProc.cpp b/plugins/MacVST/TPDFDither/source/TPDFDitherProc.cpp index 865cd643d..e51504299 100755 --- a/plugins/MacVST/TPDFDither/source/TPDFDitherProc.cpp +++ b/plugins/MacVST/TPDFDither/source/TPDFDitherProc.cpp @@ -28,8 +28,8 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -86,8 +86,8 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/TPDFWide/source/TPDFWideProc.cpp b/plugins/MacVST/TPDFWide/source/TPDFWideProc.cpp index 810a8ebac..45b831dac 100755 --- a/plugins/MacVST/TPDFWide/source/TPDFWideProc.cpp +++ b/plugins/MacVST/TPDFWide/source/TPDFWideProc.cpp @@ -28,8 +28,8 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -39,12 +39,12 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises @@ -104,8 +104,8 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -115,12 +115,12 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/MacVST/Tape/source/Tape.h b/plugins/MacVST/Tape/source/Tape.h index 932247bac..1ab35bd88 100755 --- a/plugins/MacVST/Tape/source/Tape.h +++ b/plugins/MacVST/Tape/source/Tape.h @@ -63,19 +63,19 @@ private: double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/Tape/source/TapeProc.cpp b/plugins/MacVST/Tape/source/TapeProc.cpp index 961a1c1e4..4d498b2cd 100755 --- a/plugins/MacVST/Tape/source/TapeProc.cpp +++ b/plugins/MacVST/Tape/source/TapeProc.cpp @@ -45,18 +45,18 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -158,15 +158,15 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain != 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -324,8 +324,8 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -334,14 +334,14 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= inputgain; } //gain cut before anything, even dry - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -443,15 +443,15 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; diff --git a/plugins/MacVST/TapeDelay/source/TapeDelay.cpp b/plugins/MacVST/TapeDelay/source/TapeDelay.cpp index f7690dbd9..345f06d58 100755 --- a/plugins/MacVST/TapeDelay/source/TapeDelay.cpp +++ b/plugins/MacVST/TapeDelay/source/TapeDelay.cpp @@ -26,8 +26,8 @@ TapeDelay::TapeDelay(audioMasterCallback audioMaster) : gcount = 0; chase = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/TapeDelay/source/TapeDelay.h b/plugins/MacVST/TapeDelay/source/TapeDelay.h index f5fcb6ce3..d1708fa60 100755 --- a/plugins/MacVST/TapeDelay/source/TapeDelay.h +++ b/plugins/MacVST/TapeDelay/source/TapeDelay.h @@ -66,8 +66,8 @@ private: int maxdelay; int chase; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/TapeDelay/source/TapeDelayProc.cpp b/plugins/MacVST/TapeDelay/source/TapeDelayProc.cpp index e2f1ade22..ef32867b9 100755 --- a/plugins/MacVST/TapeDelay/source/TapeDelayProc.cpp +++ b/plugins/MacVST/TapeDelay/source/TapeDelayProc.cpp @@ -35,8 +35,8 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -156,14 +156,14 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -202,8 +202,8 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -323,16 +323,14 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TapeDelay2/source/TapeDelay2.h b/plugins/MacVST/TapeDelay2/source/TapeDelay2.h index 5f9d9e7a3..178d356fb 100755 --- a/plugins/MacVST/TapeDelay2/source/TapeDelay2.h +++ b/plugins/MacVST/TapeDelay2/source/TapeDelay2.h @@ -62,16 +62,16 @@ private: double prevSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; double prevSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/MacVST/TapeDelay2/source/TapeDelay2Proc.cpp b/plugins/MacVST/TapeDelay2/source/TapeDelay2Proc.cpp index 3fbb9d938..a6b4e4b2d 100755 --- a/plugins/MacVST/TapeDelay2/source/TapeDelay2Proc.cpp +++ b/plugins/MacVST/TapeDelay2/source/TapeDelay2Proc.cpp @@ -62,12 +62,12 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -266,12 +266,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -283,7 +283,7 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -397,12 +397,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/TapeDither/source/TapeDitherProc.cpp b/plugins/MacVST/TapeDither/source/TapeDitherProc.cpp index 9011c04d9..4bf9003fd 100755 --- a/plugins/MacVST/TapeDither/source/TapeDitherProc.cpp +++ b/plugins/MacVST/TapeDither/source/TapeDitherProc.cpp @@ -30,8 +30,8 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -99,8 +99,8 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/TapeDust/source/TapeDust.cpp b/plugins/MacVST/TapeDust/source/TapeDust.cpp index 0ce16e093..11ff21768 100755 --- a/plugins/MacVST/TapeDust/source/TapeDust.cpp +++ b/plugins/MacVST/TapeDust/source/TapeDust.cpp @@ -22,8 +22,8 @@ TapeDust::TapeDust(audioMasterCallback audioMaster) : fR[count] = 0.0; } - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacVST/TapeDust/source/TapeDust.h b/plugins/MacVST/TapeDust/source/TapeDust.h index facbf408f..4918fdcb3 100755 --- a/plugins/MacVST/TapeDust/source/TapeDust.h +++ b/plugins/MacVST/TapeDust/source/TapeDust.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff diff --git a/plugins/MacVST/TapeDust/source/TapeDustProc.cpp b/plugins/MacVST/TapeDust/source/TapeDustProc.cpp index 429a3667f..9d7aceff9 100755 --- a/plugins/MacVST/TapeDust/source/TapeDustProc.cpp +++ b/plugins/MacVST/TapeDust/source/TapeDustProc.cpp @@ -13,8 +13,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -32,44 +32,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -118,14 +82,14 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -143,8 +107,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* in2 = inputs[1]; double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -162,44 +126,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -248,16 +176,14 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TapeFat/source/TapeFat.cpp b/plugins/MacVST/TapeFat/source/TapeFat.cpp index 26478dfe6..bcb1927b5 100755 --- a/plugins/MacVST/TapeFat/source/TapeFat.cpp +++ b/plugins/MacVST/TapeFat/source/TapeFat.cpp @@ -18,8 +18,8 @@ TapeFat::TapeFat(audioMasterCallback audioMaster) : for(int count = 0; count < 257; count++) {pL[count] = 0;pR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/TapeFat/source/TapeFat.h b/plugins/MacVST/TapeFat/source/TapeFat.h index 614ee47ff..0ce30222f 100755 --- a/plugins/MacVST/TapeFat/source/TapeFat.h +++ b/plugins/MacVST/TapeFat/source/TapeFat.h @@ -57,8 +57,8 @@ private: int pR[258]; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/TapeFat/source/TapeFatProc.cpp b/plugins/MacVST/TapeFat/source/TapeFatProc.cpp index 8eb0e98e9..7d0e52a57 100755 --- a/plugins/MacVST/TapeFat/source/TapeFatProc.cpp +++ b/plugins/MacVST/TapeFat/source/TapeFatProc.cpp @@ -25,8 +25,8 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -119,14 +119,14 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -156,8 +156,8 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -250,16 +250,14 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Thunder/source/Thunder.cpp b/plugins/MacVST/Thunder/source/Thunder.cpp index 7bc8226ab..b206dace5 100755 --- a/plugins/MacVST/Thunder/source/Thunder.cpp +++ b/plugins/MacVST/Thunder/source/Thunder.cpp @@ -15,8 +15,8 @@ Thunder::Thunder(audioMasterCallback audioMaster) : A = 0.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/MacVST/Thunder/source/Thunder.h b/plugins/MacVST/Thunder/source/Thunder.h index 9e49054f5..fc8bf411e 100755 --- a/plugins/MacVST/Thunder/source/Thunder.h +++ b/plugins/MacVST/Thunder/source/Thunder.h @@ -69,8 +69,8 @@ private: double iirSampleAM; double iirSampleBM; double iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/MacVST/Thunder/source/ThunderProc.cpp b/plugins/MacVST/Thunder/source/ThunderProc.cpp index 2cf454d35..ce6b41c13 100755 --- a/plugins/MacVST/Thunder/source/ThunderProc.cpp +++ b/plugins/MacVST/Thunder/source/ThunderProc.cpp @@ -40,51 +40,15 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -222,14 +186,14 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -275,51 +239,15 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -457,16 +385,14 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ToTape5/source/ToTape5.cpp b/plugins/MacVST/ToTape5/source/ToTape5.cpp index 6136aafb5..509c70874 100755 --- a/plugins/MacVST/ToTape5/source/ToTape5.cpp +++ b/plugins/MacVST/ToTape5/source/ToTape5.cpp @@ -98,8 +98,8 @@ ToTape5::ToTape5(audioMasterCallback audioMaster) : hcount = 0; flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ToTape5/source/ToTape5.h b/plugins/MacVST/ToTape5/source/ToTape5.h index d049014d6..b35426a07 100755 --- a/plugins/MacVST/ToTape5/source/ToTape5.h +++ b/plugins/MacVST/ToTape5/source/ToTape5.h @@ -140,8 +140,8 @@ private: double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ToTape5/source/ToTape5Proc.cpp b/plugins/MacVST/ToTape5/source/ToTape5Proc.cpp index 5824f8030..3db88a2ec 100755 --- a/plugins/MacVST/ToTape5/source/ToTape5Proc.cpp +++ b/plugins/MacVST/ToTape5/source/ToTape5Proc.cpp @@ -17,7 +17,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -63,52 +63,16 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -355,14 +319,14 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -384,7 +348,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -429,51 +393,15 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifierR; double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -720,16 +648,14 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ToTape6/source/ToTape6.h b/plugins/MacVST/ToTape6/source/ToTape6.h index fba651fd1..a613c4812 100755 --- a/plugins/MacVST/ToTape6/source/ToTape6.h +++ b/plugins/MacVST/ToTape6/source/ToTape6.h @@ -73,19 +73,19 @@ private: double iirMidRollerBR; double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/ToTape6/source/ToTape6Proc.cpp b/plugins/MacVST/ToTape6/source/ToTape6Proc.cpp index 1b4ff7de7..49e72323b 100755 --- a/plugins/MacVST/ToTape6/source/ToTape6Proc.cpp +++ b/plugins/MacVST/ToTape6/source/ToTape6Proc.cpp @@ -54,12 +54,12 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -74,7 +74,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -93,13 +93,13 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -201,15 +201,15 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -241,7 +241,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding @@ -388,12 +388,12 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -408,7 +408,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -427,13 +427,13 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -535,15 +535,15 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -575,7 +575,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/MacVST/ToVinyl4/source/ToVinyl4.cpp b/plugins/MacVST/ToVinyl4/source/ToVinyl4.cpp index 429187cf3..3d46fd518 100755 --- a/plugins/MacVST/ToVinyl4/source/ToVinyl4.cpp +++ b/plugins/MacVST/ToVinyl4/source/ToVinyl4.cpp @@ -87,8 +87,8 @@ ToVinyl4::ToVinyl4(audioMasterCallback audioMaster) : B = 0.3424051; //44.0 hz = ((B*B)*290)+10 (B*B)*290 = 34 (B*B) = 0.1172413 sqrt() = 0.3424051 C = 0.32; D = 0.064; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ToVinyl4/source/ToVinyl4.h b/plugins/MacVST/ToVinyl4/source/ToVinyl4.h index 6a2dc26ed..d1a7363eb 100755 --- a/plugins/MacVST/ToVinyl4/source/ToVinyl4.h +++ b/plugins/MacVST/ToVinyl4/source/ToVinyl4.h @@ -142,8 +142,8 @@ private: double bMidPrev; double bSidePrev; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ToVinyl4/source/ToVinyl4Proc.cpp b/plugins/MacVST/ToVinyl4/source/ToVinyl4Proc.cpp index a67af995f..1bb4c1841 100755 --- a/plugins/MacVST/ToVinyl4/source/ToVinyl4Proc.cpp +++ b/plugins/MacVST/ToVinyl4/source/ToVinyl4Proc.cpp @@ -217,44 +217,8 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -461,14 +425,14 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -689,44 +653,8 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -933,16 +861,14 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/ToneSlant/source/ToneSlant.cpp b/plugins/MacVST/ToneSlant/source/ToneSlant.cpp index d99fa60a7..6bc494340 100755 --- a/plugins/MacVST/ToneSlant/source/ToneSlant.cpp +++ b/plugins/MacVST/ToneSlant/source/ToneSlant.cpp @@ -15,8 +15,8 @@ ToneSlant::ToneSlant(audioMasterCallback audioMaster) : A = 0.0; B = 0.0; for(int count = 0; count < 102; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/ToneSlant/source/ToneSlant.h b/plugins/MacVST/ToneSlant/source/ToneSlant.h index 7c52bca20..ca55bbf14 100755 --- a/plugins/MacVST/ToneSlant/source/ToneSlant.h +++ b/plugins/MacVST/ToneSlant/source/ToneSlant.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/ToneSlant/source/ToneSlantProc.cpp b/plugins/MacVST/ToneSlant/source/ToneSlantProc.cpp index d78cfb574..7397d8aa4 100755 --- a/plugins/MacVST/ToneSlant/source/ToneSlantProc.cpp +++ b/plugins/MacVST/ToneSlant/source/ToneSlantProc.cpp @@ -48,44 +48,8 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -106,14 +70,14 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -165,44 +129,8 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -223,16 +151,14 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TransDesk/source/TransDesk.cpp b/plugins/MacVST/TransDesk/source/TransDesk.cpp index 3f352f7fe..d26434509 100755 --- a/plugins/MacVST/TransDesk/source/TransDesk.cpp +++ b/plugins/MacVST/TransDesk/source/TransDesk.cpp @@ -25,8 +25,8 @@ TransDesk::TransDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/TransDesk/source/TransDesk.h b/plugins/MacVST/TransDesk/source/TransDesk.h index 5729b4c4e..4657525a2 100755 --- a/plugins/MacVST/TransDesk/source/TransDesk.h +++ b/plugins/MacVST/TransDesk/source/TransDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[20]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[20]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacVST/TransDesk/source/TransDeskProc.cpp b/plugins/MacVST/TransDesk/source/TransDeskProc.cpp index c8b45c2d5..9768c73fb 100755 --- a/plugins/MacVST/TransDesk/source/TransDeskProc.cpp +++ b/plugins/MacVST/TransDesk/source/TransDeskProc.cpp @@ -40,53 +40,17 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -197,14 +161,14 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,53 +213,17 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -406,16 +334,14 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TremoSquare/source/TremoSquareProc.cpp b/plugins/MacVST/TremoSquare/source/TremoSquareProc.cpp index ef99feb16..1c627a8e6 100755 --- a/plugins/MacVST/TremoSquare/source/TremoSquareProc.cpp +++ b/plugins/MacVST/TremoSquare/source/TremoSquareProc.cpp @@ -23,12 +23,12 @@ void TremoSquare::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code @@ -92,12 +92,12 @@ void TremoSquare::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code diff --git a/plugins/MacVST/Tremolo/source/Tremolo.cpp b/plugins/MacVST/Tremolo/source/Tremolo.cpp index f0b649d78..b57f9ec20 100755 --- a/plugins/MacVST/Tremolo/source/Tremolo.cpp +++ b/plugins/MacVST/Tremolo/source/Tremolo.cpp @@ -21,8 +21,8 @@ Tremolo::Tremolo(audioMasterCallback audioMaster) : depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Tremolo/source/Tremolo.h b/plugins/MacVST/Tremolo/source/Tremolo.h index 11fc718fb..1f1d00675 100755 --- a/plugins/MacVST/Tremolo/source/Tremolo.h +++ b/plugins/MacVST/Tremolo/source/Tremolo.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sweep; diff --git a/plugins/MacVST/Tremolo/source/TremoloProc.cpp b/plugins/MacVST/Tremolo/source/TremoloProc.cpp index d27dc86c7..e63f0b044 100755 --- a/plugins/MacVST/Tremolo/source/TremoloProc.cpp +++ b/plugins/MacVST/Tremolo/source/TremoloProc.cpp @@ -38,53 +38,17 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -198,53 +162,17 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -309,16 +237,14 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/TripleSpread/source/TripleSpreadProc.cpp b/plugins/MacVST/TripleSpread/source/TripleSpreadProc.cpp index 09b8dd534..6bd70e790 100755 --- a/plugins/MacVST/TripleSpread/source/TripleSpreadProc.cpp +++ b/plugins/MacVST/TripleSpread/source/TripleSpreadProc.cpp @@ -21,12 +21,12 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -291,8 +291,8 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; @@ -340,12 +340,12 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -610,8 +610,8 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/MacVST/Tube/source/Tube.h b/plugins/MacVST/Tube/source/Tube.h index d44d0e3ab..c423e2802 100755 --- a/plugins/MacVST/Tube/source/Tube.h +++ b/plugins/MacVST/Tube/source/Tube.h @@ -52,10 +52,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Tube/source/TubeProc.cpp b/plugins/MacVST/Tube/source/TubeProc.cpp index 8952b4238..068a6ea5e 100755 --- a/plugins/MacVST/Tube/source/TubeProc.cpp +++ b/plugins/MacVST/Tube/source/TubeProc.cpp @@ -33,13 +33,13 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -87,7 +87,7 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -138,13 +138,13 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -192,19 +192,19 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Tube2/source/Tube2.h b/plugins/MacVST/Tube2/source/Tube2.h index 24f7f73cd..80bfcc84b 100755 --- a/plugins/MacVST/Tube2/source/Tube2.h +++ b/plugins/MacVST/Tube2/source/Tube2.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; - long double previousSampleE; - long double previousSampleF; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; + double previousSampleE; + double previousSampleF; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/Tube2/source/Tube2Proc.cpp b/plugins/MacVST/Tube2/source/Tube2Proc.cpp index 33dc4d827..e3c528b96 100755 --- a/plugins/MacVST/Tube2/source/Tube2Proc.cpp +++ b/plugins/MacVST/Tube2/source/Tube2Proc.cpp @@ -27,10 +27,10 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -38,7 +38,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -51,7 +51,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -84,7 +84,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -92,9 +92,9 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -107,7 +107,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -158,10 +158,10 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -169,7 +169,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -182,7 +182,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -215,7 +215,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -223,9 +223,9 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -238,7 +238,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -251,12 +251,12 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end hysteresis and spiky fuzz section //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/TubeDesk/source/TubeDesk.cpp b/plugins/MacVST/TubeDesk/source/TubeDesk.cpp index 5a7465c3b..5a42bb4aa 100755 --- a/plugins/MacVST/TubeDesk/source/TubeDesk.cpp +++ b/plugins/MacVST/TubeDesk/source/TubeDesk.cpp @@ -25,8 +25,8 @@ TubeDesk::TubeDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/TubeDesk/source/TubeDesk.h b/plugins/MacVST/TubeDesk/source/TubeDesk.h index fb15768fb..7ef3e35be 100755 --- a/plugins/MacVST/TubeDesk/source/TubeDesk.h +++ b/plugins/MacVST/TubeDesk/source/TubeDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[5000]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[5000]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/MacVST/TubeDesk/source/TubeDeskProc.cpp b/plugins/MacVST/TubeDesk/source/TubeDeskProc.cpp index cccf6e2cc..72b8fe2c7 100755 --- a/plugins/MacVST/TubeDesk/source/TubeDeskProc.cpp +++ b/plugins/MacVST/TubeDesk/source/TubeDeskProc.cpp @@ -39,53 +39,17 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -196,14 +160,14 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,53 +211,17 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -404,16 +332,14 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/UltrasonX/source/UltrasonX.h b/plugins/MacVST/UltrasonX/source/UltrasonX.h index 439c12866..dccd0df88 100755 --- a/plugins/MacVST/UltrasonX/source/UltrasonX.h +++ b/plugins/MacVST/UltrasonX/source/UltrasonX.h @@ -66,7 +66,7 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/UltrasonX/source/UltrasonXProc.cpp b/plugins/MacVST/UltrasonX/source/UltrasonXProc.cpp index 8a0955704..09a93d0a6 100755 --- a/plugins/MacVST/UltrasonX/source/UltrasonXProc.cpp +++ b/plugins/MacVST/UltrasonX/source/UltrasonXProc.cpp @@ -34,8 +34,8 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -45,12 +45,12 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -105,8 +105,8 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -116,12 +116,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -131,12 +131,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = temp; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Ultrasonic/source/Ultrasonic.h b/plugins/MacVST/Ultrasonic/source/Ultrasonic.h index 929c3c8aa..f853b70e2 100755 --- a/plugins/MacVST/Ultrasonic/source/Ultrasonic.h +++ b/plugins/MacVST/Ultrasonic/source/Ultrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/MacVST/Ultrasonic/source/UltrasonicProc.cpp b/plugins/MacVST/Ultrasonic/source/UltrasonicProc.cpp index 7049da762..0bb52e5e0 100755 --- a/plugins/MacVST/Ultrasonic/source/UltrasonicProc.cpp +++ b/plugins/MacVST/Ultrasonic/source/UltrasonicProc.cpp @@ -63,12 +63,12 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacVST/UltrasonicLite/source/UltrasonicLite.h b/plugins/MacVST/UltrasonicLite/source/UltrasonicLite.h index 73fb675ad..59fd77310 100755 --- a/plugins/MacVST/UltrasonicLite/source/UltrasonicLite.h +++ b/plugins/MacVST/UltrasonicLite/source/UltrasonicLite.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/UltrasonicLite/source/UltrasonicLiteProc.cpp b/plugins/MacVST/UltrasonicLite/source/UltrasonicLiteProc.cpp index bd62ec460..8bf48c273 100755 --- a/plugins/MacVST/UltrasonicLite/source/UltrasonicLiteProc.cpp +++ b/plugins/MacVST/UltrasonicLite/source/UltrasonicLiteProc.cpp @@ -28,15 +28,15 @@ void UltrasonicLite::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 32 bit stereo floating point dither @@ -79,15 +79,15 @@ void UltrasonicLite::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 64 bit stereo floating point dither diff --git a/plugins/MacVST/UltrasonicMed/source/UltrasonicMed.h b/plugins/MacVST/UltrasonicMed/source/UltrasonicMed.h index ca6b4f9d1..0a3552480 100755 --- a/plugins/MacVST/UltrasonicMed/source/UltrasonicMed.h +++ b/plugins/MacVST/UltrasonicMed/source/UltrasonicMed.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpd; //default stuff diff --git a/plugins/MacVST/UltrasonicMed/source/UltrasonicMedProc.cpp b/plugins/MacVST/UltrasonicMed/source/UltrasonicMedProc.cpp index 9c584ac7c..152e5b0ce 100755 --- a/plugins/MacVST/UltrasonicMed/source/UltrasonicMedProc.cpp +++ b/plugins/MacVST/UltrasonicMed/source/UltrasonicMedProc.cpp @@ -41,18 +41,18 @@ void UltrasonicMed::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -111,18 +111,18 @@ void UltrasonicMed::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/MacVST/UnBox/source/UnBox.h b/plugins/MacVST/UnBox/source/UnBox.h index 73cb40f6b..0de78a63d 100755 --- a/plugins/MacVST/UnBox/source/UnBox.h +++ b/plugins/MacVST/UnBox/source/UnBox.h @@ -56,18 +56,18 @@ private: uint32_t fpd; //default stuff - long double aL[5]; - long double bL[5]; - long double cL[11]; - long double aR[5]; - long double bR[5]; - long double cR[11]; - long double e[5]; - long double f[11]; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; + double aL[5]; + double bL[5]; + double cL[11]; + double aR[5]; + double bR[5]; + double cR[11]; + double e[5]; + double f[11]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; float A; diff --git a/plugins/MacVST/UnBox/source/UnBoxProc.cpp b/plugins/MacVST/UnBox/source/UnBoxProc.cpp index 40585b3ce..e45e21e08 100755 --- a/plugins/MacVST/UnBox/source/UnBoxProc.cpp +++ b/plugins/MacVST/UnBox/source/UnBoxProc.cpp @@ -68,16 +68,16 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -130,7 +130,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -146,7 +146,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; @@ -265,16 +265,16 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -327,7 +327,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -343,7 +343,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; diff --git a/plugins/MacVST/VariMu/source/VariMu.cpp b/plugins/MacVST/VariMu/source/VariMu.cpp index c4d63b29e..e71b73000 100755 --- a/plugins/MacVST/VariMu/source/VariMu.cpp +++ b/plugins/MacVST/VariMu/source/VariMu.cpp @@ -32,8 +32,8 @@ VariMu::VariMu(audioMasterCallback audioMaster) : B = 0.5; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/VariMu/source/VariMu.h b/plugins/MacVST/VariMu/source/VariMu.h index d79dff11b..d06ae8cfc 100755 --- a/plugins/MacVST/VariMu/source/VariMu.h +++ b/plugins/MacVST/VariMu/source/VariMu.h @@ -74,8 +74,8 @@ private: double previousR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/VariMu/source/VariMuProc.cpp b/plugins/MacVST/VariMu/source/VariMuProc.cpp index 323b5e490..a4482761f 100755 --- a/plugins/MacVST/VariMu/source/VariMuProc.cpp +++ b/plugins/MacVST/VariMu/source/VariMuProc.cpp @@ -31,15 +31,15 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -233,14 +233,14 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -276,15 +276,15 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -322,8 +322,8 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -478,16 +478,14 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/Verbity/source/VerbityProc.cpp b/plugins/MacVST/Verbity/source/VerbityProc.cpp index 9a719ea4d..286a798c8 100755 --- a/plugins/MacVST/Verbity/source/VerbityProc.cpp +++ b/plugins/MacVST/Verbity/source/VerbityProc.cpp @@ -56,12 +56,12 @@ void Verbity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -292,12 +292,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -461,12 +461,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/Vibrato/source/VibratoProc.cpp b/plugins/MacVST/Vibrato/source/VibratoProc.cpp index 551fb2d09..150da0987 100755 --- a/plugins/MacVST/Vibrato/source/VibratoProc.cpp +++ b/plugins/MacVST/Vibrato/source/VibratoProc.cpp @@ -22,8 +22,8 @@ void Vibrato::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; double drySampleL = inputSampleL; @@ -120,8 +120,8 @@ void Vibrato::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; double drySampleL = inputSampleL; diff --git a/plugins/MacVST/VinylDither/source/VinylDitherProc.cpp b/plugins/MacVST/VinylDither/source/VinylDitherProc.cpp index f6cd4e85b..d73eece2d 100755 --- a/plugins/MacVST/VinylDither/source/VinylDitherProc.cpp +++ b/plugins/MacVST/VinylDither/source/VinylDitherProc.cpp @@ -30,8 +30,8 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -169,8 +169,8 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp index 19f1d9493..ac1ed8939 100755 --- a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp +++ b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.cpp @@ -28,8 +28,8 @@ VoiceOfTheStarship::VoiceOfTheStarship(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h index 519923b71..51c66c043 100755 --- a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h +++ b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarship.h @@ -73,8 +73,8 @@ private: int lastAlgorithm; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp index bbb14faf6..dda1805dc 100755 --- a/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp +++ b/plugins/MacVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp @@ -178,14 +178,14 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn filterflip = !filterflip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -367,16 +367,14 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output flipR = !flipR; filterflip = !filterflip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/VoiceTrick/source/VoiceTrickProc.cpp b/plugins/MacVST/VoiceTrick/source/VoiceTrickProc.cpp index b57b695de..0de1f49ae 100755 --- a/plugins/MacVST/VoiceTrick/source/VoiceTrickProc.cpp +++ b/plugins/MacVST/VoiceTrick/source/VoiceTrickProc.cpp @@ -23,8 +23,8 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -32,7 +32,7 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) @@ -126,8 +126,8 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -135,7 +135,7 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/MacVST/Wider/source/Wider.cpp b/plugins/MacVST/Wider/source/Wider.cpp index 26d4d47d5..a7cb54608 100755 --- a/plugins/MacVST/Wider/source/Wider.cpp +++ b/plugins/MacVST/Wider/source/Wider.cpp @@ -17,8 +17,8 @@ Wider::Wider(audioMasterCallback audioMaster) : C = 1.0; for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/Wider/source/Wider.h b/plugins/MacVST/Wider/source/Wider.h index 6a6a2dfc5..a79fa43f0 100755 --- a/plugins/MacVST/Wider/source/Wider.h +++ b/plugins/MacVST/Wider/source/Wider.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double p[4099]; diff --git a/plugins/MacVST/Wider/source/WiderProc.cpp b/plugins/MacVST/Wider/source/WiderProc.cpp index f90fa210c..d860ce370 100755 --- a/plugins/MacVST/Wider/source/WiderProc.cpp +++ b/plugins/MacVST/Wider/source/WiderProc.cpp @@ -18,12 +18,12 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -46,44 +46,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -138,14 +102,14 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,12 +132,12 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -196,44 +160,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -288,16 +216,14 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/XBandpass/source/XBandpass.h b/plugins/MacVST/XBandpass/source/XBandpass.h index 144855c8b..d03811383 100755 --- a/plugins/MacVST/XBandpass/source/XBandpass.h +++ b/plugins/MacVST/XBandpass/source/XBandpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/XBandpass/source/XBandpassProc.cpp b/plugins/MacVST/XBandpass/source/XBandpassProc.cpp index 4540db0df..53f7c5f2a 100755 --- a/plugins/MacVST/XBandpass/source/XBandpassProc.cpp +++ b/plugins/MacVST/XBandpass/source/XBandpassProc.cpp @@ -46,24 +46,24 @@ void XBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -221,24 +221,24 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -339,12 +339,12 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/XHighpass/source/XHighpass.h b/plugins/MacVST/XHighpass/source/XHighpass.h index 54165b3e0..8001ab17b 100755 --- a/plugins/MacVST/XHighpass/source/XHighpass.h +++ b/plugins/MacVST/XHighpass/source/XHighpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/XHighpass/source/XHighpassProc.cpp b/plugins/MacVST/XHighpass/source/XHighpassProc.cpp index 7fb2f3100..dd6a8d08e 100755 --- a/plugins/MacVST/XHighpass/source/XHighpassProc.cpp +++ b/plugins/MacVST/XHighpass/source/XHighpassProc.cpp @@ -44,24 +44,24 @@ void XHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -197,24 +197,24 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -295,12 +295,12 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/XLowpass/source/XLowpass.h b/plugins/MacVST/XLowpass/source/XLowpass.h index 928e6d0b4..dac60bc2a 100755 --- a/plugins/MacVST/XLowpass/source/XLowpass.h +++ b/plugins/MacVST/XLowpass/source/XLowpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/XLowpass/source/XLowpassProc.cpp b/plugins/MacVST/XLowpass/source/XLowpassProc.cpp index a2b71cb1b..48ea9f36b 100755 --- a/plugins/MacVST/XLowpass/source/XLowpassProc.cpp +++ b/plugins/MacVST/XLowpass/source/XLowpassProc.cpp @@ -47,24 +47,24 @@ void XLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -223,24 +223,24 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -341,12 +341,12 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/XNotch/source/XNotch.h b/plugins/MacVST/XNotch/source/XNotch.h index e83b2c356..85a0781d7 100755 --- a/plugins/MacVST/XNotch/source/XNotch.h +++ b/plugins/MacVST/XNotch/source/XNotch.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/XNotch/source/XNotchProc.cpp b/plugins/MacVST/XNotch/source/XNotchProc.cpp index efccb1de8..3e867df7b 100755 --- a/plugins/MacVST/XNotch/source/XNotchProc.cpp +++ b/plugins/MacVST/XNotch/source/XNotchProc.cpp @@ -44,24 +44,24 @@ void XNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -223,24 +223,24 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -347,12 +347,12 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/XRegion/source/XRegion.h b/plugins/MacVST/XRegion/source/XRegion.h index e42abe2b3..5234fc31c 100755 --- a/plugins/MacVST/XRegion/source/XRegion.h +++ b/plugins/MacVST/XRegion/source/XRegion.h @@ -56,11 +56,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacVST/XRegion/source/XRegionProc.cpp b/plugins/MacVST/XRegion/source/XRegionProc.cpp index 3c7f95e46..a65f234e8 100755 --- a/plugins/MacVST/XRegion/source/XRegionProc.cpp +++ b/plugins/MacVST/XRegion/source/XRegionProc.cpp @@ -96,24 +96,24 @@ void XRegion::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -338,24 +338,24 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -473,12 +473,12 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/YBandpass/source/YBandpass.h b/plugins/MacVST/YBandpass/source/YBandpass.h index 903d563dc..e72e50d43 100755 --- a/plugins/MacVST/YBandpass/source/YBandpass.h +++ b/plugins/MacVST/YBandpass/source/YBandpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/YBandpass/source/YBandpassProc.cpp b/plugins/MacVST/YBandpass/source/YBandpassProc.cpp index bf9b2aa2b..efdf576b5 100755 --- a/plugins/MacVST/YBandpass/source/YBandpassProc.cpp +++ b/plugins/MacVST/YBandpass/source/YBandpassProc.cpp @@ -66,23 +66,23 @@ void YBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/YHighpass/source/YHighpass.h b/plugins/MacVST/YHighpass/source/YHighpass.h index 05eb71a64..079d3bc00 100755 --- a/plugins/MacVST/YHighpass/source/YHighpass.h +++ b/plugins/MacVST/YHighpass/source/YHighpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/YHighpass/source/YHighpassProc.cpp b/plugins/MacVST/YHighpass/source/YHighpassProc.cpp index 3333b4158..60626324f 100755 --- a/plugins/MacVST/YHighpass/source/YHighpassProc.cpp +++ b/plugins/MacVST/YHighpass/source/YHighpassProc.cpp @@ -66,23 +66,23 @@ void YHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/YLowpass/source/YLowpass.h b/plugins/MacVST/YLowpass/source/YLowpass.h index ac52c3738..564336a3b 100755 --- a/plugins/MacVST/YLowpass/source/YLowpass.h +++ b/plugins/MacVST/YLowpass/source/YLowpass.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/YLowpass/source/YLowpassProc.cpp b/plugins/MacVST/YLowpass/source/YLowpassProc.cpp index 86343995d..a4c489f53 100755 --- a/plugins/MacVST/YLowpass/source/YLowpassProc.cpp +++ b/plugins/MacVST/YLowpass/source/YLowpassProc.cpp @@ -66,23 +66,23 @@ void YLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/YNotch/source/YNotch.h b/plugins/MacVST/YNotch/source/YNotch.h index 3a7074bec..e699edb1f 100755 --- a/plugins/MacVST/YNotch/source/YNotch.h +++ b/plugins/MacVST/YNotch/source/YNotch.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/YNotch/source/YNotchProc.cpp b/plugins/MacVST/YNotch/source/YNotchProc.cpp index ef6b9c773..f3535a645 100755 --- a/plugins/MacVST/YNotch/source/YNotchProc.cpp +++ b/plugins/MacVST/YNotch/source/YNotchProc.cpp @@ -65,23 +65,23 @@ void YNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -218,23 +218,23 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -295,12 +295,12 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZBandpass/source/ZBandpass.h b/plugins/MacVST/ZBandpass/source/ZBandpass.h index febc1562b..6dd973ab7 100755 --- a/plugins/MacVST/ZBandpass/source/ZBandpass.h +++ b/plugins/MacVST/ZBandpass/source/ZBandpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZBandpass/source/ZBandpassProc.cpp b/plugins/MacVST/ZBandpass/source/ZBandpassProc.cpp index 1345861c0..ab264eb48 100755 --- a/plugins/MacVST/ZBandpass/source/ZBandpassProc.cpp +++ b/plugins/MacVST/ZBandpass/source/ZBandpassProc.cpp @@ -63,18 +63,18 @@ void ZBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -254,18 +254,18 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -371,12 +371,12 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZBandpass2/source/ZBandpass2.h b/plugins/MacVST/ZBandpass2/source/ZBandpass2.h index 8aae72342..35e06499f 100755 --- a/plugins/MacVST/ZBandpass2/source/ZBandpass2.h +++ b/plugins/MacVST/ZBandpass2/source/ZBandpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZBandpass2/source/ZBandpass2Proc.cpp b/plugins/MacVST/ZBandpass2/source/ZBandpass2Proc.cpp index 641a5634a..60ec7317e 100755 --- a/plugins/MacVST/ZBandpass2/source/ZBandpass2Proc.cpp +++ b/plugins/MacVST/ZBandpass2/source/ZBandpass2Proc.cpp @@ -62,16 +62,16 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZHighpass/source/ZHighpass.h b/plugins/MacVST/ZHighpass/source/ZHighpass.h index 3985b75ae..fc00f8ff8 100755 --- a/plugins/MacVST/ZHighpass/source/ZHighpass.h +++ b/plugins/MacVST/ZHighpass/source/ZHighpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZHighpass/source/ZHighpassProc.cpp b/plugins/MacVST/ZHighpass/source/ZHighpassProc.cpp index 43ed909bb..09a18cfb2 100755 --- a/plugins/MacVST/ZHighpass/source/ZHighpassProc.cpp +++ b/plugins/MacVST/ZHighpass/source/ZHighpassProc.cpp @@ -61,18 +61,18 @@ void ZHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -243,18 +243,18 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -355,12 +355,12 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZHighpass2/source/ZHighpass2.h b/plugins/MacVST/ZHighpass2/source/ZHighpass2.h index d5bb73f3a..7c8d3a52f 100755 --- a/plugins/MacVST/ZHighpass2/source/ZHighpass2.h +++ b/plugins/MacVST/ZHighpass2/source/ZHighpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZHighpass2/source/ZHighpass2Proc.cpp b/plugins/MacVST/ZHighpass2/source/ZHighpass2Proc.cpp index 7bb5b9a99..5add1560b 100755 --- a/plugins/MacVST/ZHighpass2/source/ZHighpass2Proc.cpp +++ b/plugins/MacVST/ZHighpass2/source/ZHighpass2Proc.cpp @@ -62,16 +62,16 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZLowpass/source/ZLowpass.h b/plugins/MacVST/ZLowpass/source/ZLowpass.h index d32901e01..3939e781b 100755 --- a/plugins/MacVST/ZLowpass/source/ZLowpass.h +++ b/plugins/MacVST/ZLowpass/source/ZLowpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZLowpass/source/ZLowpassProc.cpp b/plugins/MacVST/ZLowpass/source/ZLowpassProc.cpp index 728f25dde..c5df9e840 100755 --- a/plugins/MacVST/ZLowpass/source/ZLowpassProc.cpp +++ b/plugins/MacVST/ZLowpass/source/ZLowpassProc.cpp @@ -63,18 +63,18 @@ void ZLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZLowpass2/source/ZLowpass2.h b/plugins/MacVST/ZLowpass2/source/ZLowpass2.h index b093df0e7..1f51c3c2e 100755 --- a/plugins/MacVST/ZLowpass2/source/ZLowpass2.h +++ b/plugins/MacVST/ZLowpass2/source/ZLowpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZLowpass2/source/ZLowpass2Proc.cpp b/plugins/MacVST/ZLowpass2/source/ZLowpass2Proc.cpp index 61bc55947..415ca5f47 100755 --- a/plugins/MacVST/ZLowpass2/source/ZLowpass2Proc.cpp +++ b/plugins/MacVST/ZLowpass2/source/ZLowpass2Proc.cpp @@ -62,16 +62,16 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZNotch/source/ZNotch.h b/plugins/MacVST/ZNotch/source/ZNotch.h index 603ffa4ec..e493e40f6 100755 --- a/plugins/MacVST/ZNotch/source/ZNotch.h +++ b/plugins/MacVST/ZNotch/source/ZNotch.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZNotch/source/ZNotchProc.cpp b/plugins/MacVST/ZNotch/source/ZNotchProc.cpp index a5eaba61e..37871fa0e 100755 --- a/plugins/MacVST/ZNotch/source/ZNotchProc.cpp +++ b/plugins/MacVST/ZNotch/source/ZNotchProc.cpp @@ -63,18 +63,18 @@ void ZNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/ZNotch2/source/ZNotch2.h b/plugins/MacVST/ZNotch2/source/ZNotch2.h index 3dde478ea..f23bf7b0d 100755 --- a/plugins/MacVST/ZNotch2/source/ZNotch2.h +++ b/plugins/MacVST/ZNotch2/source/ZNotch2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/MacVST/ZNotch2/source/ZNotch2Proc.cpp b/plugins/MacVST/ZNotch2/source/ZNotch2Proc.cpp index 9e9443722..1e2f92745 100755 --- a/plugins/MacVST/ZNotch2/source/ZNotch2Proc.cpp +++ b/plugins/MacVST/ZNotch2/source/ZNotch2Proc.cpp @@ -62,16 +62,16 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacVST/curve/source/curve.h b/plugins/MacVST/curve/source/curve.h index b1c313eec..4dd52f8e7 100755 --- a/plugins/MacVST/curve/source/curve.h +++ b/plugins/MacVST/curve/source/curve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff }; diff --git a/plugins/MacVST/curve/source/curveProc.cpp b/plugins/MacVST/curve/source/curveProc.cpp index d7739b806..3a3f18b86 100755 --- a/plugins/MacVST/curve/source/curveProc.cpp +++ b/plugins/MacVST/curve/source/curveProc.cpp @@ -16,8 +16,8 @@ void curve::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -65,8 +65,8 @@ void curve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/MacVST/uLawDecode/source/uLawDecode.cpp b/plugins/MacVST/uLawDecode/source/uLawDecode.cpp index 234bc6cff..e1dd5cc6e 100755 --- a/plugins/MacVST/uLawDecode/source/uLawDecode.cpp +++ b/plugins/MacVST/uLawDecode/source/uLawDecode.cpp @@ -14,8 +14,8 @@ uLawDecode::uLawDecode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/uLawDecode/source/uLawDecode.h b/plugins/MacVST/uLawDecode/source/uLawDecode.h index ec3f23285..fb74bcdba 100755 --- a/plugins/MacVST/uLawDecode/source/uLawDecode.h +++ b/plugins/MacVST/uLawDecode/source/uLawDecode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/uLawDecode/source/uLawDecodeProc.cpp b/plugins/MacVST/uLawDecode/source/uLawDecodeProc.cpp index 18356232c..0c0ee1f1f 100755 --- a/plugins/MacVST/uLawDecode/source/uLawDecodeProc.cpp +++ b/plugins/MacVST/uLawDecode/source/uLawDecodeProc.cpp @@ -24,8 +24,8 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacVST/uLawEncode/source/uLawEncode.cpp b/plugins/MacVST/uLawEncode/source/uLawEncode.cpp index 0c062b676..e4f3de546 100755 --- a/plugins/MacVST/uLawEncode/source/uLawEncode.cpp +++ b/plugins/MacVST/uLawEncode/source/uLawEncode.cpp @@ -14,8 +14,8 @@ uLawEncode::uLawEncode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacVST/uLawEncode/source/uLawEncode.h b/plugins/MacVST/uLawEncode/source/uLawEncode.h index a8c6858f7..41d0d6008 100755 --- a/plugins/MacVST/uLawEncode/source/uLawEncode.h +++ b/plugins/MacVST/uLawEncode/source/uLawEncode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacVST/uLawEncode/source/uLawEncodeProc.cpp b/plugins/MacVST/uLawEncode/source/uLawEncodeProc.cpp index c5dd74d76..7f0eb12cd 100755 --- a/plugins/MacVST/uLawEncode/source/uLawEncodeProc.cpp +++ b/plugins/MacVST/uLawEncode/source/uLawEncodeProc.cpp @@ -24,8 +24,8 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ADClip7/ADClip7.cpp b/plugins/WinVST/ADClip7/ADClip7.cpp index 7ebc8179d..9f8bc2c88 100755 --- a/plugins/WinVST/ADClip7/ADClip7.cpp +++ b/plugins/WinVST/ADClip7/ADClip7.cpp @@ -30,8 +30,8 @@ ADClip7::ADClip7(audioMasterCallback audioMaster) : iirLowsBL = 0.0; iirLowsBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ADClip7/ADClip7.h b/plugins/WinVST/ADClip7/ADClip7.h index f0cde6cf7..6a619cd09 100755 --- a/plugins/WinVST/ADClip7/ADClip7.h +++ b/plugins/WinVST/ADClip7/ADClip7.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; float bL[22200]; float bR[22200]; int gcount; @@ -69,8 +69,8 @@ private: double iirLowsAR; double iirLowsBL; double iirLowsBR; - long double refclipL; - long double refclipR; + double refclipL; + double refclipR; float A; float B; diff --git a/plugins/WinVST/ADClip7/ADClip7Proc.cpp b/plugins/WinVST/ADClip7/ADClip7Proc.cpp index abc9909d5..db5a449b0 100755 --- a/plugins/WinVST/ADClip7/ADClip7Proc.cpp +++ b/plugins/WinVST/ADClip7/ADClip7Proc.cpp @@ -17,8 +17,8 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -28,7 +28,7 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -55,51 +55,15 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -447,14 +411,14 @@ void ADClip7::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,8 +440,8 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double inputGain = pow(10.0,(A*18.0)/20.0); double softness = B * fpNew; double hardness = 1.0 - softness; @@ -487,7 +451,7 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double calibsubs = subslift/53; double invcalibsubs = 1.0 - calibsubs; double subs = 0.81 + (calibsubs*2); - long double bridgerectifier; + double bridgerectifier; int mode = (int) floor(D*2.999)+1; double overshootL; double overshootR; @@ -514,52 +478,16 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double highsR = 0.0; int count = 0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -907,16 +835,14 @@ void ADClip7::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleR < -refclipR) inputSampleR = -refclipR; //final iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ADT/ADTProc.cpp b/plugins/WinVST/ADT/ADTProc.cpp index 828579d06..555f0877e 100755 --- a/plugins/WinVST/ADT/ADTProc.cpp +++ b/plugins/WinVST/ADT/ADTProc.cpp @@ -29,8 +29,8 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp index 9b8422125..a96f32802 100755 --- a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp @@ -57,8 +57,8 @@ AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h index 40cfab209..862629b6b 100755 --- a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h @@ -115,8 +115,8 @@ private: double RiirSampleD; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp index cc282b6dd..6ddecdf61 100755 --- a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp @@ -42,51 +42,15 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -407,14 +371,14 @@ void AQuickVoiceClip::processReplacing(float **inputs, float **outputs, VstInt32 if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); @@ -474,51 +438,15 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, double RdrySample; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LpassThrough = LataDrySample = inputSampleL; RpassThrough = RataDrySample = inputSampleR; @@ -839,16 +767,14 @@ void AQuickVoiceClip::processDoubleReplacing(double **inputs, double **outputs, if (LlpDepth < 0.0) LlpDepth = 0.0; if (RlpDepth < 0.0) RlpDepth = 0.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither inputSampleL *= (1.0-LmaxRecent); inputSampleR *= (1.0-RmaxRecent); diff --git a/plugins/WinVST/Acceleration/Acceleration.cpp b/plugins/WinVST/Acceleration/Acceleration.cpp index b2721d922..a2d27752d 100755 --- a/plugins/WinVST/Acceleration/Acceleration.cpp +++ b/plugins/WinVST/Acceleration/Acceleration.cpp @@ -23,8 +23,8 @@ Acceleration::Acceleration(audioMasterCallback audioMaster) : o1R = o2R = o3R = 0.0; m1R = m2R = desR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Acceleration/Acceleration.h b/plugins/WinVST/Acceleration/Acceleration.h index 02a3760ba..4e4dea014 100755 --- a/plugins/WinVST/Acceleration/Acceleration.h +++ b/plugins/WinVST/Acceleration/Acceleration.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double ataLastOutL; double s1L; diff --git a/plugins/WinVST/Acceleration/AccelerationProc.cpp b/plugins/WinVST/Acceleration/AccelerationProc.cpp index 0151dbeb1..050c433ca 100755 --- a/plugins/WinVST/Acceleration/AccelerationProc.cpp +++ b/plugins/WinVST/Acceleration/AccelerationProc.cpp @@ -29,51 +29,15 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -132,14 +96,14 @@ void Acceleration::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -173,51 +137,15 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst double accumulatorSample; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -276,16 +204,14 @@ void Acceleration::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Acceleration2/Acceleration2.h b/plugins/WinVST/Acceleration2/Acceleration2.h index e16c92d77..ee3a7e56f 100755 --- a/plugins/WinVST/Acceleration2/Acceleration2.h +++ b/plugins/WinVST/Acceleration2/Acceleration2.h @@ -64,8 +64,8 @@ private: double m1R; double m2R; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Acceleration2/Acceleration2Proc.cpp b/plugins/WinVST/Acceleration2/Acceleration2Proc.cpp index 575e70a23..49ece8844 100755 --- a/plugins/WinVST/Acceleration2/Acceleration2Proc.cpp +++ b/plugins/WinVST/Acceleration2/Acceleration2Proc.cpp @@ -46,14 +46,14 @@ void Acceleration2::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -151,14 +151,14 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); double smoothL = tempSample; //like mono AU, 7 and 8 store L channel @@ -199,12 +199,12 @@ void Acceleration2::processDoubleReplacing(double **inputs, double **outputs, Vs } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Air/Air.cpp b/plugins/WinVST/Air/Air.cpp index ea52c265c..5ad55b387 100755 --- a/plugins/WinVST/Air/Air.cpp +++ b/plugins/WinVST/Air/Air.cpp @@ -61,8 +61,8 @@ Air::Air(audioMasterCallback audioMaster) : D = 0.0; E = 1.0; F = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Air/Air.h b/plugins/WinVST/Air/Air.h index a713cf275..9432f792b 100755 --- a/plugins/WinVST/Air/Air.h +++ b/plugins/WinVST/Air/Air.h @@ -100,8 +100,8 @@ private: bool flop; int count; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Air/AirProc.cpp b/plugins/WinVST/Air/AirProc.cpp index f5eb39fde..9e72d87e2 100755 --- a/plugins/WinVST/Air/AirProc.cpp +++ b/plugins/WinVST/Air/AirProc.cpp @@ -23,8 +23,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -34,44 +34,8 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -257,14 +221,14 @@ void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -292,8 +256,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double correctionL; @@ -303,44 +267,8 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -526,16 +454,14 @@ void Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Air2/Air2.h b/plugins/WinVST/Air2/Air2.h index b50e7c919..5fa7a5325 100644 --- a/plugins/WinVST/Air2/Air2.h +++ b/plugins/WinVST/Air2/Air2.h @@ -106,7 +106,7 @@ private: bool flipB; bool flop; int count; - long double postsine; + double postsine; float A; diff --git a/plugins/WinVST/Air2/Air2Proc.cpp b/plugins/WinVST/Air2/Air2Proc.cpp index 16b6ae552..e07abffda 100644 --- a/plugins/WinVST/Air2/Air2Proc.cpp +++ b/plugins/WinVST/Air2/Air2Proc.cpp @@ -44,17 +44,17 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -190,7 +190,7 @@ void Air2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -333,17 +333,17 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(hiIntensity) > 0.0001) { airFactorCL = airPrevCL - inputSampleL; airFactorCR = airPrevCR - inputSampleR; @@ -479,7 +479,7 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa correctionL *= intensity; correctionL -= 1.0; - long double bridgerectifier = fabs(correctionL); + double bridgerectifier = fabs(correctionL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (correctionL > 0) correctionL = bridgerectifier; @@ -568,12 +568,12 @@ void Air2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Apicolypse/ApicolypseProc.cpp b/plugins/WinVST/Apicolypse/ApicolypseProc.cpp index b6cdb8513..bc9e99ab5 100755 --- a/plugins/WinVST/Apicolypse/ApicolypseProc.cpp +++ b/plugins/WinVST/Apicolypse/ApicolypseProc.cpp @@ -37,8 +37,8 @@ void Apicolypse::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -213,8 +213,8 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h b/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h index 79a5d23d8..ebaf0919c 100755 --- a/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h +++ b/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/WinVST/AtmosphereBuss/AtmosphereBussProc.cpp b/plugins/WinVST/AtmosphereBuss/AtmosphereBussProc.cpp index 16d7a3198..add056764 100755 --- a/plugins/WinVST/AtmosphereBuss/AtmosphereBussProc.cpp +++ b/plugins/WinVST/AtmosphereBuss/AtmosphereBussProc.cpp @@ -18,10 +18,10 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -249,14 +249,14 @@ void AtmosphereBuss::processReplacing(float **inputs, float **outputs, VstInt32 lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -279,10 +279,10 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -510,16 +510,14 @@ void AtmosphereBuss::processDoubleReplacing(double **inputs, double **outputs, V lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h b/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h index 1e95258b9..4ed29b1c1 100755 --- a/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h +++ b/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h @@ -56,49 +56,49 @@ private: double settingchase; double chasespeed; - long double fpNShapeL; - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double fpNShapeL; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double fpNShapeR; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double fpNShapeR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; float A; }; diff --git a/plugins/WinVST/AtmosphereChannel/AtmosphereChannelProc.cpp b/plugins/WinVST/AtmosphereChannel/AtmosphereChannelProc.cpp index bbdf44cc9..763853004 100755 --- a/plugins/WinVST/AtmosphereChannel/AtmosphereChannelProc.cpp +++ b/plugins/WinVST/AtmosphereChannel/AtmosphereChannelProc.cpp @@ -18,10 +18,10 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -244,14 +244,14 @@ void AtmosphereChannel::processReplacing(float **inputs, float **outputs, VstInt lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -274,10 +274,10 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs overallscale *= getSampleRate(); double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double clamp; + double clamp; double inputgain = A; if (settingchase != inputgain) { @@ -500,16 +500,14 @@ void AtmosphereChannel::processDoubleReplacing(double **inputs, double **outputs lastSampleAR = drySampleR; //store the raw R input sample again for use next time - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Aura/Aura.cpp b/plugins/WinVST/Aura/Aura.cpp index 8663d3bb1..b26d8a86f 100755 --- a/plugins/WinVST/Aura/Aura.cpp +++ b/plugins/WinVST/Aura/Aura.cpp @@ -24,8 +24,8 @@ Aura::Aura(audioMasterCallback audioMaster) : lastSampleR = 0.0; previousVelocityR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Aura/Aura.h b/plugins/WinVST/Aura/Aura.h index 22d4653d0..e0feff0c2 100755 --- a/plugins/WinVST/Aura/Aura.h +++ b/plugins/WinVST/Aura/Aura.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; + double lastSampleL; double previousVelocityL; - long double lastSampleR; + double lastSampleR; double previousVelocityR; double bL[21]; diff --git a/plugins/WinVST/Aura/AuraProc.cpp b/plugins/WinVST/Aura/AuraProc.cpp index 089a8731b..e6d4f4e7a 100755 --- a/plugins/WinVST/Aura/AuraProc.cpp +++ b/plugins/WinVST/Aura/AuraProc.cpp @@ -27,8 +27,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -83,44 +83,8 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -208,14 +172,14 @@ void Aura::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,8 +211,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double overallscale = trim * 10.0; double gain = overallscale + (pow(wet,3) * 0.187859642462067); trim *= (1.0 - (pow(wet,3) * 0.187859642462067)); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -303,44 +267,8 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -428,16 +356,14 @@ void Aura::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/AutoPan/AutoPanProc.cpp b/plugins/WinVST/AutoPan/AutoPanProc.cpp index 8301a2b25..632f9bfaa 100644 --- a/plugins/WinVST/AutoPan/AutoPanProc.cpp +++ b/plugins/WinVST/AutoPan/AutoPanProc.cpp @@ -25,12 +25,12 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -44,8 +44,8 @@ void AutoPan::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -95,12 +95,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; rate += (oldfpd*drift); if (rate > 6.283185307179586) { @@ -114,8 +114,8 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL *= (sin(rate)+1.0); inputSampleR *= (sin(rate+offset)+1.0); - long double mid = (inputSampleL + inputSampleR)*panlaw; - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*panlaw; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/4.0; @@ -129,12 +129,12 @@ void AutoPan::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/AverMatrix/AverMatrixProc.cpp b/plugins/WinVST/AverMatrix/AverMatrixProc.cpp index 381ea9c35..af0105057 100755 --- a/plugins/WinVST/AverMatrix/AverMatrixProc.cpp +++ b/plugins/WinVST/AverMatrix/AverMatrixProc.cpp @@ -48,15 +48,15 @@ void AverMatrix::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; @@ -140,15 +140,15 @@ void AverMatrix::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) { bL[x+1][y] = bL[x][y]; diff --git a/plugins/WinVST/Average/Average.cpp b/plugins/WinVST/Average/Average.cpp index 2f39ca1db..64f301f56 100755 --- a/plugins/WinVST/Average/Average.cpp +++ b/plugins/WinVST/Average/Average.cpp @@ -17,8 +17,8 @@ Average::Average(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Average/Average.h b/plugins/WinVST/Average/Average.h index 9932e99d9..1cdc884ba 100755 --- a/plugins/WinVST/Average/Average.h +++ b/plugins/WinVST/Average/Average.h @@ -57,8 +57,8 @@ private: double f[11]; double bR[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Average/AverageProc.cpp b/plugins/WinVST/Average/AverageProc.cpp index 17f478362..fce6a3af4 100755 --- a/plugins/WinVST/Average/AverageProc.cpp +++ b/plugins/WinVST/Average/AverageProc.cpp @@ -57,44 +57,8 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -151,14 +115,14 @@ void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //in the floating point system. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -218,44 +182,8 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -311,16 +239,14 @@ void Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //if it 'won't change anything' but our sample might be at a very different scaling //in the floating point system. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/BassAmp/BassAmpProc.cpp b/plugins/WinVST/BassAmp/BassAmpProc.cpp index a84fcce3a..025fa038a 100755 --- a/plugins/WinVST/BassAmp/BassAmpProc.cpp +++ b/plugins/WinVST/BassAmp/BassAmpProc.cpp @@ -36,8 +36,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-37) LinputSample = fpd * 1.18e-37; if (fabs(RinputSample)<1.18e-37) RinputSample = fpd * 1.18e-37; @@ -408,8 +408,8 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double LinputSample = *in1; - long double RinputSample = *in2; + double LinputSample = *in1; + double RinputSample = *in2; if (fabs(LinputSample)<1.18e-43) LinputSample = fpd * 1.18e-43; if (fabs(RinputSample)<1.18e-43) RinputSample = fpd * 1.18e-43; diff --git a/plugins/WinVST/BassDrive/BassDriveProc.cpp b/plugins/WinVST/BassDrive/BassDriveProc.cpp index 3e199ea59..68f67e7f7 100755 --- a/plugins/WinVST/BassDrive/BassDriveProc.cpp +++ b/plugins/WinVST/BassDrive/BassDriveProc.cpp @@ -25,8 +25,8 @@ void BassDrive::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -349,8 +349,8 @@ void BassDrive::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/BassKit/BassKit.cpp b/plugins/WinVST/BassKit/BassKit.cpp index 008f045da..0eec1c5eb 100755 --- a/plugins/WinVST/BassKit/BassKit.cpp +++ b/plugins/WinVST/BassKit/BassKit.cpp @@ -68,8 +68,8 @@ BassKit::BassKit(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BassKit/BassKit.h b/plugins/WinVST/BassKit/BassKit.h index f421d3d4d..c192cfa11 100755 --- a/plugins/WinVST/BassKit/BassKit.h +++ b/plugins/WinVST/BassKit/BassKit.h @@ -105,8 +105,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BassKit/BassKitProc.cpp b/plugins/WinVST/BassKit/BassKitProc.cpp index 9199c82d3..3044c5cec 100755 --- a/plugins/WinVST/BassKit/BassKitProc.cpp +++ b/plugins/WinVST/BassKit/BassKitProc.cpp @@ -33,8 +33,8 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -204,14 +204,14 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,8 +249,8 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -420,16 +420,14 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Baxandall/Baxandall.h b/plugins/WinVST/Baxandall/Baxandall.h index 380e3d09f..a30751cfc 100755 --- a/plugins/WinVST/Baxandall/Baxandall.h +++ b/plugins/WinVST/Baxandall/Baxandall.h @@ -56,15 +56,15 @@ private: uint32_t fpd; //default stuff - long double trebleAL[9]; - long double trebleBL[9]; - long double bassAL[9]; - long double bassBL[9]; + double trebleAL[9]; + double trebleBL[9]; + double bassAL[9]; + double bassBL[9]; - long double trebleAR[9]; - long double trebleBR[9]; - long double bassAR[9]; - long double bassBR[9]; + double trebleAR[9]; + double trebleBR[9]; + double bassAR[9]; + double bassBR[9]; bool flip; float A; diff --git a/plugins/WinVST/Baxandall/BaxandallProc.cpp b/plugins/WinVST/Baxandall/BaxandallProc.cpp index 9f75cced2..f52cba8ec 100755 --- a/plugins/WinVST/Baxandall/BaxandallProc.cpp +++ b/plugins/WinVST/Baxandall/BaxandallProc.cpp @@ -45,8 +45,8 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -59,10 +59,10 @@ void Baxandall::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { @@ -182,8 +182,8 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -196,10 +196,10 @@ void Baxandall::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double trebleSampleL; - long double bassSampleL; - long double trebleSampleR; - long double bassSampleR; + double trebleSampleL; + double bassSampleL; + double trebleSampleR; + double bassSampleR; if (flip) { diff --git a/plugins/WinVST/Beam/BeamProc.cpp b/plugins/WinVST/Beam/BeamProc.cpp index 5871eb5c1..15eda5357 100755 --- a/plugins/WinVST/Beam/BeamProc.cpp +++ b/plugins/WinVST/Beam/BeamProc.cpp @@ -35,8 +35,8 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -164,8 +164,8 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Biquad/Biquad.h b/plugins/WinVST/Biquad/Biquad.h index 17993cd4c..2476d2595 100755 --- a/plugins/WinVST/Biquad/Biquad.h +++ b/plugins/WinVST/Biquad/Biquad.h @@ -55,7 +55,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[11]; //note that this stereo form doesn't require L and R forms! + double biquad[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Biquad/BiquadProc.cpp b/plugins/WinVST/Biquad/BiquadProc.cpp index 0dfbfe46f..cff2485a6 100755 --- a/plugins/WinVST/Biquad/BiquadProc.cpp +++ b/plugins/WinVST/Biquad/BiquadProc.cpp @@ -88,12 +88,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -101,16 +101,16 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -120,12 +120,12 @@ void Biquad::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -245,12 +245,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); @@ -258,16 +258,16 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //encode Console5: good cleanness /* - long double mid = inputSampleL + inputSampleR; - long double side = inputSampleL - inputSampleR; + double mid = inputSampleL + inputSampleR; + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing - long double tempSampleM = (mid * biquad[2]) + biquad[7]; + double tempSampleM = (mid * biquad[2]) + biquad[7]; biquad[7] = (mid * biquad[3]) - (tempSampleM * biquad[5]) + biquad[8]; biquad[8] = (mid * biquad[4]) - (tempSampleM * biquad[6]); mid = tempSampleM; //like mono AU, 7 and 8 store mid channel - long double tempSampleS = (side * biquad[2]) + biquad[9]; + double tempSampleS = (side * biquad[2]) + biquad[9]; biquad[9] = (side * biquad[3]) - (tempSampleS * biquad[5]) + biquad[10]; biquad[10] = (side * biquad[4]) - (tempSampleS * biquad[6]); inputSampleR = tempSampleS; //note: 9 and 10 store the side channel @@ -277,12 +277,12 @@ void Biquad::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //unassign mid and side */ - long double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; + double tempSampleL = (inputSampleL * biquad[2]) + biquad[7]; biquad[7] = (inputSampleL * biquad[3]) - (tempSampleL * biquad[5]) + biquad[8]; biquad[8] = (inputSampleL * biquad[4]) - (tempSampleL * biquad[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; + double tempSampleR = (inputSampleR * biquad[2]) + biquad[9]; biquad[9] = (inputSampleR * biquad[3]) - (tempSampleR * biquad[5]) + biquad[10]; biquad[10] = (inputSampleR * biquad[4]) - (tempSampleR * biquad[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/WinVST/Biquad2/Biquad2.h b/plugins/WinVST/Biquad2/Biquad2.h index 20c1d1ceb..1c715f1a7 100755 --- a/plugins/WinVST/Biquad2/Biquad2.h +++ b/plugins/WinVST/Biquad2/Biquad2.h @@ -56,7 +56,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; //note that this stereo form doesn't require L and R forms! + double biquad[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Biquad2/Biquad2Proc.cpp b/plugins/WinVST/Biquad2/Biquad2Proc.cpp index 837a072b8..9e9d6bce8 100755 --- a/plugins/WinVST/Biquad2/Biquad2Proc.cpp +++ b/plugins/WinVST/Biquad2/Biquad2Proc.cpp @@ -79,12 +79,12 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -134,10 +134,10 @@ void Biquad2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -291,12 +291,12 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double chasespeed = 50000; if (frequencychase < frequencytarget) chasespeed = 500000; @@ -346,10 +346,10 @@ void Biquad2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; + double outSampleL = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; inputSampleL = outSampleL; biquad[10] = biquad[9]; biquad[9] = inputSampleL; //DF1 left - long double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; + double outSampleR = biquad[2]*inputSampleR+biquad[3]*biquad[11]+biquad[4]*biquad[12]-biquad[5]*biquad[13]-biquad[6]*biquad[14]; biquad[12] = biquad[11]; biquad[11] = inputSampleR; inputSampleR = outSampleR; biquad[14] = biquad[13]; biquad[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; diff --git a/plugins/WinVST/BiquadDouble/BiquadDouble.h b/plugins/WinVST/BiquadDouble/BiquadDouble.h index 525d753a0..486a9b642 100755 --- a/plugins/WinVST/BiquadDouble/BiquadDouble.h +++ b/plugins/WinVST/BiquadDouble/BiquadDouble.h @@ -56,8 +56,8 @@ private: std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/BiquadDouble/BiquadDoubleProc.cpp b/plugins/WinVST/BiquadDouble/BiquadDoubleProc.cpp index c5318a700..055743d43 100755 --- a/plugins/WinVST/BiquadDouble/BiquadDoubleProc.cpp +++ b/plugins/WinVST/BiquadDouble/BiquadDoubleProc.cpp @@ -89,24 +89,24 @@ void BiquadDouble::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -238,24 +238,24 @@ void BiquadDouble::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h index cd9dacc2e..e3024989d 100755 --- a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h +++ b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadAL[9]; - long double biquadAR[9]; - long double biquadBL[9]; - long double biquadBR[9]; + double biquadAL[9]; + double biquadAR[9]; + double biquadBL[9]; + double biquadBR[9]; bool flip; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/BiquadOneHalf/BiquadOneHalfProc.cpp b/plugins/WinVST/BiquadOneHalf/BiquadOneHalfProc.cpp index e126dcf7e..87d9763c1 100755 --- a/plugins/WinVST/BiquadOneHalf/BiquadOneHalfProc.cpp +++ b/plugins/WinVST/BiquadOneHalf/BiquadOneHalfProc.cpp @@ -87,19 +87,19 @@ void BiquadOneHalf::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { @@ -239,20 +239,20 @@ void BiquadOneHalf::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; - long double tempSampleR; + double tempSampleL; + double tempSampleR; if (flip) { diff --git a/plugins/WinVST/BiquadPlus/BiquadPlus.h b/plugins/WinVST/BiquadPlus/BiquadPlus.h index bec774331..0ef273e12 100644 --- a/plugins/WinVST/BiquadPlus/BiquadPlus.h +++ b/plugins/WinVST/BiquadPlus/BiquadPlus.h @@ -80,7 +80,7 @@ private: biq_total }; - long double biquad[biq_total]; + double biquad[biq_total]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp b/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp index 34f5c68fb..b2ad19c4d 100644 --- a/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp +++ b/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp @@ -107,20 +107,20 @@ void BiquadPlus::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -239,20 +239,20 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double buf = (long double)sampleFrames/inFramesToProcess; + double buf = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*buf)+(biquad[biq_aB0]*(1.0-buf)); biquad[biq_a1] = (biquad[biq_aA1]*buf)+(biquad[biq_aB1]*(1.0-buf)); biquad[biq_a2] = (biquad[biq_aA2]*buf)+(biquad[biq_aB2]*(1.0-buf)); biquad[biq_b1] = (biquad[biq_bA1]*buf)+(biquad[biq_bB1]*(1.0-buf)); biquad[biq_b2] = (biquad[biq_bA2]*buf)+(biquad[biq_bB2]*(1.0-buf)); - long double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; + double tempSample = (inputSampleL * biquad[biq_a0]) + biquad[biq_sL1]; biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tempSample * biquad[biq_b1]) + biquad[biq_sL2]; biquad[biq_sL2] = (inputSampleL * biquad[biq_a2]) - (tempSample * biquad[biq_b2]); inputSampleL = tempSample; @@ -268,12 +268,12 @@ void BiquadPlus::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/BiquadTriple/BiquadTriple.h b/plugins/WinVST/BiquadTriple/BiquadTriple.h index acd55ebb6..b23660d14 100755 --- a/plugins/WinVST/BiquadTriple/BiquadTriple.h +++ b/plugins/WinVST/BiquadTriple/BiquadTriple.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; //note that this stereo form doesn't require L and R forms! + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/BiquadTriple/BiquadTripleProc.cpp b/plugins/WinVST/BiquadTriple/BiquadTripleProc.cpp index f6d97f74f..84ee1b7f5 100755 --- a/plugins/WinVST/BiquadTriple/BiquadTripleProc.cpp +++ b/plugins/WinVST/BiquadTriple/BiquadTripleProc.cpp @@ -90,24 +90,24 @@ void BiquadTriple::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -251,23 +251,23 @@ void BiquadTriple::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel diff --git a/plugins/WinVST/BitGlitter/BitGlitterProc.cpp b/plugins/WinVST/BitGlitter/BitGlitterProc.cpp index 288c269bf..38afa37d9 100755 --- a/plugins/WinVST/BitGlitter/BitGlitterProc.cpp +++ b/plugins/WinVST/BitGlitter/BitGlitterProc.cpp @@ -32,12 +32,12 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section @@ -68,7 +68,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -97,7 +97,7 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; @@ -252,12 +252,12 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //first, the distortion section inputSampleL *= ingain; @@ -287,7 +287,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample L positionAL += rateA; - long double outputSampleL = heldSampleAL; + double outputSampleL = heldSampleAL; if (positionAL > 1.0) { positionAL -= 1.0; @@ -316,7 +316,7 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin raw sample R positionAR += rateA; - long double outputSampleR = heldSampleAR; + double outputSampleR = heldSampleAR; if (positionAR > 1.0) { positionAR -= 1.0; diff --git a/plugins/WinVST/Bite/Bite.cpp b/plugins/WinVST/Bite/Bite.cpp index c9d0fcbc2..1defea7df 100755 --- a/plugins/WinVST/Bite/Bite.cpp +++ b/plugins/WinVST/Bite/Bite.cpp @@ -34,8 +34,8 @@ Bite::Bite(audioMasterCallback audioMaster) : sampleHR = 0.0; sampleIR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Bite/Bite.h b/plugins/WinVST/Bite/Bite.h index 288ac7f80..895aab027 100755 --- a/plugins/WinVST/Bite/Bite.h +++ b/plugins/WinVST/Bite/Bite.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sampleAL; double sampleBL; diff --git a/plugins/WinVST/Bite/BiteProc.cpp b/plugins/WinVST/Bite/BiteProc.cpp index 64e0ac419..66747041e 100755 --- a/plugins/WinVST/Bite/BiteProc.cpp +++ b/plugins/WinVST/Bite/BiteProc.cpp @@ -50,44 +50,8 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -116,14 +80,14 @@ void Bite::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -178,44 +142,8 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa sampleBR = sampleAR; sampleAR = *in2; //rotate the buffer in primitive fashion - if (sampleAL<1.2e-38 && -sampleAL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAL = applyresidue; - } - if (sampleAR<1.2e-38 && -sampleAR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - sampleAR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(sampleAL)<1.18e-23) sampleAL = fpdL * 1.18e-17; + if (fabs(sampleAR)<1.18e-23) sampleAR = fpdR * 1.18e-17; midA = sampleAL - sampleEL; midB = sampleIL - sampleEL; @@ -244,16 +172,14 @@ void Bite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/BlockParty/BlockPartyProc.cpp b/plugins/WinVST/BlockParty/BlockPartyProc.cpp index 12c19d4a3..37c3a6545 100755 --- a/plugins/WinVST/BlockParty/BlockPartyProc.cpp +++ b/plugins/WinVST/BlockParty/BlockPartyProc.cpp @@ -29,8 +29,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); @@ -590,8 +590,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -629,8 +629,8 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / thresholdL; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/WinVST/BrassRider/BrassRiderProc.cpp b/plugins/WinVST/BrassRider/BrassRiderProc.cpp index 3acd7834c..449a965fc 100755 --- a/plugins/WinVST/BrassRider/BrassRiderProc.cpp +++ b/plugins/WinVST/BrassRider/BrassRiderProc.cpp @@ -21,8 +21,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -60,8 +60,8 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -70,7 +70,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -79,7 +79,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -102,7 +102,7 @@ void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 samp highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); @@ -163,8 +163,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -202,8 +202,8 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= limitOut; highIIRL = (highIIRL*0.5); @@ -212,7 +212,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2L = (highIIR2L*0.5); highIIR2L += (inputSampleL*0.5); inputSampleL -= highIIR2L; - long double slewSampleL = fabs(inputSampleL - lastSampleL); + double slewSampleL = fabs(inputSampleL - lastSampleL); lastSampleL = inputSampleL; slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2; slewIIRL = (slewIIRL*0.5); @@ -221,7 +221,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn slewIIR2L = (slewIIR2L*0.5); slewIIR2L += (slewSampleL*0.5); slewSampleL = fabs(slewSampleL - slewIIR2L); - long double bridgerectifier = slewSampleL; + double bridgerectifier = slewSampleL; //there's the left channel, now to feed it to overall clamp if (bridgerectifier > 3.1415) bridgerectifier = 0.0; @@ -244,7 +244,7 @@ void BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstIn highIIR2R = (highIIR2R*0.5); highIIR2R += (inputSampleR*0.5); inputSampleR -= highIIR2R; - long double slewSampleR = fabs(inputSampleR - lastSampleR); + double slewSampleR = fabs(inputSampleR - lastSampleR); lastSampleR = inputSampleR; slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2; slewIIRR = (slewIIRR*0.5); diff --git a/plugins/WinVST/BrightAmbience/BrightAmbienceProc.cpp b/plugins/WinVST/BrightAmbience/BrightAmbienceProc.cpp index 63bfecbf8..dc4ecd233 100755 --- a/plugins/WinVST/BrightAmbience/BrightAmbienceProc.cpp +++ b/plugins/WinVST/BrightAmbience/BrightAmbienceProc.cpp @@ -23,8 +23,8 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -174,7 +174,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -315,7 +315,7 @@ void BrightAmbience::processReplacing(float **inputs, float **outputs, VstInt32 temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; @@ -355,8 +355,8 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -506,7 +506,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pL[count+121]; temp += pL[count+109]; temp += pL[count+73]; temp += pL[count+47]; temp += pL[count+41]; temp += pL[count+19]; temp += pL[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleL = (inputSampleL*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleL = (inputSampleL*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end L //begin R @@ -647,7 +647,7 @@ void BrightAmbience::processDoubleReplacing(double **inputs, double **outputs, V temp += pR[count+121]; temp += pR[count+109]; temp += pR[count+73]; temp += pR[count+47]; temp += pR[count+41]; temp += pR[count+19]; temp += pR[count+11]; //Highest Offset = 12679: gcount limit is 12680, Reset() goes to 25360, definition in .h must be p[25361] } - inputSampleR = (inputSampleR*(1-wet))+((long double)(temp/(8388352.0*scale))*wet); + inputSampleR = (inputSampleR*(1-wet))+((double)(temp/(8388352.0*scale))*wet); //end R gcount--; diff --git a/plugins/WinVST/BrightAmbience2/BrightAmbience2.h b/plugins/WinVST/BrightAmbience2/BrightAmbience2.h index c49b14e20..860fe9551 100755 --- a/plugins/WinVST/BrightAmbience2/BrightAmbience2.h +++ b/plugins/WinVST/BrightAmbience2/BrightAmbience2.h @@ -64,9 +64,9 @@ private: int gcount; float pL[32768]; float pR[32768]; - long double feedbackA; - long double feedbackB; - long double feedbackC; + double feedbackA; + double feedbackB; + double feedbackC; float A; float B; diff --git a/plugins/WinVST/BrightAmbience2/BrightAmbience2Proc.cpp b/plugins/WinVST/BrightAmbience2/BrightAmbience2Proc.cpp index 72b7adf6c..95daad017 100755 --- a/plugins/WinVST/BrightAmbience2/BrightAmbience2Proc.cpp +++ b/plugins/WinVST/BrightAmbience2/BrightAmbience2Proc.cpp @@ -22,14 +22,14 @@ void BrightAmbience2::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; @@ -90,14 +90,14 @@ void BrightAmbience2::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double tempL = 0.0; - long double tempR = 0.0; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; diff --git a/plugins/WinVST/BrightAmbience3/BrightAmbience3.h b/plugins/WinVST/BrightAmbience3/BrightAmbience3.h index ab479927b..cd9a6abd0 100644 --- a/plugins/WinVST/BrightAmbience3/BrightAmbience3.h +++ b/plugins/WinVST/BrightAmbience3/BrightAmbience3.h @@ -62,10 +62,10 @@ private: int gcount; double pL[32768]; double pR[32768]; - long double feedbackA; - long double feedbackB; - long double figureL[9]; - long double figureR[9]; + double feedbackA; + double feedbackB; + double figureL[9]; + double figureR[9]; double lastRefL[10]; double lastRefR[10]; int cycle; diff --git a/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp b/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp index 6c912ad33..dd6875d28 100644 --- a/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp +++ b/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp @@ -43,17 +43,17 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -67,7 +67,7 @@ void BrightAmbience3::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -202,17 +202,17 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Air sample - long double tempL = 0.0; - long double tempR = 0.0; + double tempL = 0.0; + double tempR = 0.0; if (gcount < 0 || gcount > 32767) gcount = 32767; int count = gcount; pL[count] = inputSampleL + feedbackB; @@ -226,7 +226,7 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, inputSampleL = tempL/cbrt(length); inputSampleR = tempR/cbrt(length); - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); feedbackA = sin(tempSample) * feedbackAmount; @@ -307,12 +307,12 @@ void BrightAmbience3::processDoubleReplacing(double **inputs, double **outputs, //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp b/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp index dfea1258a..0b61354b3 100644 --- a/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp +++ b/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp @@ -32,44 +32,8 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -149,44 +113,8 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/WinVST/BussColors4/BussColors4.cpp b/plugins/WinVST/BussColors4/BussColors4.cpp index c7de380ea..731e1331f 100755 --- a/plugins/WinVST/BussColors4/BussColors4.cpp +++ b/plugins/WinVST/BussColors4/BussColors4.cpp @@ -44,8 +44,8 @@ BussColors4::BussColors4(audioMasterCallback audioMaster) : slowdynR = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BussColors4/BussColors4.h b/plugins/WinVST/BussColors4/BussColors4.h index 6452555a5..694ce678b 100755 --- a/plugins/WinVST/BussColors4/BussColors4.h +++ b/plugins/WinVST/BussColors4/BussColors4.h @@ -68,8 +68,8 @@ private: double slowdynR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BussColors4/BussColors4Proc.cpp b/plugins/WinVST/BussColors4/BussColors4Proc.cpp index b1b945144..983bcc510 100755 --- a/plugins/WinVST/BussColors4/BussColors4Proc.cpp +++ b/plugins/WinVST/BussColors4/BussColors4Proc.cpp @@ -32,8 +32,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -58,44 +58,8 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -792,14 +756,14 @@ void BussColors4::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -836,8 +800,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI double outgain = 1.0; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it switch (console) @@ -862,44 +826,8 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1596,16 +1524,14 @@ void BussColors4::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ButterComp/ButterComp.cpp b/plugins/WinVST/ButterComp/ButterComp.cpp index b3123e2e2..deac8039a 100755 --- a/plugins/WinVST/ButterComp/ButterComp.cpp +++ b/plugins/WinVST/ButterComp/ButterComp.cpp @@ -26,8 +26,8 @@ ButterComp::ButterComp(audioMasterCallback audioMaster) : controlBnegR = 1.0; targetposR = 1.0; targetnegR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ButterComp/ButterComp.h b/plugins/WinVST/ButterComp/ButterComp.h index 5c9862b3e..12c693fe2 100755 --- a/plugins/WinVST/ButterComp/ButterComp.h +++ b/plugins/WinVST/ButterComp/ButterComp.h @@ -65,8 +65,8 @@ private: double controlBnegR; double targetposR; double targetnegR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ButterComp/ButterCompProc.cpp b/plugins/WinVST/ButterComp/ButterCompProc.cpp index d87030c41..06c02ad31 100755 --- a/plugins/WinVST/ButterComp/ButterCompProc.cpp +++ b/plugins/WinVST/ButterComp/ButterCompProc.cpp @@ -24,8 +24,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -34,8 +34,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -54,44 +54,8 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -178,14 +142,14 @@ void ButterComp::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -214,8 +178,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegL; double outputposL; double outputnegL; - long double totalmultiplierL; - long double inputSampleL; + double totalmultiplierL; + double inputSampleL; double drySampleL; double inputposR; @@ -224,8 +188,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn double calcnegR; double outputposR; double outputnegR; - long double totalmultiplierR; - long double inputSampleR; + double totalmultiplierR; + double inputSampleR; double drySampleR; double inputgain = pow(10.0,(A*14.0)/20.0); @@ -244,44 +208,8 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -368,16 +296,14 @@ void ButterComp::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ButterComp2/ButterComp2.cpp b/plugins/WinVST/ButterComp2/ButterComp2.cpp index 0484416d5..b7bf3f1c0 100755 --- a/plugins/WinVST/ButterComp2/ButterComp2.cpp +++ b/plugins/WinVST/ButterComp2/ButterComp2.cpp @@ -32,8 +32,8 @@ ButterComp2::ButterComp2(audioMasterCallback audioMaster) : A = 0.0; B = 0.5; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ButterComp2/ButterComp2.h b/plugins/WinVST/ButterComp2/ButterComp2.h index 188adb5c3..d1f8721c1 100755 --- a/plugins/WinVST/ButterComp2/ButterComp2.h +++ b/plugins/WinVST/ButterComp2/ButterComp2.h @@ -54,23 +54,23 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double controlAposL; - long double controlAnegL; - long double controlBposL; - long double controlBnegL; - long double targetposL; - long double targetnegL; - long double lastOutputL; - long double controlAposR; - long double controlAnegR; - long double controlBposR; - long double controlBnegR; - long double targetposR; - long double targetnegR; - long double lastOutputR; + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double lastOutputL; + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double lastOutputR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ButterComp2/ButterComp2Proc.cpp b/plugins/WinVST/ButterComp2/ButterComp2Proc.cpp index 67a63675c..f5520a44a 100755 --- a/plugins/WinVST/ButterComp2/ButterComp2Proc.cpp +++ b/plugins/WinVST/ButterComp2/ButterComp2Proc.cpp @@ -30,8 +30,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,30 +75,30 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -138,23 +138,23 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -187,8 +187,8 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -223,14 +223,14 @@ void ButterComp2::processReplacing(float **inputs, float **outputs, VstInt32 sam flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -265,8 +265,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -310,30 +310,30 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL *= inputgain; inputSampleR *= inputgain; - long double divisor = compfactor / (1.0+fabs(lastOutputL)); + double divisor = compfactor / (1.0+fabs(lastOutputL)); //this is slowing compressor recovery while output waveforms were high divisor /= overallscale; - long double remainder = divisor; + double remainder = divisor; divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposL = inputSampleL + 1.0; + double inputposL = inputSampleL + 1.0; if (inputposL < 0.0) inputposL = 0.0; - long double outputposL = inputposL / 2.0; + double outputposL = inputposL / 2.0; if (outputposL > 1.0) outputposL = 1.0; inputposL *= inputposL; targetposL *= divisor; targetposL += (inputposL * remainder); - long double calcposL = pow((1.0/targetposL),2); + double calcposL = pow((1.0/targetposL),2); - long double inputnegL = (-inputSampleL) + 1.0; + double inputnegL = (-inputSampleL) + 1.0; if (inputnegL < 0.0) inputnegL = 0.0; - long double outputnegL = inputnegL / 2.0; + double outputnegL = inputnegL / 2.0; if (outputnegL > 1.0) outputnegL = 1.0; inputnegL *= inputnegL; targetnegL *= divisor; targetnegL += (inputnegL * remainder); - long double calcnegL = pow((1.0/targetnegL),2); + double calcnegL = pow((1.0/targetnegL),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -373,23 +373,23 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI divisor = 1.0 - divisor; //recalculate divisor every sample - long double inputposR = inputSampleR + 1.0; + double inputposR = inputSampleR + 1.0; if (inputposR < 0.0) inputposR = 0.0; - long double outputposR = inputposR / 2.0; + double outputposR = inputposR / 2.0; if (outputposR > 1.0) outputposR = 1.0; inputposR *= inputposR; targetposR *= divisor; targetposR += (inputposR * remainder); - long double calcposR = pow((1.0/targetposR),2); + double calcposR = pow((1.0/targetposR),2); - long double inputnegR = (-inputSampleR) + 1.0; + double inputnegR = (-inputSampleR) + 1.0; if (inputnegR < 0.0) inputnegR = 0.0; - long double outputnegR = inputnegR / 2.0; + double outputnegR = inputnegR / 2.0; if (outputnegR > 1.0) outputnegR = 1.0; inputnegR *= inputnegR; targetnegR *= divisor; targetnegR += (inputnegR * remainder); - long double calcnegR = pow((1.0/targetnegR),2); + double calcnegR = pow((1.0/targetnegR),2); //now we have mirrored targets for comp //outputpos and outputneg go from 0 to 1 @@ -422,8 +422,8 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI } //this causes each of the four to update only when active and in the correct 'flip' - long double totalmultiplierL; - long double totalmultiplierR; + double totalmultiplierL; + double totalmultiplierR; if (flip) { totalmultiplierL = (controlAposL * outputposL) + (controlAnegL * outputnegL); @@ -458,16 +458,14 @@ void ButterComp2::processDoubleReplacing(double **inputs, double **outputs, VstI flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/C5RawBuss/C5RawBuss.cpp b/plugins/WinVST/C5RawBuss/C5RawBuss.cpp index 8fba0ef0f..1515cfdec 100755 --- a/plugins/WinVST/C5RawBuss/C5RawBuss.cpp +++ b/plugins/WinVST/C5RawBuss/C5RawBuss.cpp @@ -17,8 +17,8 @@ C5RawBuss::C5RawBuss(audioMasterCallback audioMaster) : lastSampleBussL = 0.0; lastFXBussR = 0.0; lastSampleBussR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/C5RawBuss/C5RawBuss.h b/plugins/WinVST/C5RawBuss/C5RawBuss.h index f4d01fe1e..dfc108b22 100755 --- a/plugins/WinVST/C5RawBuss/C5RawBuss.h +++ b/plugins/WinVST/C5RawBuss/C5RawBuss.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXBussL; double lastSampleBussL; diff --git a/plugins/WinVST/C5RawBuss/C5RawBussProc.cpp b/plugins/WinVST/C5RawBuss/C5RawBussProc.cpp index fab4612e2..cc884ee73 100755 --- a/plugins/WinVST/C5RawBuss/C5RawBussProc.cpp +++ b/plugins/WinVST/C5RawBuss/C5RawBussProc.cpp @@ -15,7 +15,7 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -108,14 +72,14 @@ void C5RawBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampl //build new signal off what was present in output last time //slew aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -135,7 +99,7 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -144,51 +108,15 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -228,16 +156,14 @@ void C5RawBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt //build new signal off what was present in output last time //slew aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/C5RawChannel/C5RawChannel.cpp b/plugins/WinVST/C5RawChannel/C5RawChannel.cpp index ffc2ecfe7..a25bbd81d 100755 --- a/plugins/WinVST/C5RawChannel/C5RawChannel.cpp +++ b/plugins/WinVST/C5RawChannel/C5RawChannel.cpp @@ -17,8 +17,8 @@ C5RawChannel::C5RawChannel(audioMasterCallback audioMaster) : lastSampleChannelL = 0.0; lastFXChannelR = 0.0; lastSampleChannelR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/C5RawChannel/C5RawChannel.h b/plugins/WinVST/C5RawChannel/C5RawChannel.h index 3ce3e845b..8ed6e152e 100755 --- a/plugins/WinVST/C5RawChannel/C5RawChannel.h +++ b/plugins/WinVST/C5RawChannel/C5RawChannel.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastFXChannelL; double lastSampleChannelL; diff --git a/plugins/WinVST/C5RawChannel/C5RawChannelProc.cpp b/plugins/WinVST/C5RawChannel/C5RawChannelProc.cpp index b2679ffb6..d8e91ece8 100755 --- a/plugins/WinVST/C5RawChannel/C5RawChannelProc.cpp +++ b/plugins/WinVST/C5RawChannel/C5RawChannelProc.cpp @@ -15,7 +15,7 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -24,51 +24,15 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -107,14 +71,14 @@ void C5RawChannel::processReplacing(float **inputs, float **outputs, VstInt32 sa inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -134,7 +98,7 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double* out2 = outputs[1]; - long double centering = A * 0.5; + double centering = A * 0.5; centering = 1.0 - pow(centering,5); //we can set our centering force from zero to rather high, but //there's a really intense taper on it forcing it to mostly be almost 1.0. @@ -143,51 +107,15 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst double differenceL; double differenceR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; differenceL = lastSampleChannelL - inputSampleL; lastSampleChannelL = inputSampleL; @@ -226,16 +154,14 @@ void C5RawChannel::processDoubleReplacing(double **inputs, double **outputs, Vst inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/CStrip/CStrip.cpp b/plugins/WinVST/CStrip/CStrip.cpp index 2049ab870..88b4e1748 100755 --- a/plugins/WinVST/CStrip/CStrip.cpp +++ b/plugins/WinVST/CStrip/CStrip.cpp @@ -153,8 +153,8 @@ CStrip::CStrip(audioMasterCallback audioMaster) : nvgRA = nvgRB = 0.0; //end ButterComp - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/CStrip/CStrip.h b/plugins/WinVST/CStrip/CStrip.h index cc9f722af..3e4f6219e 100755 --- a/plugins/WinVST/CStrip/CStrip.h +++ b/plugins/WinVST/CStrip/CStrip.h @@ -63,8 +63,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/CStrip/CStripProc.cpp b/plugins/WinVST/CStrip/CStripProc.cpp index 60ce59c56..0a758963e 100755 --- a/plugins/WinVST/CStrip/CStripProc.cpp +++ b/plugins/WinVST/CStrip/CStripProc.cpp @@ -20,10 +20,10 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -111,44 +111,8 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -726,14 +690,14 @@ void CStrip::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -758,10 +722,10 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 overallscale = getSampleRate(); compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -849,44 +813,8 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -1464,16 +1392,14 @@ void CStrip::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Calibre/CalibreProc.cpp b/plugins/WinVST/Calibre/CalibreProc.cpp index a7d6cd0db..14350eff2 100755 --- a/plugins/WinVST/Calibre/CalibreProc.cpp +++ b/plugins/WinVST/Calibre/CalibreProc.cpp @@ -37,8 +37,8 @@ void Calibre::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Calibre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Capacitor/Capacitor.cpp b/plugins/WinVST/Capacitor/Capacitor.cpp index 0ade9c9db..525bf3763 100755 --- a/plugins/WinVST/Capacitor/Capacitor.cpp +++ b/plugins/WinVST/Capacitor/Capacitor.cpp @@ -51,8 +51,8 @@ Capacitor::Capacitor(audioMasterCallback audioMaster) : lastHighpass = 1000.0; lastWet = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Capacitor/Capacitor.h b/plugins/WinVST/Capacitor/Capacitor.h index 0799d39d2..7407eb5d1 100755 --- a/plugins/WinVST/Capacitor/Capacitor.h +++ b/plugins/WinVST/Capacitor/Capacitor.h @@ -94,8 +94,8 @@ private: double lastHighpass; double lastWet; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Capacitor/CapacitorProc.cpp b/plugins/WinVST/Capacitor/CapacitorProc.cpp index 6b3582b09..f851b2c9e 100755 --- a/plugins/WinVST/Capacitor/CapacitorProc.cpp +++ b/plugins/WinVST/Capacitor/CapacitorProc.cpp @@ -31,8 +31,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; float drySampleL; float drySampleR; @@ -40,44 +40,8 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -179,14 +143,14 @@ void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -222,8 +186,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt double dry; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -232,44 +196,8 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -370,16 +298,14 @@ void Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (drySampleL * dry) + (inputSampleL * wet); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Capacitor2/Capacitor2Proc.cpp b/plugins/WinVST/Capacitor2/Capacitor2Proc.cpp index 7799c21a8..899aaaa4a 100755 --- a/plugins/WinVST/Capacitor2/Capacitor2Proc.cpp +++ b/plugins/WinVST/Capacitor2/Capacitor2Proc.cpp @@ -30,12 +30,12 @@ void Capacitor2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); @@ -193,12 +193,12 @@ void Capacitor2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double dielectricScaleL = fabs(2.0-((inputSampleL+nonLin)/nonLin)); double dielectricScaleR = fabs(2.0-((inputSampleR+nonLin)/nonLin)); diff --git a/plugins/WinVST/Chamber/ChamberProc.cpp b/plugins/WinVST/Chamber/ChamberProc.cpp index 1dbe7bae0..c536ef030 100644 --- a/plugins/WinVST/Chamber/ChamberProc.cpp +++ b/plugins/WinVST/Chamber/ChamberProc.cpp @@ -58,12 +58,12 @@ void Chamber::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -314,12 +314,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; iirCL = (iirCL*(1.0-highpass))+(inputSampleL*highpass); inputSampleL -= iirCL; iirCR = (iirCR*(1.0-highpass))+(inputSampleR*highpass); inputSampleR -= iirCR; @@ -501,12 +501,12 @@ void Chamber::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Channel4/Channel4.h b/plugins/WinVST/Channel4/Channel4.h index 0338d0a77..e8ca7a260 100755 --- a/plugins/WinVST/Channel4/Channel4.h +++ b/plugins/WinVST/Channel4/Channel4.h @@ -53,10 +53,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/WinVST/Channel4/Channel4Proc.cpp b/plugins/WinVST/Channel4/Channel4Proc.cpp index 380e52c9e..a57623d4f 100755 --- a/plugins/WinVST/Channel4/Channel4Proc.cpp +++ b/plugins/WinVST/Channel4/Channel4Proc.cpp @@ -25,53 +25,17 @@ void Channel4::processReplacing(float **inputs, float **outputs, VstInt32 sample const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -165,53 +129,17 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 const double localthreshold = threshold / overallscale; const double density = pow(drive,2); //this doesn't relate to the plugins Density and Drive much double clamp; - long double bridgerectifier; + double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/WinVST/Channel5/Channel5.cpp b/plugins/WinVST/Channel5/Channel5.cpp index 26b592a7d..21581df74 100755 --- a/plugins/WinVST/Channel5/Channel5.cpp +++ b/plugins/WinVST/Channel5/Channel5.cpp @@ -15,8 +15,8 @@ Channel5::Channel5(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/WinVST/Channel5/Channel5.h b/plugins/WinVST/Channel5/Channel5.h index 07516f7a7..510f34f6a 100755 --- a/plugins/WinVST/Channel5/Channel5.h +++ b/plugins/WinVST/Channel5/Channel5.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/WinVST/Channel5/Channel5Proc.cpp b/plugins/WinVST/Channel5/Channel5Proc.cpp index 174ee28c5..b029d9303 100755 --- a/plugins/WinVST/Channel5/Channel5Proc.cpp +++ b/plugins/WinVST/Channel5/Channel5Proc.cpp @@ -23,8 +23,8 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -79,7 +79,7 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); @@ -158,8 +158,8 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -214,7 +214,7 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //highpass section - long double bridgerectifier = fabs(inputSampleL)*1.57079633; + double bridgerectifier = fabs(inputSampleL)*1.57079633; if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; else bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); diff --git a/plugins/WinVST/Channel6/Channel6Proc.cpp b/plugins/WinVST/Channel6/Channel6Proc.cpp index b0ad39368..777666f14 100755 --- a/plugins/WinVST/Channel6/Channel6Proc.cpp +++ b/plugins/WinVST/Channel6/Channel6Proc.cpp @@ -23,8 +23,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -45,8 +45,8 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -54,7 +54,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -63,7 +63,7 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section @@ -123,8 +123,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -145,8 +145,8 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -154,7 +154,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //drive section @@ -163,7 +163,7 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //drive section diff --git a/plugins/WinVST/Channel7/Channel7Proc.cpp b/plugins/WinVST/Channel7/Channel7Proc.cpp index b19f42671..e9e9a6852 100755 --- a/plugins/WinVST/Channel7/Channel7Proc.cpp +++ b/plugins/WinVST/Channel7/Channel7Proc.cpp @@ -26,8 +26,8 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -46,16 +46,16 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -63,11 +63,11 @@ void Channel7::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -132,8 +132,8 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -152,16 +152,16 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -169,11 +169,11 @@ void Channel7::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/WinVST/Channel8/Channel8Proc.cpp b/plugins/WinVST/Channel8/Channel8Proc.cpp index 8442ad2d8..afb1a48fe 100755 --- a/plugins/WinVST/Channel8/Channel8Proc.cpp +++ b/plugins/WinVST/Channel8/Channel8Proc.cpp @@ -27,8 +27,8 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -50,16 +50,16 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -67,11 +67,11 @@ void Channel8::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -157,8 +157,8 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -180,16 +180,16 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -197,11 +197,11 @@ void Channel8::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect diff --git a/plugins/WinVST/Channel9/Channel9.h b/plugins/WinVST/Channel9/Channel9.h index 5772f32ff..1232f66f6 100644 --- a/plugins/WinVST/Channel9/Channel9.h +++ b/plugins/WinVST/Channel9/Channel9.h @@ -68,8 +68,8 @@ private: double lastSampleAR; double lastSampleBR; double lastSampleCR; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; double iirAmount; double threshold; double cutoff; diff --git a/plugins/WinVST/Channel9/Channel9Proc.cpp b/plugins/WinVST/Channel9/Channel9Proc.cpp index 7c37fea56..5ca21ec9c 100644 --- a/plugins/WinVST/Channel9/Channel9Proc.cpp +++ b/plugins/WinVST/Channel9/Channel9Proc.cpp @@ -46,11 +46,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -83,16 +83,16 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -100,11 +100,11 @@ void Channel9::processReplacing(float **inputs, float **outputs, VstInt32 sample if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -218,11 +218,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (biquadA[0] < 0.49999) { tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; @@ -255,16 +255,16 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = inputSampleR - iirSampleRB; } //highpass section - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double phatSampleL = sin(inputSampleL * 1.57079633); + double phatSampleL = sin(inputSampleL * 1.57079633); inputSampleL *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); + double distSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleL = distSampleL; //purest form is full Spiral if (density < 1.0) inputSampleL = (drySampleL*(1-density))+(distSampleL*density); //fade Spiral aspect @@ -272,11 +272,11 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (inputSampleR > 1.0) inputSampleR = 1.0; if (inputSampleR < -1.0) inputSampleR = -1.0; - long double phatSampleR = sin(inputSampleR * 1.57079633); + double phatSampleR = sin(inputSampleR * 1.57079633); inputSampleR *= 1.2533141373155; //clip to 1.2533141373155 to reach maximum output, or 1.57079633 for pure sine 'phat' version - long double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); + double distSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); inputSampleR = distSampleR; //purest form is full Spiral if (density < 1.0) inputSampleR = (drySampleR*(1-density))+(distSampleR*density); //fade Spiral aspect @@ -333,12 +333,12 @@ void Channel9::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Chorus/Chorus.cpp b/plugins/WinVST/Chorus/Chorus.cpp index 1f3965afd..d2a630dff 100755 --- a/plugins/WinVST/Chorus/Chorus.cpp +++ b/plugins/WinVST/Chorus/Chorus.cpp @@ -28,8 +28,8 @@ Chorus::Chorus(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Chorus/Chorus.h b/plugins/WinVST/Chorus/Chorus.h index 5508ac3a3..933415bca 100755 --- a/plugins/WinVST/Chorus/Chorus.h +++ b/plugins/WinVST/Chorus/Chorus.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 16386; float dL[totalsamples]; diff --git a/plugins/WinVST/Chorus/ChorusProc.cpp b/plugins/WinVST/Chorus/ChorusProc.cpp index 368ade75c..8f02bebbc 100755 --- a/plugins/WinVST/Chorus/ChorusProc.cpp +++ b/plugins/WinVST/Chorus/ChorusProc.cpp @@ -31,8 +31,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -40,44 +40,8 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void Chorus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -176,8 +140,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //this is a double buffer so we will be splitting it in two - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -185,44 +149,8 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void Chorus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither fpFlip = !fpFlip; *out1 = inputSampleL; diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp index 318b6782b..a9f898ec9 100755 --- a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp @@ -28,8 +28,8 @@ ChorusEnsemble::ChorusEnsemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h index e7df33253..8b796e8eb 100755 --- a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h @@ -68,8 +68,8 @@ private: double airOddR; double airFactorR; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp b/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp index 166324483..8ee1eea32 100755 --- a/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp @@ -30,8 +30,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -44,44 +44,8 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -174,14 +138,14 @@ void ChorusEnsemble::processReplacing(float **inputs, float **outputs, VstInt32 fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -216,8 +180,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V double offset; double start[4]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -230,44 +194,8 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -360,16 +288,14 @@ void ChorusEnsemble::processDoubleReplacing(double **inputs, double **outputs, V fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp b/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp index 6c2d99f53..be036a80e 100755 --- a/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp +++ b/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp @@ -46,8 +46,8 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -207,8 +207,8 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Cider/CiderProc.cpp b/plugins/WinVST/Cider/CiderProc.cpp index e5631e4b7..9222a2ea7 100755 --- a/plugins/WinVST/Cider/CiderProc.cpp +++ b/plugins/WinVST/Cider/CiderProc.cpp @@ -37,8 +37,8 @@ void Cider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Cider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/ClipOnly2/ClipOnly2.h b/plugins/WinVST/ClipOnly2/ClipOnly2.h index 451dba2fb..efe560d03 100644 --- a/plugins/WinVST/ClipOnly2/ClipOnly2.h +++ b/plugins/WinVST/ClipOnly2/ClipOnly2.h @@ -51,12 +51,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/WinVST/Coils/Coils.h b/plugins/WinVST/Coils/Coils.h index 08171fbee..8a4469ee2 100755 --- a/plugins/WinVST/Coils/Coils.h +++ b/plugins/WinVST/Coils/Coils.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/Coils/CoilsProc.cpp b/plugins/WinVST/Coils/CoilsProc.cpp index 409fd66d7..d963e9053 100755 --- a/plugins/WinVST/Coils/CoilsProc.cpp +++ b/plugins/WinVST/Coils/CoilsProc.cpp @@ -32,14 +32,14 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -51,7 +51,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); @@ -116,14 +116,14 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - //long double tempSample = (inputSample * figure[2]) + figure[7]; + //double tempSample = (inputSample * figure[2]) + figure[7]; //figure[7] = -(tempSample * figure[5]) + figure[8]; //figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]); //inputSample = tempSample + sin(drySample-tempSample); @@ -135,7 +135,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //we are not using a high Q we can remove the extra sin/asin on the biquad. - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost); diff --git a/plugins/WinVST/Coils2/Coils2.h b/plugins/WinVST/Coils2/Coils2.h index 92cf19efc..0e3f61a3c 100644 --- a/plugins/WinVST/Coils2/Coils2.h +++ b/plugins/WinVST/Coils2/Coils2.h @@ -54,10 +54,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double hysteresisL; - long double hysteresisR; + double biquadA[15]; + double biquadB[15]; + double hysteresisL; + double hysteresisR; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/Coils2/Coils2Proc.cpp b/plugins/WinVST/Coils2/Coils2Proc.cpp index 2ae3bf41d..d4466f4bc 100644 --- a/plugins/WinVST/Coils2/Coils2Proc.cpp +++ b/plugins/WinVST/Coils2/Coils2Proc.cpp @@ -22,7 +22,7 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -42,15 +42,15 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -59,10 +59,10 @@ void Coils2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -121,7 +121,7 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (distScaling < 0.0001) distScaling = 0.0001; biquadA[0] = 600.0/getSampleRate(); biquadA[1] = 0.01+(pow(B,2)*0.5); - long double iirAmount = biquadA[1]/overallscale; + double iirAmount = biquadA[1]/overallscale; double K = tan(M_PI * biquadA[0]); double norm = 1.0 / (1.0 + K / biquadA[1] + K * K); biquadA[2] = K / biquadA[1] * norm; @@ -141,15 +141,15 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (biquadA[0] < 0.49999) { - long double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSample = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSample * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSample * biquadA[6]); inputSampleL = tempSample; @@ -158,10 +158,10 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[10] = (inputSampleR * biquadA[4]) - (tempSample * biquadA[6]); inputSampleR = tempSample; //create bandpass of clean tone } - long double diffSampleL = (drySampleL-inputSampleL)/distScaling; - long double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out + double diffSampleL = (drySampleL-inputSampleL)/distScaling; + double diffSampleR = (drySampleR-inputSampleR)/distScaling; //mids notched out if (biquadB[0] < 0.49999) { - long double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; + double tempSample = (diffSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = (diffSampleL * biquadB[3]) - (tempSample * biquadB[5]) + biquadB[8]; biquadB[8] = (diffSampleL * biquadB[4]) - (tempSample * biquadB[6]); diffSampleL = tempSample; @@ -187,12 +187,12 @@ void Coils2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Cojones/Cojones.cpp b/plugins/WinVST/Cojones/Cojones.cpp index f1a8359e6..bd6001fa7 100755 --- a/plugins/WinVST/Cojones/Cojones.cpp +++ b/plugins/WinVST/Cojones/Cojones.cpp @@ -24,8 +24,8 @@ Cojones::Cojones(audioMasterCallback audioMaster) : storedR[0] = storedR[1] = 0.0; diffR[0] = diffR[1] = diffR[2] = diffR[3] = diffR[4] = diffR[5] = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Cojones/Cojones.h b/plugins/WinVST/Cojones/Cojones.h index 10650f832..519304f48 100755 --- a/plugins/WinVST/Cojones/Cojones.h +++ b/plugins/WinVST/Cojones/Cojones.h @@ -56,15 +56,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double storedL[2]; - long double diffL[6]; + double storedL[2]; + double diffL[6]; - long double storedR[2]; - long double diffR[6]; + double storedR[2]; + double diffR[6]; float A; float B; diff --git a/plugins/WinVST/Cojones/CojonesProc.cpp b/plugins/WinVST/Cojones/CojonesProc.cpp index f1af80356..24606e3af 100755 --- a/plugins/WinVST/Cojones/CojonesProc.cpp +++ b/plugins/WinVST/Cojones/CojonesProc.cpp @@ -24,8 +24,8 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,17 +88,17 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -158,14 +158,14 @@ void Cojones::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -194,8 +194,8 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,17 +258,17 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 averageL[3] /= 5.0; averageL[4] /= 6.0; - long double meanA = diffL[0]; - long double meanB = diffL[0]; + double meanA = diffL[0]; + double meanB = diffL[0]; if (fabs(averageL[4]) < fabs(meanB)) {meanA = meanB; meanB = averageL[4];} if (fabs(averageL[3]) < fabs(meanB)) {meanA = meanB; meanB = averageL[3];} if (fabs(averageL[2]) < fabs(meanB)) {meanA = meanB; meanB = averageL[2];} if (fabs(averageL[1]) < fabs(meanB)) {meanA = meanB; meanB = averageL[1];} if (fabs(averageL[0]) < fabs(meanB)) {meanA = meanB; meanB = averageL[0];} - long double meanOut = ((meanA+meanB)/2.0); + double meanOut = ((meanA+meanB)/2.0); storedL[0] = (storedL[1] + meanOut); - long double outputSample = storedL[0]*body; + double outputSample = storedL[0]*body; //presubtract cojones outputSample += (((inputSampleL - storedL[0])-averageL[1])*cojones); @@ -328,16 +328,14 @@ void Cojones::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet)); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp b/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp index f39d52e6a..921f25b11 100755 --- a/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp +++ b/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp @@ -25,8 +25,8 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -64,13 +64,13 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin drive L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -82,7 +82,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with @@ -240,8 +240,8 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -279,13 +279,13 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (dCount < 1 || dCount > 5000) {dCount = 5000;} //begin L - long double temp = inputSampleL; + double temp = inputSampleL; double variSpeed = 1.0 + ((padFactorL/lastWidthL)*satComp); if (variSpeed < 1.0) variSpeed = 1.0; double totalgain = inputgain / variSpeed; @@ -297,7 +297,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } } - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); double overspill = 0; int targetWidth = widestRange; //we now have defaults and an absolute input value to work with diff --git a/plugins/WinVST/Console4Buss/Console4Buss.cpp b/plugins/WinVST/Console4Buss/Console4Buss.cpp index 0c8e00c34..4db7b1432 100755 --- a/plugins/WinVST/Console4Buss/Console4Buss.cpp +++ b/plugins/WinVST/Console4Buss/Console4Buss.cpp @@ -22,8 +22,8 @@ Console4Buss::Console4Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/WinVST/Console4Buss/Console4BussProc.cpp b/plugins/WinVST/Console4Buss/Console4BussProc.cpp index dde872ab2..2b863eaf1 100755 --- a/plugins/WinVST/Console4Buss/Console4BussProc.cpp +++ b/plugins/WinVST/Console4Buss/Console4BussProc.cpp @@ -18,11 +18,11 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -36,44 +36,8 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void Console4Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -149,11 +113,11 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; - long double slewcompensation; + double inputSampleL; + double inputSampleR; + double half; + double falf; + double slewcompensation; if (settingchase != gain) { chasespeed *= 2.0; settingchase = gain; @@ -166,44 +130,8 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -249,16 +177,14 @@ void Console4Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //this is the inverse processing for Console: boosts but not so much if there's slew. //is this too subtle an effect? - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Console4Channel/Console4Channel.cpp b/plugins/WinVST/Console4Channel/Console4Channel.cpp index 2e524a1e5..6e8f95441 100755 --- a/plugins/WinVST/Console4Channel/Console4Channel.cpp +++ b/plugins/WinVST/Console4Channel/Console4Channel.cpp @@ -20,8 +20,8 @@ Console4Channel::Console4Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp b/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp index 3538710ed..eed5c8d67 100755 --- a/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp +++ b/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp @@ -18,10 +18,10 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; // replace inputgain with gain, serves same purpose. Stereo inputsample. if (settingchase != gain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -101,14 +65,14 @@ void Console4Channel::processReplacing(float **inputs, float **outputs, VstInt32 //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,10 +95,10 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double half; - long double falf; + double inputSampleL; + double inputSampleR; + double half; + double falf; if (settingchase != gain) { chasespeed *= 2.0; @@ -148,44 +112,8 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; @@ -214,16 +142,14 @@ void Console4Channel::processDoubleReplacing(double **inputs, double **outputs, //this is part of the Purest line: stuff that is on every track //needs to be DAMN LOW ON MATH srsly guys - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Console5Buss/Console5Buss.cpp b/plugins/WinVST/Console5Buss/Console5Buss.cpp index 7e937a84b..69a467ab8 100755 --- a/plugins/WinVST/Console5Buss/Console5Buss.cpp +++ b/plugins/WinVST/Console5Buss/Console5Buss.cpp @@ -22,8 +22,8 @@ Console5Buss::Console5Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Console5Buss/Console5Buss.h b/plugins/WinVST/Console5Buss/Console5Buss.h index 0166f3370..81f9d0eac 100755 --- a/plugins/WinVST/Console5Buss/Console5Buss.h +++ b/plugins/WinVST/Console5Buss/Console5Buss.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Console5Buss/Console5BussProc.cpp b/plugins/WinVST/Console5Buss/Console5BussProc.cpp index 21069e81e..a61c2e7cb 100755 --- a/plugins/WinVST/Console5Buss/Console5BussProc.cpp +++ b/plugins/WinVST/Console5Buss/Console5BussProc.cpp @@ -25,8 +25,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -148,14 +112,14 @@ void Console5Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -185,8 +149,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -199,44 +163,8 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -308,16 +236,14 @@ void Console5Buss::processDoubleReplacing(double **inputs, double **outputs, Vst lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); //this cuts back the DC offset directly, relative to how near zero we are - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Console5Channel/Console5Channel.cpp b/plugins/WinVST/Console5Channel/Console5Channel.cpp index 1a8f6fb00..b38d63844 100755 --- a/plugins/WinVST/Console5Channel/Console5Channel.cpp +++ b/plugins/WinVST/Console5Channel/Console5Channel.cpp @@ -22,8 +22,8 @@ Console5Channel::Console5Channel(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Console5Channel/Console5Channel.h b/plugins/WinVST/Console5Channel/Console5Channel.h index bbc58b357..17e48be47 100755 --- a/plugins/WinVST/Console5Channel/Console5Channel.h +++ b/plugins/WinVST/Console5Channel/Console5Channel.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp b/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp index a01017008..bab2c5971 100755 --- a/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp +++ b/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp @@ -25,8 +25,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5Channel::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5Channel::processDoubleReplacing(double **inputs, double **outputs, inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp b/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp index 350a6b379..25995665f 100755 --- a/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp +++ b/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp @@ -22,8 +22,8 @@ Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkCh.h b/plugins/WinVST/Console5DarkCh/Console5DarkCh.h index 3265f5ca6..f3a777fbb 100755 --- a/plugins/WinVST/Console5DarkCh/Console5DarkCh.h +++ b/plugins/WinVST/Console5DarkCh/Console5DarkCh.h @@ -61,8 +61,8 @@ private: double gainchase; double settingchase; double chasespeed; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp b/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp index ba3a84275..60469e11e 100755 --- a/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp +++ b/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp @@ -25,8 +25,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -39,44 +39,8 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -149,14 +113,14 @@ void Console5DarkCh::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -186,8 +150,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V double nearZeroR; double servoTrim = 0.0000001 / overallscale; double bassTrim = 0.005 / overallscale; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -200,44 +164,8 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -310,16 +238,14 @@ void Console5DarkCh::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Console6Buss/Console6BussProc.cpp b/plugins/WinVST/Console6Buss/Console6BussProc.cpp index ea597bf6a..03f8fb9a6 100755 --- a/plugins/WinVST/Console6Buss/Console6BussProc.cpp +++ b/plugins/WinVST/Console6Buss/Console6BussProc.cpp @@ -18,8 +18,8 @@ void Console6Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Console6Channel/Console6ChannelProc.cpp b/plugins/WinVST/Console6Channel/Console6ChannelProc.cpp index 65d2e793c..2d835fc8c 100755 --- a/plugins/WinVST/Console6Channel/Console6ChannelProc.cpp +++ b/plugins/WinVST/Console6Channel/Console6ChannelProc.cpp @@ -18,8 +18,8 @@ void Console6Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Console6Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Console7Buss/Console7Buss.h b/plugins/WinVST/Console7Buss/Console7Buss.h index 7fa80b088..0be4fcf81 100644 --- a/plugins/WinVST/Console7Buss/Console7Buss.h +++ b/plugins/WinVST/Console7Buss/Console7Buss.h @@ -55,8 +55,8 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Console7Buss/Console7BussProc.cpp b/plugins/WinVST/Console7Buss/Console7BussProc.cpp index 0ef605a6e..6008a31b0 100644 --- a/plugins/WinVST/Console7Buss/Console7BussProc.cpp +++ b/plugins/WinVST/Console7Buss/Console7BussProc.cpp @@ -14,7 +14,7 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -42,15 +42,15 @@ void Console7Buss::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -104,7 +104,7 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A * 1.03; + double inputgain = A * 1.03; if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; @@ -132,15 +132,15 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -169,12 +169,12 @@ void Console7Buss::processDoubleReplacing(double **inputs, double **outputs, Vst //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Console7Cascade/Console7Cascade.h b/plugins/WinVST/Console7Cascade/Console7Cascade.h index 13ef6e55e..05254a102 100644 --- a/plugins/WinVST/Console7Cascade/Console7Cascade.h +++ b/plugins/WinVST/Console7Cascade/Console7Cascade.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp b/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp index d210ca9a8..f004da812 100644 --- a/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp +++ b/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp @@ -14,7 +14,7 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Cascade::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Cascade::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Console7Channel/Console7Channel.h b/plugins/WinVST/Console7Channel/Console7Channel.h index 7833df454..7c8703c47 100644 --- a/plugins/WinVST/Console7Channel/Console7Channel.h +++ b/plugins/WinVST/Console7Channel/Console7Channel.h @@ -55,7 +55,7 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp b/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp index 18976ea5e..b683073da 100644 --- a/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp +++ b/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp @@ -14,7 +14,7 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -36,15 +36,15 @@ void Console7Channel::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -94,7 +94,7 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = A*1.272019649514069; + double inputgain = A*1.272019649514069; //which is, in fact, the square root of 1.618033988749894848204586... //this happens to give us a boost factor where the track continues to get louder even //as it saturates and loses a bit of peak energy. Console7Channel channels go to 12! (.272,etc) @@ -116,15 +116,15 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -149,12 +149,12 @@ void Console7Channel::processDoubleReplacing(double **inputs, double **outputs, //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Console7Crunch/Console7Crunch.h b/plugins/WinVST/Console7Crunch/Console7Crunch.h index fad7640a6..cb1c47ff2 100644 --- a/plugins/WinVST/Console7Crunch/Console7Crunch.h +++ b/plugins/WinVST/Console7Crunch/Console7Crunch.h @@ -55,11 +55,11 @@ private: double gainchase; double chasespeed; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp b/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp index f4c07fc9d..7dac81098 100644 --- a/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp +++ b/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp @@ -14,7 +14,7 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -68,14 +68,14 @@ void Console7Crunch::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -178,7 +178,7 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputgain = 1.0-(pow(1.0-A,2)); + double inputgain = 1.0-(pow(1.0-A,2)); if (gainchase != inputgain) chasespeed *= 2.0; if (chasespeed > sampleFrames) chasespeed = sampleFrames; if (gainchase < 0.0) gainchase = inputgain; @@ -232,14 +232,14 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right chasespeed *= 0.9999; chasespeed -= 0.01; if (chasespeed < 64.0) chasespeed = 64.0; @@ -317,12 +317,12 @@ void Console7Crunch::processDoubleReplacing(double **inputs, double **outputs, V //we re-amplify after the distortion relative to how much we cut back previously. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.cpp b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.cpp index 6653b9192..d634bfc08 100755 --- a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.cpp +++ b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.cpp @@ -36,8 +36,8 @@ CrunchyGrooveWear::CrunchyGrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.h b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.h index 3489e5bd3..3ccd654a6 100755 --- a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.h +++ b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp index 3c9762ef2..632ee3f59 100755 --- a/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp +++ b/plugins/WinVST/CrunchyGrooveWear/CrunchyGrooveWearProc.cpp @@ -99,51 +99,15 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -431,14 +395,14 @@ void CrunchyGrooveWear::processReplacing(float **inputs, float **outputs, VstInt drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -542,51 +506,15 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -874,16 +802,14 @@ void CrunchyGrooveWear::processDoubleReplacing(double **inputs, double **outputs drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Crystal/Crystal.cpp b/plugins/WinVST/Crystal/Crystal.cpp index 705fe2a99..67db8482c 100755 --- a/plugins/WinVST/Crystal/Crystal.cpp +++ b/plugins/WinVST/Crystal/Crystal.cpp @@ -19,8 +19,8 @@ Crystal::Crystal(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bL[count] = 0; bR[count] = 0;} lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Crystal/Crystal.h b/plugins/WinVST/Crystal/Crystal.h index 45ebb6ad0..524bbc595 100755 --- a/plugins/WinVST/Crystal/Crystal.h +++ b/plugins/WinVST/Crystal/Crystal.h @@ -60,8 +60,8 @@ private: double bR[35]; double lastSampleR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Crystal/CrystalProc.cpp b/plugins/WinVST/Crystal/CrystalProc.cpp index 7e696a70f..f5d6746b1 100755 --- a/plugins/WinVST/Crystal/CrystalProc.cpp +++ b/plugins/WinVST/Crystal/CrystalProc.cpp @@ -37,8 +37,8 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -191,14 +191,14 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -240,8 +240,8 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -394,16 +394,14 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //when current and old samples are different from each other, otherwise you can't tell it's there. //This is not only during silence but the tops of low frequency waves: it scales down to affect lows more gently. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Dark/DarkProc.cpp b/plugins/WinVST/Dark/DarkProc.cpp index 955a53f85..811fdf384 100755 --- a/plugins/WinVST/Dark/DarkProc.cpp +++ b/plugins/WinVST/Dark/DarkProc.cpp @@ -34,8 +34,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -149,8 +149,8 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/DarkNoise/DarkNoiseProc.cpp b/plugins/WinVST/DarkNoise/DarkNoiseProc.cpp index be7b9d0b5..cb4f3428f 100755 --- a/plugins/WinVST/DarkNoise/DarkNoiseProc.cpp +++ b/plugins/WinVST/DarkNoise/DarkNoiseProc.cpp @@ -51,12 +51,12 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -92,8 +92,8 @@ void DarkNoise::processReplacing(float **inputs, float **outputs, VstInt32 sampl double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -184,12 +184,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (freqTarget < freq) { outputNoiseL = ((outputNoiseL-0.5)*(1.0-(1.0/freq)))+0.5; @@ -225,8 +225,8 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt double nondarkSampleL = inputSampleL; double nondarkSampleR = inputSampleR; - long double previousPoleL = 0; - long double previousPoleR = 0; + double previousPoleL = 0; + double previousPoleR = 0; for (int y = 0; y < yLimit; y++) { for (int x = xLimit; x >= 0; x--) {bL[x+1][y] = bL[x][y]; bR[x+1][y] = bR[x][y];} bL[0][y] = previousPoleL = inputSampleL; @@ -255,12 +255,12 @@ void DarkNoise::processDoubleReplacing(double **inputs, double **outputs, VstInt //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/DeBess/DeBess.h b/plugins/WinVST/DeBess/DeBess.h index b60d94f0a..26e8bb620 100755 --- a/plugins/WinVST/DeBess/DeBess.h +++ b/plugins/WinVST/DeBess/DeBess.h @@ -56,13 +56,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double sL[41], mL[41], cL[41]; + double sL[41], mL[41], cL[41]; double ratioAL; double ratioBL; double iirSampleAL; double iirSampleBL; - long double sR[41], mR[41], cR[41]; + double sR[41], mR[41], cR[41]; double ratioAR; double ratioBR; double iirSampleAR; diff --git a/plugins/WinVST/DeBess/DeBessProc.cpp b/plugins/WinVST/DeBess/DeBessProc.cpp index 05d4b5668..075c9de3e 100755 --- a/plugins/WinVST/DeBess/DeBessProc.cpp +++ b/plugins/WinVST/DeBess/DeBessProc.cpp @@ -28,8 +28,8 @@ void DeBess::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -130,8 +130,8 @@ void DeBess::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/DeEss/DeEss.cpp b/plugins/WinVST/DeEss/DeEss.cpp index 64a9503df..f57f5c63c 100755 --- a/plugins/WinVST/DeEss/DeEss.cpp +++ b/plugins/WinVST/DeEss/DeEss.cpp @@ -32,8 +32,8 @@ DeEss::DeEss(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DeEss/DeEss.h b/plugins/WinVST/DeEss/DeEss.h index dcab1e6c3..93afbe7b9 100755 --- a/plugins/WinVST/DeEss/DeEss.h +++ b/plugins/WinVST/DeEss/DeEss.h @@ -103,8 +103,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DeEss/DeEssProc.cpp b/plugins/WinVST/DeEss/DeEssProc.cpp index 9b030a4c6..3f9adf647 100755 --- a/plugins/WinVST/DeEss/DeEssProc.cpp +++ b/plugins/WinVST/DeEss/DeEssProc.cpp @@ -28,8 +28,8 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -148,14 +148,14 @@ void DeEss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,8 +188,8 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -308,16 +308,14 @@ void DeEss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DeHiss/DeHissProc.cpp b/plugins/WinVST/DeHiss/DeHissProc.cpp index 405566e8a..41074f9c5 100755 --- a/plugins/WinVST/DeHiss/DeHissProc.cpp +++ b/plugins/WinVST/DeHiss/DeHissProc.cpp @@ -35,12 +35,12 @@ void DeHiss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; @@ -166,12 +166,12 @@ void DeHiss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin L storedL[1] = storedL[0]; diff --git a/plugins/WinVST/DeRez/DeRez.cpp b/plugins/WinVST/DeRez/DeRez.cpp index cb9b514a8..f24f99df9 100755 --- a/plugins/WinVST/DeRez/DeRez.cpp +++ b/plugins/WinVST/DeRez/DeRez.cpp @@ -23,8 +23,8 @@ DeRez::DeRez(audioMasterCallback audioMaster) : incrementA = 0.0; incrementB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DeRez/DeRez.h b/plugins/WinVST/DeRez/DeRez.h index 8ebdcd9d6..85cfe1c66 100755 --- a/plugins/WinVST/DeRez/DeRez.h +++ b/plugins/WinVST/DeRez/DeRez.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/DeRez/DeRezProc.cpp b/plugins/WinVST/DeRez/DeRezProc.cpp index cbe42d57d..36cb20004 100755 --- a/plugins/WinVST/DeRez/DeRezProc.cpp +++ b/plugins/WinVST/DeRez/DeRezProc.cpp @@ -26,48 +26,12 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -75,8 +39,8 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -90,7 +54,7 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -130,14 +94,14 @@ void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,48 +132,12 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38 && (targetB == 0)) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23 && (targetB == 0)) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23 && (targetB == 0)) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; incrementB = ((incrementB*999.0)+targetB)/1000.0; @@ -217,8 +145,8 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -232,7 +160,7 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double offset; + double offset; if (incrementB > 0.0005) { if (inputSampleL > 0) @@ -272,16 +200,14 @@ void DeRez::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s lastSampleL = drySampleL; lastSampleR = drySampleR; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DeRez2/DeRez2Proc.cpp b/plugins/WinVST/DeRez2/DeRez2Proc.cpp index 889fd79b4..d43944d9e 100755 --- a/plugins/WinVST/DeRez2/DeRez2Proc.cpp +++ b/plugins/WinVST/DeRez2/DeRez2Proc.cpp @@ -28,12 +28,12 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -42,8 +42,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -57,8 +57,8 @@ void DeRez2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; @@ -206,12 +206,12 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; incrementA = ((incrementA*999.0)+targetA)/1000.0; @@ -220,8 +220,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //incrementB is the bit depth derez position += incrementA; - long double outputSampleL = heldSampleL; - long double outputSampleR = heldSampleR; + double outputSampleL = heldSampleL; + double outputSampleR = heldSampleR; if (position > 1.0) { position -= 1.0; @@ -235,8 +235,8 @@ void DeRez2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = outputSampleL; inputSampleR = outputSampleR; - long double tempL = inputSampleL; - long double tempR = inputSampleR; + double tempL = inputSampleL; + double tempR = inputSampleR; if (inputSampleL != lastOutputSampleL) { tempL = inputSampleL; diff --git a/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp b/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp index 6b109e1ed..e7146df5d 100755 --- a/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp +++ b/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp @@ -32,8 +32,8 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -217,8 +217,8 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Density/Density.cpp b/plugins/WinVST/Density/Density.cpp index bac4fb24b..01ad61f14 100755 --- a/plugins/WinVST/Density/Density.cpp +++ b/plugins/WinVST/Density/Density.cpp @@ -21,8 +21,8 @@ Density::Density(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Density/Density.h b/plugins/WinVST/Density/Density.h index b634c4475..0f188b3bb 100755 --- a/plugins/WinVST/Density/Density.h +++ b/plugins/WinVST/Density/Density.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/WinVST/Density/DensityProc.cpp b/plugins/WinVST/Density/DensityProc.cpp index f229a9ded..5db9e5022 100755 --- a/plugins/WinVST/Density/DensityProc.cpp +++ b/plugins/WinVST/Density/DensityProc.cpp @@ -27,53 +27,17 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Density::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -187,53 +151,17 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 density = density * fabs(density); double count; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Density::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Density2/Density2.h b/plugins/WinVST/Density2/Density2.h index cca180d09..eb0ca981c 100755 --- a/plugins/WinVST/Density2/Density2.h +++ b/plugins/WinVST/Density2/Density2.h @@ -59,25 +59,25 @@ private: uint32_t fpdR; //default stuff - long double last3SampleL; - long double last2SampleL; - long double last1SampleL; - long double ataAL; - long double ataBL; - long double ataCL; - long double lastDiffSampleL; - long double iirSampleAL; - long double iirSampleBL; + double last3SampleL; + double last2SampleL; + double last1SampleL; + double ataAL; + double ataBL; + double ataCL; + double lastDiffSampleL; + double iirSampleAL; + double iirSampleBL; - long double last3SampleR; - long double last2SampleR; - long double last1SampleR; - long double ataAR; - long double ataBR; - long double ataCR; - long double lastDiffSampleR; - long double iirSampleAR; - long double iirSampleBR; + double last3SampleR; + double last2SampleR; + double last1SampleR; + double ataAR; + double ataBR; + double ataCR; + double lastDiffSampleR; + double iirSampleAR; + double iirSampleBR; float A; float B; diff --git a/plugins/WinVST/Density2/Density2Proc.cpp b/plugins/WinVST/Density2/Density2Proc.cpp index e266cd26a..bd79936ab 100755 --- a/plugins/WinVST/Density2/Density2Proc.cpp +++ b/plugins/WinVST/Density2/Density2Proc.cpp @@ -27,18 +27,18 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -46,7 +46,7 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -83,12 +83,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -128,12 +128,12 @@ void Density2::processReplacing(float **inputs, float **outputs, VstInt32 sample ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -184,18 +184,18 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleL = halfwaySampleL; + double halfwaySampleL = (inputSampleL + last1SampleL + ((-last2SampleL + last3SampleL) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleL = halfwaySampleL; - long double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; - long double halfDrySampleR = halfwaySampleR; + double halfwaySampleR = (inputSampleR + last1SampleR + ((-last2SampleR + last3SampleR) * 0.0414213562373095048801688)) / 2.0; + double halfDrySampleR = halfwaySampleR; last3SampleL = last2SampleL; last2SampleL = last1SampleL; last1SampleL = inputSampleL; last3SampleR = last2SampleR; last2SampleR = last1SampleR; last1SampleR = inputSampleR; @@ -203,7 +203,7 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (halfwaySampleL * iirAmount); halfwaySampleL -= iirSampleBL; //highpass section iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (halfwaySampleR * iirAmount); halfwaySampleR -= iirSampleBR; //highpass section - long double bridgerectifier; + double bridgerectifier; double count = density; while (count > 1.0) { @@ -240,12 +240,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = halfwaySampleL - halfDrySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataBL += ataCL; ataAL -= ataCL; ataCL = ataBL; - long double halfDiffSampleL = ataCL * 0.915965594177219015; + double halfDiffSampleL = ataCL * 0.915965594177219015; ataCR = halfwaySampleR - halfDrySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataBR += ataCR; ataAR -= ataCR; ataCR = ataBR; - long double halfDiffSampleR = ataCR * 0.915965594177219015; + double halfDiffSampleR = ataCR * 0.915965594177219015; iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); inputSampleL -= iirSampleAL; //highpass section iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); inputSampleR -= iirSampleAR; //highpass section @@ -285,12 +285,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 ataCL = inputSampleL - drySampleL; ataAL *= 0.915965594177219015; ataBL *= 0.915965594177219015; ataAL += ataCL; ataBL -= ataCL; ataCL = ataAL; - long double diffSampleL = ataCL * 0.915965594177219015; + double diffSampleL = ataCL * 0.915965594177219015; ataCR = inputSampleR - drySampleR; ataAR *= 0.915965594177219015; ataBR *= 0.915965594177219015; ataAR += ataCR; ataBR -= ataCR; ataCR = ataAR; - long double diffSampleR = ataCR * 0.915965594177219015; + double diffSampleR = ataCR * 0.915965594177219015; inputSampleL = drySampleL + ((diffSampleL + halfDiffSampleL + lastDiffSampleL) / 1.187); lastDiffSampleL = diffSampleL / 2.0; @@ -303,12 +303,12 @@ void Density2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR*(1.0-wet))+(inputSampleR*wet); //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Desk/Desk.cpp b/plugins/WinVST/Desk/Desk.cpp index 9582f0459..a23bbc3b5 100755 --- a/plugins/WinVST/Desk/Desk.cpp +++ b/plugins/WinVST/Desk/Desk.cpp @@ -18,8 +18,8 @@ Desk::Desk(audioMasterCallback audioMaster) : lastSampleR = 0.0; lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Desk/Desk.h b/plugins/WinVST/Desk/Desk.h index f7f933df0..b33f2bf52 100755 --- a/plugins/WinVST/Desk/Desk.h +++ b/plugins/WinVST/Desk/Desk.h @@ -51,15 +51,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/WinVST/Desk/DeskProc.cpp b/plugins/WinVST/Desk/DeskProc.cpp index d53894b86..328e06643 100755 --- a/plugins/WinVST/Desk/DeskProc.cpp +++ b/plugins/WinVST/Desk/DeskProc.cpp @@ -30,53 +30,17 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR /= gain; //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -190,53 +154,17 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double combsample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -308,16 +236,14 @@ void Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR /= gain; //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Desk4/Desk4.cpp b/plugins/WinVST/Desk4/Desk4.cpp index 0a05d870b..ebf1daadb 100755 --- a/plugins/WinVST/Desk4/Desk4.cpp +++ b/plugins/WinVST/Desk4/Desk4.cpp @@ -30,8 +30,8 @@ Desk4::Desk4(audioMasterCallback audioMaster) : lastSlewR = 0.0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Desk4/Desk4.h b/plugins/WinVST/Desk4/Desk4.h index 802ee4733..8b1a72406 100755 --- a/plugins/WinVST/Desk4/Desk4.h +++ b/plugins/WinVST/Desk4/Desk4.h @@ -70,8 +70,8 @@ private: double lastSlewR; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Desk4/Desk4Proc.cpp b/plugins/WinVST/Desk4/Desk4Proc.cpp index fd165b697..0426cc218 100755 --- a/plugins/WinVST/Desk4/Desk4Proc.cpp +++ b/plugins/WinVST/Desk4/Desk4Proc.cpp @@ -48,51 +48,15 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,14 +190,14 @@ void Desk4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -286,51 +250,15 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double combSampleR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -464,16 +392,14 @@ void Desk4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DigitalBlack/DigitalBlackProc.cpp b/plugins/WinVST/DigitalBlack/DigitalBlackProc.cpp index 758a5d899..8caeff273 100755 --- a/plugins/WinVST/DigitalBlack/DigitalBlackProc.cpp +++ b/plugins/WinVST/DigitalBlack/DigitalBlackProc.cpp @@ -24,12 +24,12 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -67,7 +67,7 @@ void DigitalBlack::processReplacing(float **inputs, float **outputs, VstInt32 sa double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); @@ -125,12 +125,12 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputSampleL > 0) { @@ -168,7 +168,7 @@ void DigitalBlack::processDoubleReplacing(double **inputs, double **outputs, Vst double gate = 1.0; if (gaterollerL < 1.0) gate = gaterollerL; - long double bridgerectifier = 1-cos(fabs(inputSampleL)); + double bridgerectifier = 1-cos(fabs(inputSampleL)); if (inputSampleL > 0) inputSampleL = (inputSampleL*gate)+(bridgerectifier*(1-gate)); else inputSampleL = (inputSampleL*gate)-(bridgerectifier*(1-gate)); diff --git a/plugins/WinVST/Distance/Distance.cpp b/plugins/WinVST/Distance/Distance.cpp index 7ccd8fba2..ca1806e47 100755 --- a/plugins/WinVST/Distance/Distance.cpp +++ b/plugins/WinVST/Distance/Distance.cpp @@ -16,8 +16,8 @@ Distance::Distance(audioMasterCallback audioMaster) : B = 1.0; thirdresultL = prevresultL = lastclampL = clampL = changeL = lastL = 0.0; thirdresultR = prevresultR = lastclampR = clampR = changeR = lastR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Distance/Distance.h b/plugins/WinVST/Distance/Distance.h index 5566f8485..021335d65 100755 --- a/plugins/WinVST/Distance/Distance.h +++ b/plugins/WinVST/Distance/Distance.h @@ -67,8 +67,8 @@ private: double prevresultR; double lastR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Distance/DistanceProc.cpp b/plugins/WinVST/Distance/DistanceProc.cpp index 32eb3fa9d..30065e778 100755 --- a/plugins/WinVST/Distance/DistanceProc.cpp +++ b/plugins/WinVST/Distance/DistanceProc.cpp @@ -28,53 +28,17 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -123,14 +87,14 @@ void Distance::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -163,53 +127,17 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double dry = 1.0-wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -258,16 +186,14 @@ void Distance::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (drySampleR * dry)+(inputSampleR*wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Distance2/Distance2.cpp b/plugins/WinVST/Distance2/Distance2.cpp index d6e26d85e..8e1e63871 100755 --- a/plugins/WinVST/Distance2/Distance2.cpp +++ b/plugins/WinVST/Distance2/Distance2.cpp @@ -61,8 +61,8 @@ Distance2::Distance2(audioMasterCallback audioMaster) : thresholdL = 1.763323098246125; thresholdM = 1.939655408070737; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Distance2/Distance2.h b/plugins/WinVST/Distance2/Distance2.h index dba008f6a..17d29134d 100755 --- a/plugins/WinVST/Distance2/Distance2.h +++ b/plugins/WinVST/Distance2/Distance2.h @@ -54,51 +54,51 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double lastSampleAL; - long double lastSampleBL; - long double lastSampleCL; - long double lastSampleDL; - long double lastSampleEL; - long double lastSampleFL; - long double lastSampleGL; - long double lastSampleHL; - long double lastSampleIL; - long double lastSampleJL; - long double lastSampleKL; - long double lastSampleLL; - long double lastSampleML; + double lastSampleAL; + double lastSampleBL; + double lastSampleCL; + double lastSampleDL; + double lastSampleEL; + double lastSampleFL; + double lastSampleGL; + double lastSampleHL; + double lastSampleIL; + double lastSampleJL; + double lastSampleKL; + double lastSampleLL; + double lastSampleML; - long double lastSampleAR; - long double lastSampleBR; - long double lastSampleCR; - long double lastSampleDR; - long double lastSampleER; - long double lastSampleFR; - long double lastSampleGR; - long double lastSampleHR; - long double lastSampleIR; - long double lastSampleJR; - long double lastSampleKR; - long double lastSampleLR; - long double lastSampleMR; + double lastSampleAR; + double lastSampleBR; + double lastSampleCR; + double lastSampleDR; + double lastSampleER; + double lastSampleFR; + double lastSampleGR; + double lastSampleHR; + double lastSampleIR; + double lastSampleJR; + double lastSampleKR; + double lastSampleLR; + double lastSampleMR; - long double thresholdA; - long double thresholdB; - long double thresholdC; - long double thresholdD; - long double thresholdE; - long double thresholdF; - long double thresholdG; - long double thresholdH; - long double thresholdI; - long double thresholdJ; - long double thresholdK; - long double thresholdL; - long double thresholdM; + double thresholdA; + double thresholdB; + double thresholdC; + double thresholdD; + double thresholdE; + double thresholdF; + double thresholdG; + double thresholdH; + double thresholdI; + double thresholdJ; + double thresholdK; + double thresholdL; + double thresholdM; double thirdSampleL; double lastSampleL; diff --git a/plugins/WinVST/Distance2/Distance2Proc.cpp b/plugins/WinVST/Distance2/Distance2Proc.cpp index 473f3c86e..0a92a9268 100755 --- a/plugins/WinVST/Distance2/Distance2Proc.cpp +++ b/plugins/WinVST/Distance2/Distance2Proc.cpp @@ -43,8 +43,8 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -97,7 +97,7 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -266,14 +266,14 @@ void Distance2::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -321,8 +321,8 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -375,7 +375,7 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= softslew; //scale into Atmosphere algorithm //left - long double clamp = inputSampleL - lastSampleAL; + double clamp = inputSampleL - lastSampleAL; if (clamp > thresholdA) inputSampleL = lastSampleAL + thresholdA; if (-clamp > thresholdA) inputSampleL = lastSampleAL - thresholdA; @@ -544,16 +544,14 @@ void Distance2::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Distortion/Distortion.h b/plugins/WinVST/Distortion/Distortion.h index 53ccfde6c..c0f2d7553 100755 --- a/plugins/WinVST/Distortion/Distortion.h +++ b/plugins/WinVST/Distortion/Distortion.h @@ -55,10 +55,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousInL[9]; - long double previousOutL[9]; - long double previousInR[9]; - long double previousOutR[9]; + double previousInL[9]; + double previousOutL[9]; + double previousInR[9]; + double previousOutR[9]; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/Distortion/DistortionProc.cpp b/plugins/WinVST/Distortion/DistortionProc.cpp index 31b455c6e..8d6a4f8b0 100755 --- a/plugins/WinVST/Distortion/DistortionProc.cpp +++ b/plugins/WinVST/Distortion/DistortionProc.cpp @@ -23,18 +23,18 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -74,14 +74,14 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -90,7 +90,7 @@ void Distortion::processReplacing(float **inputs, float **outputs, VstInt32 samp } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; @@ -144,18 +144,18 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= input; inputSampleR *= input; for (int x = 0; x < stages; x++) { - long double temp; + double temp; temp = (inputSampleL+previousInL[x])*0.5; previousInL[x] = inputSampleL; inputSampleL = temp; @@ -195,14 +195,14 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -211,7 +211,7 @@ void Distortion::processDoubleReplacing(double **inputs, double **outputs, VstIn } for (int x = 1; x < (stages/2); x++) { - long double temp; + double temp; temp = (inputSampleL+previousOutL[x])*0.5; previousOutL[x] = inputSampleL; inputSampleL = temp; diff --git a/plugins/WinVST/DitherFloat/DitherFloatProc.cpp b/plugins/WinVST/DitherFloat/DitherFloatProc.cpp index a7121e8ac..80e204250 100755 --- a/plugins/WinVST/DitherFloat/DitherFloatProc.cpp +++ b/plugins/WinVST/DitherFloat/DitherFloatProc.cpp @@ -19,9 +19,9 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -63,8 +63,8 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); @@ -104,9 +104,9 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI overallscale *= getSampleRate(); int floatOffset = (A * 32); - long double blend = B; + double blend = B; - long double gain = 0; + double gain = 0; switch (floatOffset) { @@ -148,8 +148,8 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1 + (gain-1); - long double inputSampleR = *in2 + (gain-1); + double inputSampleL = *in1 + (gain-1); + double inputSampleR = *in2 + (gain-1); diff --git a/plugins/WinVST/DitherMeDiskers/DitherMeDiskers.h b/plugins/WinVST/DitherMeDiskers/DitherMeDiskers.h index 11f769eb2..4ba134f9a 100755 --- a/plugins/WinVST/DitherMeDiskers/DitherMeDiskers.h +++ b/plugins/WinVST/DitherMeDiskers/DitherMeDiskers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/WinVST/DitherMeTimbers/DitherMeTimbers.h b/plugins/WinVST/DitherMeTimbers/DitherMeTimbers.h index 58daf0f03..03d712ee0 100755 --- a/plugins/WinVST/DitherMeTimbers/DitherMeTimbers.h +++ b/plugins/WinVST/DitherMeTimbers/DitherMeTimbers.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double lastSampleL; double lastSample2L; double lastSampleR; diff --git a/plugins/WinVST/Ditherbox/Ditherbox.h b/plugins/WinVST/Ditherbox/Ditherbox.h index fa54082b1..164f37bab 100755 --- a/plugins/WinVST/Ditherbox/Ditherbox.h +++ b/plugins/WinVST/Ditherbox/Ditherbox.h @@ -54,8 +54,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; double contingentErrL; double contingentErrR; double currentDitherL; @@ -68,10 +68,10 @@ private: double NSOddR; double prevR; double nsR[16]; - long double lastSampleL; - long double outSampleL; - long double lastSampleR; - long double outSampleR; + double lastSampleL; + double outSampleL; + double lastSampleR; + double outSampleR; double iirSampleAL; double iirSampleBL; diff --git a/plugins/WinVST/Ditherbox/DitherboxProc.cpp b/plugins/WinVST/Ditherbox/DitherboxProc.cpp index 4906413e8..8851aeaa0 100755 --- a/plugins/WinVST/Ditherbox/DitherboxProc.cpp +++ b/plugins/WinVST/Ditherbox/DitherboxProc.cpp @@ -15,31 +15,31 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl float* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -48,46 +48,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; float drySampleL = inputSampleL; float drySampleR = inputSampleR; @@ -1020,31 +984,31 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt double* out2 = outputs[1]; int dtype = (int)(A * 24.999)+1; // +1 for Reaper bug workaround - long double overallscale = 1.0; + double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double iirAmount = 2250/44100.0; - long double gaintarget = 1.42; - long double gain; + double iirAmount = 2250/44100.0; + double gaintarget = 1.42; + double gain; iirAmount /= overallscale; - long double altAmount = 1.0 - iirAmount; - long double outputSampleL; - long double outputSampleR; - long double silhouette; - long double smoother; - long double bridgerectifier; - long double benfordize; + double altAmount = 1.0 - iirAmount; + double outputSampleL; + double outputSampleR; + double silhouette; + double smoother; + double bridgerectifier; + double benfordize; int hotbinA; int hotbinB; - long double totalA; - long double totalB; - long double contingentRnd; - long double absSample; - long double contingent; - long double randyConstant = 1.61803398874989484820458683436563811772030917980576; - long double omegaConstant = 0.56714329040978387299996866221035554975381578718651; - long double expConstant = 0.06598803584531253707679018759684642493857704825279; - long double trim = 2.302585092994045684017991; //natural logarithm of 10 + double totalA; + double totalB; + double contingentRnd; + double absSample; + double contingent; + double randyConstant = 1.61803398874989484820458683436563811772030917980576; + double omegaConstant = 0.56714329040978387299996866221035554975381578718651; + double expConstant = 0.06598803584531253707679018759684642493857704825279; + double trim = 2.302585092994045684017991; //natural logarithm of 10 bool highRes = false; bool dithering = true; if (dtype > 11){highRes = true; dtype -= 11;} @@ -1053,46 +1017,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; diff --git a/plugins/WinVST/DoublePaul/DoublePaulProc.cpp b/plugins/WinVST/DoublePaul/DoublePaulProc.cpp index 66de94f5c..0ba4cae2b 100755 --- a/plugins/WinVST/DoublePaul/DoublePaulProc.cpp +++ b/plugins/WinVST/DoublePaul/DoublePaulProc.cpp @@ -17,51 +17,15 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -136,51 +100,15 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn double currentDitherL; double currentDitherR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/WinVST/Drive/Drive.cpp b/plugins/WinVST/Drive/Drive.cpp index ac5f228ae..e88a7b678 100755 --- a/plugins/WinVST/Drive/Drive.cpp +++ b/plugins/WinVST/Drive/Drive.cpp @@ -21,8 +21,8 @@ Drive::Drive(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Drive/Drive.h b/plugins/WinVST/Drive/Drive.h index 525a09eb0..5b9bf5910 100755 --- a/plugins/WinVST/Drive/Drive.h +++ b/plugins/WinVST/Drive/Drive.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; double iirSampleBL; diff --git a/plugins/WinVST/Drive/DriveProc.cpp b/plugins/WinVST/Drive/DriveProc.cpp index 074ccfd3c..d30635b48 100755 --- a/plugins/WinVST/Drive/DriveProc.cpp +++ b/plugins/WinVST/Drive/DriveProc.cpp @@ -27,53 +27,17 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -127,14 +91,14 @@ void Drive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,53 +130,17 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double out; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -266,16 +194,14 @@ void Drive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DrumSlam/DrumSlam.cpp b/plugins/WinVST/DrumSlam/DrumSlam.cpp index 5b8861982..7449845c9 100755 --- a/plugins/WinVST/DrumSlam/DrumSlam.cpp +++ b/plugins/WinVST/DrumSlam/DrumSlam.cpp @@ -36,8 +36,8 @@ DrumSlam::DrumSlam(audioMasterCallback audioMaster) : iirSampleHR = 0.0; lastSampleR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DrumSlam/DrumSlam.h b/plugins/WinVST/DrumSlam/DrumSlam.h index 418282d59..3d83fce09 100755 --- a/plugins/WinVST/DrumSlam/DrumSlam.h +++ b/plugins/WinVST/DrumSlam/DrumSlam.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/WinVST/DrumSlam/DrumSlamProc.cpp b/plugins/WinVST/DrumSlam/DrumSlamProc.cpp index 2e86142c7..ab071ac1e 100755 --- a/plugins/WinVST/DrumSlam/DrumSlamProc.cpp +++ b/plugins/WinVST/DrumSlam/DrumSlamProc.cpp @@ -28,54 +28,18 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -147,10 +111,10 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -219,14 +183,14 @@ void DrumSlam::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -259,54 +223,18 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double lowSampleL; - long double lowSampleR; - long double midSampleL; - long double midSampleR; - long double highSampleL; - long double highSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double lowSampleL; + double lowSampleR; + double midSampleL; + double midSampleR; + double highSampleL; + double highSampleR; inputSampleL *= drive; @@ -378,10 +306,10 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 midSampleL = midSampleL * drive; midSampleR = midSampleR * drive; - long double skew = (midSampleL - lastSampleL); + double skew = (midSampleL - lastSampleL); lastSampleL = midSampleL; //skew will be direction/angle - long double bridgerectifier = fabs(skew); + double bridgerectifier = fabs(skew); if (bridgerectifier > 3.1415926) bridgerectifier = 3.1415926; //for skew we want it to go to zero effect again, so we use full range of the sine bridgerectifier = sin(bridgerectifier); @@ -450,16 +378,14 @@ void DrumSlam::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DubCenter/DubCenter.cpp b/plugins/WinVST/DubCenter/DubCenter.cpp index 098e72313..ed7ff1c06 100755 --- a/plugins/WinVST/DubCenter/DubCenter.cpp +++ b/plugins/WinVST/DubCenter/DubCenter.cpp @@ -80,8 +80,8 @@ DubCenter::DubCenter(audioMasterCallback audioMaster) : oscGate = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DubCenter/DubCenter.h b/plugins/WinVST/DubCenter/DubCenter.h index 9d7c7e6fb..54b9eeb59 100755 --- a/plugins/WinVST/DubCenter/DubCenter.h +++ b/plugins/WinVST/DubCenter/DubCenter.h @@ -117,8 +117,8 @@ private: double iirSampleZ; double oscGate; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DubCenter/DubCenterProc.cpp b/plugins/WinVST/DubCenter/DubCenterProc.cpp index b0c49a397..49806b773 100755 --- a/plugins/WinVST/DubCenter/DubCenterProc.cpp +++ b/plugins/WinVST/DubCenter/DubCenterProc.cpp @@ -49,8 +49,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,8 +88,8 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -306,14 +306,14 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -366,8 +366,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -405,8 +405,8 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -623,16 +623,14 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DubSub/DubSub.cpp b/plugins/WinVST/DubSub/DubSub.cpp index 6dc87fcbe..e53c47dcc 100755 --- a/plugins/WinVST/DubSub/DubSub.cpp +++ b/plugins/WinVST/DubSub/DubSub.cpp @@ -118,8 +118,8 @@ DubSub::DubSub(audioMasterCallback audioMaster) : oscGateL = 1.0; oscGateR = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DubSub/DubSub.h b/plugins/WinVST/DubSub/DubSub.h index 0e26cfad4..4f3f6af8c 100755 --- a/plugins/WinVST/DubSub/DubSub.h +++ b/plugins/WinVST/DubSub/DubSub.h @@ -159,8 +159,8 @@ private: double oscGateR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DubSub/DubSubProc.cpp b/plugins/WinVST/DubSub/DubSubProc.cpp index 7a0349d51..4195d3b38 100755 --- a/plugins/WinVST/DubSub/DubSubProc.cpp +++ b/plugins/WinVST/DubSub/DubSubProc.cpp @@ -53,8 +53,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -92,8 +92,8 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aDubSub. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; // here's the plan. // Grind Boost @@ -392,14 +392,14 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -457,8 +457,8 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -795,16 +795,14 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DustBunny/DustBunnyProc.cpp b/plugins/WinVST/DustBunny/DustBunnyProc.cpp index 27a8d66c0..d4667fdec 100755 --- a/plugins/WinVST/DustBunny/DustBunnyProc.cpp +++ b/plugins/WinVST/DustBunny/DustBunnyProc.cpp @@ -25,44 +25,8 @@ void DustBunny::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -144,52 +108,16 @@ void DustBunny::processDoubleReplacing(double **inputs, double **outputs, VstInt unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); bunny = (bunny*bunny); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/WinVST/Dyno/DynoProc.cpp b/plugins/WinVST/Dyno/DynoProc.cpp index f01381c06..3e9052c73 100755 --- a/plugins/WinVST/Dyno/DynoProc.cpp +++ b/plugins/WinVST/Dyno/DynoProc.cpp @@ -18,8 +18,8 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Dyno::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); @@ -65,8 +65,8 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Dyno::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double dyno = pow(fabs(inputSampleL),4); + double dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; //dyno is the one that tries to raise peak energy dyno = pow(fabs(inputSampleR),4); diff --git a/plugins/WinVST/EQ/EQ.cpp b/plugins/WinVST/EQ/EQ.cpp index f2e4e0134..702dd33d4 100755 --- a/plugins/WinVST/EQ/EQ.cpp +++ b/plugins/WinVST/EQ/EQ.cpp @@ -111,8 +111,8 @@ EQ::EQ(audioMasterCallback audioMaster) : flip = false; flipthree = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/EQ/EQ.h b/plugins/WinVST/EQ/EQ.h index 26fade4aa..7d533787f 100755 --- a/plugins/WinVST/EQ/EQ.h +++ b/plugins/WinVST/EQ/EQ.h @@ -59,8 +59,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/EQ/EQProc.cpp b/plugins/WinVST/EQ/EQProc.cpp index 917dc7e77..220314936 100755 --- a/plugins/WinVST/EQ/EQProc.cpp +++ b/plugins/WinVST/EQ/EQProc.cpp @@ -21,8 +21,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -69,44 +69,8 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -431,14 +395,14 @@ void EQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames inputSampleR *= outputgain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -464,8 +428,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp compscale = compscale * overallscale; //compscale is the one that's 1 or something like 2.2 for 96K rates - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highSampleL = 0.0; double midSampleL = 0.0; @@ -512,44 +476,8 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; last2SampleL = lastSampleL; lastSampleL = inputSampleL; @@ -874,16 +802,14 @@ void EQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp inputSampleR *= outputgain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/EdIsDim/EdIsDim.cpp b/plugins/WinVST/EdIsDim/EdIsDim.cpp index eb6abd32d..8a4f6db6f 100755 --- a/plugins/WinVST/EdIsDim/EdIsDim.cpp +++ b/plugins/WinVST/EdIsDim/EdIsDim.cpp @@ -13,8 +13,8 @@ EdIsDim::EdIsDim(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/EdIsDim/EdIsDim.h b/plugins/WinVST/EdIsDim/EdIsDim.h index 4f6270586..7b887d69e 100755 --- a/plugins/WinVST/EdIsDim/EdIsDim.h +++ b/plugins/WinVST/EdIsDim/EdIsDim.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/EdIsDim/EdIsDimProc.cpp b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp index 0d033eb65..2273bfcaa 100755 --- a/plugins/WinVST/EdIsDim/EdIsDimProc.cpp +++ b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp @@ -15,10 +15,10 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -27,44 +27,8 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; inputSampleR *= sidegain; @@ -74,7 +38,7 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -99,10 +63,10 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double midgain = A * 2.0; double sidegain = 2.0 - midgain; @@ -111,44 +75,8 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= midgain; @@ -159,7 +87,7 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/WinVST/Elation/ElationProc.cpp b/plugins/WinVST/Elation/ElationProc.cpp index dd2878dd9..359c931b3 100755 --- a/plugins/WinVST/Elation/ElationProc.cpp +++ b/plugins/WinVST/Elation/ElationProc.cpp @@ -34,12 +34,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; @@ -314,12 +314,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= indrive; inputSampleR *= indrive; diff --git a/plugins/WinVST/ElectroHat/ElectroHat.cpp b/plugins/WinVST/ElectroHat/ElectroHat.cpp index 6be41e4b1..0ca7bd6c1 100755 --- a/plugins/WinVST/ElectroHat/ElectroHat.cpp +++ b/plugins/WinVST/ElectroHat/ElectroHat.cpp @@ -25,8 +25,8 @@ ElectroHat::ElectroHat(audioMasterCallback audioMaster) : lok = 0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ElectroHat/ElectroHat.h b/plugins/WinVST/ElectroHat/ElectroHat.h index 85315cd63..b07061904 100755 --- a/plugins/WinVST/ElectroHat/ElectroHat.h +++ b/plugins/WinVST/ElectroHat/ElectroHat.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedSampleL; diff --git a/plugins/WinVST/ElectroHat/ElectroHatProc.cpp b/plugins/WinVST/ElectroHat/ElectroHatProc.cpp index ee5a3070f..d99dc44ab 100755 --- a/plugins/WinVST/ElectroHat/ElectroHatProc.cpp +++ b/plugins/WinVST/ElectroHat/ElectroHatProc.cpp @@ -25,8 +25,8 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -123,14 +123,14 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -160,8 +160,8 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleR; double tempSampleL; double tempSampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; int deSyn = (VstInt32)( A * 5.999 )+1; double increment = B; @@ -258,16 +258,14 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Energy/Energy.cpp b/plugins/WinVST/Energy/Energy.cpp index 8571e56c1..8d8ab6081 100755 --- a/plugins/WinVST/Energy/Energy.cpp +++ b/plugins/WinVST/Energy/Energy.cpp @@ -160,8 +160,8 @@ Energy::Energy(audioMasterCallback audioMaster) : PrevAR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Energy/Energy.h b/plugins/WinVST/Energy/Energy.h index b039c608c..0500e8391 100755 --- a/plugins/WinVST/Energy/Energy.h +++ b/plugins/WinVST/Energy/Energy.h @@ -60,8 +60,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double duoEvenL; diff --git a/plugins/WinVST/Energy/EnergyProc.cpp b/plugins/WinVST/Energy/EnergyProc.cpp index a0a86f85f..dbe218778 100755 --- a/plugins/WinVST/Energy/EnergyProc.cpp +++ b/plugins/WinVST/Energy/EnergyProc.cpp @@ -27,8 +27,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -742,14 +742,14 @@ void Energy::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -781,8 +781,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -821,8 +821,8 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; duoFactorL = PrevAL - inputSampleL; duoFactorR = PrevAR - inputSampleR; @@ -1496,16 +1496,14 @@ void Energy::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //we don't need a drySample because we never touched inputSample //so, this provides the inv/dry/wet control all by itself - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Energy2/Energy2Proc.cpp b/plugins/WinVST/Energy2/Energy2Proc.cpp index cfd7a3ba5..6cdbba15c 100644 --- a/plugins/WinVST/Energy2/Energy2Proc.cpp +++ b/plugins/WinVST/Energy2/Energy2Proc.cpp @@ -37,17 +37,17 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -680,17 +680,17 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { //hit the end point and we do an Energy sample - long double correctionL = 0.0; - long double correctionR = 0.0; + double correctionL = 0.0; + double correctionR = 0.0; if (fabs(duoIntensity) > 0.0001) { duoFactorL = PrevAL - inputSampleL; @@ -1275,12 +1275,12 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR += drySampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Ensemble/Ensemble.cpp b/plugins/WinVST/Ensemble/Ensemble.cpp index b90bf6e69..1b701ecc2 100755 --- a/plugins/WinVST/Ensemble/Ensemble.cpp +++ b/plugins/WinVST/Ensemble/Ensemble.cpp @@ -29,8 +29,8 @@ Ensemble::Ensemble(audioMasterCallback audioMaster) : airOddR = 0.0; airFactorR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Ensemble/Ensemble.h b/plugins/WinVST/Ensemble/Ensemble.h index 7697d9317..7d0af8926 100755 --- a/plugins/WinVST/Ensemble/Ensemble.h +++ b/plugins/WinVST/Ensemble/Ensemble.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff const static int totalsamples = 65540; float dL[totalsamples]; diff --git a/plugins/WinVST/Ensemble/EnsembleProc.cpp b/plugins/WinVST/Ensemble/EnsembleProc.cpp index e9a3a4392..ec4b9c8db 100755 --- a/plugins/WinVST/Ensemble/EnsembleProc.cpp +++ b/plugins/WinVST/Ensemble/EnsembleProc.cpp @@ -38,8 +38,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -56,44 +56,8 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -153,14 +117,14 @@ void Ensemble::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -203,8 +167,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double tempR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; //now we'll precalculate some stuff that needn't be in every sample @@ -221,44 +185,8 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -318,16 +246,14 @@ void Ensemble::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/EveryTrim/EveryTrim.cpp b/plugins/WinVST/EveryTrim/EveryTrim.cpp index b0a98d48c..fcb71bec3 100755 --- a/plugins/WinVST/EveryTrim/EveryTrim.cpp +++ b/plugins/WinVST/EveryTrim/EveryTrim.cpp @@ -17,8 +17,8 @@ EveryTrim::EveryTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/EveryTrim/EveryTrim.h b/plugins/WinVST/EveryTrim/EveryTrim.h index 4efc3cd6b..aec024775 100755 --- a/plugins/WinVST/EveryTrim/EveryTrim.h +++ b/plugins/WinVST/EveryTrim/EveryTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/EveryTrim/EveryTrimProc.cpp b/plugins/WinVST/EveryTrim/EveryTrimProc.cpp index 3c30eda6b..1bb858da7 100755 --- a/plugins/WinVST/EveryTrim/EveryTrimProc.cpp +++ b/plugins/WinVST/EveryTrim/EveryTrimProc.cpp @@ -21,10 +21,10 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Facet/FacetProc.cpp b/plugins/WinVST/Facet/FacetProc.cpp index 53e92ce39..fb5cdbd6e 100755 --- a/plugins/WinVST/Facet/FacetProc.cpp +++ b/plugins/WinVST/Facet/FacetProc.cpp @@ -18,8 +18,8 @@ void Facet::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -75,8 +75,8 @@ void Facet::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/FathomFive/FathomFiveProc.cpp b/plugins/WinVST/FathomFive/FathomFiveProc.cpp index f509c2188..fee6aba1e 100755 --- a/plugins/WinVST/FathomFive/FathomFiveProc.cpp +++ b/plugins/WinVST/FathomFive/FathomFiveProc.cpp @@ -25,51 +25,15 @@ void FathomFive::processReplacing(float **inputs, float **outputs, VstInt32 samp if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} @@ -143,51 +107,15 @@ void FathomFive::processDoubleReplacing(double **inputs, double **outputs, VstIn if (wet > 1.0) wet = 1.0; if (dry > 1.0) dry = 1.0; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 0) {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} diff --git a/plugins/WinVST/Floor/Floor.cpp b/plugins/WinVST/Floor/Floor.cpp index ff12e691c..7bb4a8ddb 100755 --- a/plugins/WinVST/Floor/Floor.cpp +++ b/plugins/WinVST/Floor/Floor.cpp @@ -39,8 +39,8 @@ Floor::Floor(audioMasterCallback audioMaster) : iirSample2DR = 0.0; iirSample2ER = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Floor/Floor.h b/plugins/WinVST/Floor/Floor.h index dc6b58c54..c80bb7c7f 100755 --- a/plugins/WinVST/Floor/Floor.h +++ b/plugins/WinVST/Floor/Floor.h @@ -78,8 +78,8 @@ private: double iirSample2DR; double iirSample2ER; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Floor/FloorProc.cpp b/plugins/WinVST/Floor/FloorProc.cpp index 865446b5f..0cfa58c69 100755 --- a/plugins/WinVST/Floor/FloorProc.cpp +++ b/plugins/WinVST/Floor/FloorProc.cpp @@ -36,8 +36,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -75,8 +75,8 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -247,14 +247,14 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -295,8 +295,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -334,8 +334,8 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //begin left channel if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); @@ -506,16 +506,14 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Focus/Focus.h b/plugins/WinVST/Focus/Focus.h index cd7e72a97..7b2cf706d 100755 --- a/plugins/WinVST/Focus/Focus.h +++ b/plugins/WinVST/Focus/Focus.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double figureL[9]; - long double figureR[9]; + double figureL[9]; + double figureR[9]; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/Focus/FocusProc.cpp b/plugins/WinVST/Focus/FocusProc.cpp index f25a32814..9e1c9c070 100755 --- a/plugins/WinVST/Focus/FocusProc.cpp +++ b/plugins/WinVST/Focus/FocusProc.cpp @@ -32,18 +32,18 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -62,8 +62,8 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -98,14 +98,14 @@ void Focus::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; @@ -170,18 +170,18 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * figureL[2]) + figureL[7]; + double tempSample = (inputSampleL * figureL[2]) + figureL[7]; figureL[7] = -(tempSample * figureL[5]) + figureL[8]; figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]); inputSampleL = tempSample; @@ -200,8 +200,8 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = asin(inputSampleR); //decode Console5 - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox inputSampleL *= boost; //now, focussed area gets cranked before distort inputSampleR *= boost; //now, focussed area gets cranked before distort @@ -236,14 +236,14 @@ void Focus::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); break; case 3: //Mojo - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; mojo = pow(fabs(inputSampleR),0.25); if (mojo > 0.0) inputSampleR = (sin(inputSampleR * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding break; case 4: //Dyno - long double dyno; dyno = pow(fabs(inputSampleL),4); + double dyno; dyno = pow(fabs(inputSampleL),4); if (dyno > 0.0) inputSampleL = (sin(inputSampleL * dyno) / dyno) * 1.1654321; dyno = pow(fabs(inputSampleR),4); if (dyno > 0.0) inputSampleR = (sin(inputSampleR * dyno) / dyno) * 1.1654321; diff --git a/plugins/WinVST/Fracture/Fracture.cpp b/plugins/WinVST/Fracture/Fracture.cpp index 03f3b1968..302b4dc54 100755 --- a/plugins/WinVST/Fracture/Fracture.cpp +++ b/plugins/WinVST/Fracture/Fracture.cpp @@ -16,8 +16,8 @@ Fracture::Fracture(audioMasterCallback audioMaster) : B = 0.5; //2 from 1 to 3: (B*2.999)+1 C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Fracture/Fracture.h b/plugins/WinVST/Fracture/Fracture.h index 49d271858..54aac5a86 100755 --- a/plugins/WinVST/Fracture/Fracture.h +++ b/plugins/WinVST/Fracture/Fracture.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Fracture/FractureProc.cpp b/plugins/WinVST/Fracture/FractureProc.cpp index 5c1aaa941..e7b6e7225 100755 --- a/plugins/WinVST/Fracture/FractureProc.cpp +++ b/plugins/WinVST/Fracture/FractureProc.cpp @@ -23,53 +23,17 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -98,14 +62,14 @@ void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -136,53 +100,17 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; density = density * fabs(density); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -211,16 +139,14 @@ void Fracture::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (drySampleL * dry)+(inputSampleL * wet); inputSampleR = (drySampleR * dry)+(inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/FromTape/FromTape.cpp b/plugins/WinVST/FromTape/FromTape.cpp index 40b787673..4573e48be 100755 --- a/plugins/WinVST/FromTape/FromTape.cpp +++ b/plugins/WinVST/FromTape/FromTape.cpp @@ -82,8 +82,8 @@ FromTape::FromTape(audioMasterCallback audioMaster) : flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/FromTape/FromTape.h b/plugins/WinVST/FromTape/FromTape.h index 40efabc1b..cd63776b9 100755 --- a/plugins/WinVST/FromTape/FromTape.h +++ b/plugins/WinVST/FromTape/FromTape.h @@ -120,8 +120,8 @@ private: double iirSampleYR; double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/FromTape/FromTapeProc.cpp b/plugins/WinVST/FromTape/FromTapeProc.cpp index 2d268ef27..0f4db6e85 100755 --- a/plugins/WinVST/FromTape/FromTapeProc.cpp +++ b/plugins/WinVST/FromTape/FromTapeProc.cpp @@ -37,52 +37,16 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -221,14 +185,14 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -270,51 +234,15 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double drySampleR; double randy; double invrandy; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -454,16 +382,14 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Galactic/GalacticProc.cpp b/plugins/WinVST/Galactic/GalacticProc.cpp index ccb0aef48..19344f0e4 100644 --- a/plugins/WinVST/Galactic/GalacticProc.cpp +++ b/plugins/WinVST/Galactic/GalacticProc.cpp @@ -47,12 +47,12 @@ void Galactic::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -279,12 +279,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; vibM += (oldfpd*drift); if (vibM > (3.141592653589793238*2.0)) { @@ -453,12 +453,12 @@ void Galactic::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Gatelope/Gatelope.cpp b/plugins/WinVST/Gatelope/Gatelope.cpp index 41ed2af14..225c337d5 100755 --- a/plugins/WinVST/Gatelope/Gatelope.cpp +++ b/plugins/WinVST/Gatelope/Gatelope.cpp @@ -28,8 +28,8 @@ Gatelope::Gatelope(audioMasterCallback audioMaster) : treblefreq = 1.0; bassfreq = 0.0; flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Gatelope/Gatelope.h b/plugins/WinVST/Gatelope/Gatelope.h index 06a0c5571..273e19f6f 100755 --- a/plugins/WinVST/Gatelope/Gatelope.h +++ b/plugins/WinVST/Gatelope/Gatelope.h @@ -67,8 +67,8 @@ private: double treblefreq; double bassfreq; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Gatelope/GatelopeProc.cpp b/plugins/WinVST/Gatelope/GatelopeProc.cpp index f42904218..b5f1d67d7 100755 --- a/plugins/WinVST/Gatelope/GatelopeProc.cpp +++ b/plugins/WinVST/Gatelope/GatelopeProc.cpp @@ -36,8 +36,8 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -196,14 +196,14 @@ void Gatelope::processReplacing(float **inputs, float **outputs, VstInt32 sample flip = !flip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -244,8 +244,8 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -404,16 +404,14 @@ void Gatelope::processDoubleReplacing(double **inputs, double **outputs, VstInt3 flip = !flip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/GlitchShifter/GlitchShifterProc.cpp b/plugins/WinVST/GlitchShifter/GlitchShifterProc.cpp index 9059dc5db..852c3bc0f 100755 --- a/plugins/WinVST/GlitchShifter/GlitchShifterProc.cpp +++ b/plugins/WinVST/GlitchShifter/GlitchShifterProc.cpp @@ -26,12 +26,12 @@ void GlitchShifter::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -343,12 +343,12 @@ void GlitchShifter::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} diff --git a/plugins/WinVST/Golem/Golem.cpp b/plugins/WinVST/Golem/Golem.cpp index c99c5cd92..22d4cb6f5 100755 --- a/plugins/WinVST/Golem/Golem.cpp +++ b/plugins/WinVST/Golem/Golem.cpp @@ -17,8 +17,8 @@ Golem::Golem(audioMasterCallback audioMaster) : C = 0.0; for(count = 0; count < 4098; count++) {p[count] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/Golem/Golem.h b/plugins/WinVST/Golem/Golem.h index e02ab7822..4416d3463 100755 --- a/plugins/WinVST/Golem/Golem.h +++ b/plugins/WinVST/Golem/Golem.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff double p[4099]; diff --git a/plugins/WinVST/Golem/GolemProc.cpp b/plugins/WinVST/Golem/GolemProc.cpp index 1d7e9f5f9..316632391 100755 --- a/plugins/WinVST/Golem/GolemProc.cpp +++ b/plugins/WinVST/Golem/GolemProc.cpp @@ -33,51 +33,15 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -112,14 +76,14 @@ void Golem::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = inputSampleL; //the output is totally mono - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -157,51 +121,15 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s int far = near + 1; double nearLevel = 1.0 - farLevel; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables if (phase == 2) inputSampleL = -inputSampleL; @@ -236,16 +164,14 @@ void Golem::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = inputSampleL; //the output is totally mono - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Gringer/Gringer.h b/plugins/WinVST/Gringer/Gringer.h index 3306f47eb..53d8dce83 100755 --- a/plugins/WinVST/Gringer/Gringer.h +++ b/plugins/WinVST/Gringer/Gringer.h @@ -54,10 +54,10 @@ private: uint32_t fpd; //default stuff - long double inbandL[9]; - long double outbandL[9]; - long double inbandR[9]; - long double outbandR[9]; + double inbandL[9]; + double outbandL[9]; + double inbandR[9]; + double outbandR[9]; }; diff --git a/plugins/WinVST/Gringer/GringerProc.cpp b/plugins/WinVST/Gringer/GringerProc.cpp index 2a40f387c..b76693f2e 100755 --- a/plugins/WinVST/Gringer/GringerProc.cpp +++ b/plugins/WinVST/Gringer/GringerProc.cpp @@ -58,8 +58,8 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -67,7 +67,7 @@ void Gringer::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); @@ -173,8 +173,8 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -182,7 +182,7 @@ void Gringer::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; + double tempSample = (inputSampleL * inbandL[2]) + inbandL[7]; inbandL[7] = -(tempSample * inbandL[5]) + inbandL[8]; inbandL[8] = (inputSampleL * inbandL[4]) - (tempSample * inbandL[6]); inputSampleL = fabs(tempSample); diff --git a/plugins/WinVST/GrooveWear/GrooveWear.cpp b/plugins/WinVST/GrooveWear/GrooveWear.cpp index cbe1fc57a..b15478506 100755 --- a/plugins/WinVST/GrooveWear/GrooveWear.cpp +++ b/plugins/WinVST/GrooveWear/GrooveWear.cpp @@ -36,8 +36,8 @@ GrooveWear::GrooveWear(audioMasterCallback audioMaster) : cMidPrevR = 0.0; dMidPrevR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/GrooveWear/GrooveWear.h b/plugins/WinVST/GrooveWear/GrooveWear.h index 4bf97453c..fe207c7b6 100755 --- a/plugins/WinVST/GrooveWear/GrooveWear.h +++ b/plugins/WinVST/GrooveWear/GrooveWear.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aMidL[21]; diff --git a/plugins/WinVST/GrooveWear/GrooveWearProc.cpp b/plugins/WinVST/GrooveWear/GrooveWearProc.cpp index e663203a4..98eeec25e 100755 --- a/plugins/WinVST/GrooveWear/GrooveWearProc.cpp +++ b/plugins/WinVST/GrooveWear/GrooveWearProc.cpp @@ -98,51 +98,15 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -430,14 +394,14 @@ void GrooveWear::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleR = inputSampleR; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -540,51 +504,15 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -872,16 +800,14 @@ void GrooveWear::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleR = inputSampleR; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp b/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp index b0388ab94..309ce7e4e 100755 --- a/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp +++ b/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new G GuitarConditioner::GuitarConditioner(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; lastSampleTL = 0.0; lastSampleBL = 0.0; //for Slews. T for treble, B for bass diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditioner.h b/plugins/WinVST/GuitarConditioner/GuitarConditioner.h index 3be09e141..fca5a3c07 100755 --- a/plugins/WinVST/GuitarConditioner/GuitarConditioner.h +++ b/plugins/WinVST/GuitarConditioner/GuitarConditioner.h @@ -49,8 +49,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff bool fpFlip; double lastSampleTL; diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp b/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp index b25d600d1..6bfd3bbc4 100755 --- a/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp +++ b/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp @@ -18,12 +18,12 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -40,44 +40,8 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -165,14 +129,14 @@ void GuitarConditioner::processReplacing(float **inputs, float **outputs, VstInt fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -195,12 +159,12 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double trebleL; - long double bassL; - long double trebleR; - long double bassR; + double inputSampleL; + double inputSampleR; + double trebleL; + double bassL; + double trebleR; + double bassR; double iirTreble = 0.287496/overallscale; //tight is -1 double iirBass = 0.085184/overallscale; //tight is 1 @@ -218,44 +182,8 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; trebleL = bassL = inputSampleL; trebleR = bassR = inputSampleR; @@ -342,16 +270,14 @@ void GuitarConditioner::processDoubleReplacing(double **inputs, double **outputs inputSampleR = trebleR + bassR; //final merge fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/HardVacuum/HardVacuum.cpp b/plugins/WinVST/HardVacuum/HardVacuum.cpp index 9c14f8993..533cb5610 100755 --- a/plugins/WinVST/HardVacuum/HardVacuum.cpp +++ b/plugins/WinVST/HardVacuum/HardVacuum.cpp @@ -19,8 +19,8 @@ HardVacuum::HardVacuum(audioMasterCallback audioMaster) : E = 1.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/HardVacuum/HardVacuum.h b/plugins/WinVST/HardVacuum/HardVacuum.h index 7f4c098cb..f159aadb8 100755 --- a/plugins/WinVST/HardVacuum/HardVacuum.h +++ b/plugins/WinVST/HardVacuum/HardVacuum.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/HardVacuum/HardVacuumProc.cpp b/plugins/WinVST/HardVacuum/HardVacuumProc.cpp index e0e07e2b2..87a1b1edb 100755 --- a/plugins/WinVST/HardVacuum/HardVacuumProc.cpp +++ b/plugins/WinVST/HardVacuum/HardVacuumProc.cpp @@ -36,51 +36,15 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -173,14 +137,14 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -221,52 +185,16 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -359,16 +287,14 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/HermeTrim/HermeTrim.cpp b/plugins/WinVST/HermeTrim/HermeTrim.cpp index 117cc4599..77103be7b 100755 --- a/plugins/WinVST/HermeTrim/HermeTrim.cpp +++ b/plugins/WinVST/HermeTrim/HermeTrim.cpp @@ -17,8 +17,8 @@ HermeTrim::HermeTrim(audioMasterCallback audioMaster) : C = 0.5; D = 0.5; E = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/HermeTrim/HermeTrim.h b/plugins/WinVST/HermeTrim/HermeTrim.h index f0bc8ed52..6db22a3b5 100755 --- a/plugins/WinVST/HermeTrim/HermeTrim.h +++ b/plugins/WinVST/HermeTrim/HermeTrim.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/HermeTrim/HermeTrimProc.cpp b/plugins/WinVST/HermeTrim/HermeTrimProc.cpp index 66d314485..dccb829c6 100755 --- a/plugins/WinVST/HermeTrim/HermeTrimProc.cpp +++ b/plugins/WinVST/HermeTrim/HermeTrimProc.cpp @@ -21,10 +21,10 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -33,44 +33,8 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -80,14 +44,14 @@ void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -113,10 +77,10 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; leftgain *= mastergain; rightgain *= mastergain; @@ -125,44 +89,8 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -172,16 +100,14 @@ void HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = (mid-side) * rightgain; //contains mastergain and the gain trim fixing the mid/side - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Hermepass/Hermepass.cpp b/plugins/WinVST/Hermepass/Hermepass.cpp index 4e4a5322e..c18a227be 100755 --- a/plugins/WinVST/Hermepass/Hermepass.cpp +++ b/plugins/WinVST/Hermepass/Hermepass.cpp @@ -33,8 +33,8 @@ Hermepass::Hermepass(audioMasterCallback audioMaster) : iirGR = 0.0; iirHR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Hermepass/Hermepass.h b/plugins/WinVST/Hermepass/Hermepass.h index 1000bb9da..d3f2970cc 100755 --- a/plugins/WinVST/Hermepass/Hermepass.h +++ b/plugins/WinVST/Hermepass/Hermepass.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirAL; double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one diff --git a/plugins/WinVST/Hermepass/HermepassProc.cpp b/plugins/WinVST/Hermepass/HermepassProc.cpp index fddffe31d..178979fbf 100755 --- a/plugins/WinVST/Hermepass/HermepassProc.cpp +++ b/plugins/WinVST/Hermepass/HermepassProc.cpp @@ -17,8 +17,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -64,8 +64,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -74,44 +74,8 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -176,14 +140,14 @@ void Hermepass::processReplacing(float **inputs, float **outputs, VstInt32 sampl fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -205,8 +169,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double rangescale = 0.1 / overallscale; double cutoff = pow(A,3); @@ -252,8 +216,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; //each one will either be 0.0, the fractional slope value, or 1 - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double tempSampleL; double tempSampleR; double correction; @@ -262,44 +226,8 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; tempSampleL = inputSampleL; tempSampleR = inputSampleR; @@ -364,16 +292,14 @@ void Hermepass::processDoubleReplacing(double **inputs, double **outputs, VstInt fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/HighGlossDither/HighGlossDitherProc.cpp b/plugins/WinVST/HighGlossDither/HighGlossDitherProc.cpp index 2529939de..fee894a81 100755 --- a/plugins/WinVST/HighGlossDither/HighGlossDitherProc.cpp +++ b/plugins/WinVST/HighGlossDither/HighGlossDitherProc.cpp @@ -16,51 +16,15 @@ void HighGlossDither::processReplacing(float **inputs, float **outputs, VstInt32 int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -111,51 +75,15 @@ void HighGlossDither::processDoubleReplacing(double **inputs, double **outputs, int hotbinA; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/WinVST/HighImpact/HighImpact.cpp b/plugins/WinVST/HighImpact/HighImpact.cpp index 960d80c7b..446f34127 100755 --- a/plugins/WinVST/HighImpact/HighImpact.cpp +++ b/plugins/WinVST/HighImpact/HighImpact.cpp @@ -17,8 +17,8 @@ HighImpact::HighImpact(audioMasterCallback audioMaster) : C = 0.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/HighImpact/HighImpact.h b/plugins/WinVST/HighImpact/HighImpact.h index a57230b85..71123e03c 100755 --- a/plugins/WinVST/HighImpact/HighImpact.h +++ b/plugins/WinVST/HighImpact/HighImpact.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/HighImpact/HighImpactProc.cpp b/plugins/WinVST/HighImpact/HighImpactProc.cpp index f24804a5e..c6ac619a9 100755 --- a/plugins/WinVST/HighImpact/HighImpactProc.cpp +++ b/plugins/WinVST/HighImpact/HighImpactProc.cpp @@ -15,10 +15,10 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -35,44 +35,8 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -158,14 +122,14 @@ void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 samp //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -188,10 +152,10 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double density = A*5.0; double out = density / 5.0; @@ -208,44 +172,8 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -331,16 +259,14 @@ void HighImpact::processDoubleReplacing(double **inputs, double **outputs, VstIn //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Highpass/Highpass.cpp b/plugins/WinVST/Highpass/Highpass.cpp index 86ebe241c..a87a3f0ce 100755 --- a/plugins/WinVST/Highpass/Highpass.cpp +++ b/plugins/WinVST/Highpass/Highpass.cpp @@ -19,8 +19,8 @@ Highpass::Highpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/Highpass/Highpass.h b/plugins/WinVST/Highpass/Highpass.h index 673f951fe..468baa479 100755 --- a/plugins/WinVST/Highpass/Highpass.h +++ b/plugins/WinVST/Highpass/Highpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Highpass/HighpassProc.cpp b/plugins/WinVST/Highpass/HighpassProc.cpp index 371ed57a4..92c60aa8b 100755 --- a/plugins/WinVST/Highpass/HighpassProc.cpp +++ b/plugins/WinVST/Highpass/HighpassProc.cpp @@ -40,44 +40,8 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -118,14 +82,14 @@ void Highpass::processReplacing(float **inputs, float **outputs, VstInt32 sample if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -170,44 +134,8 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -248,16 +176,14 @@ void Highpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/WinVST/Highpass2/Highpass2Proc.cpp b/plugins/WinVST/Highpass2/Highpass2Proc.cpp index adc3ba169..e5f6a8066 100755 --- a/plugins/WinVST/Highpass2/Highpass2Proc.cpp +++ b/plugins/WinVST/Highpass2/Highpass2Proc.cpp @@ -38,8 +38,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Highpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -208,8 +208,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -247,8 +247,8 @@ void Highpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/WinVST/Holt/Holt.h b/plugins/WinVST/Holt/Holt.h index bf14fca9d..d9d61e929 100755 --- a/plugins/WinVST/Holt/Holt.h +++ b/plugins/WinVST/Holt/Holt.h @@ -59,23 +59,23 @@ private: uint32_t fpd; //default stuff - long double previousSampleAL; - long double previousTrendAL; - long double previousSampleBL; - long double previousTrendBL; - long double previousSampleCL; - long double previousTrendCL; - long double previousSampleDL; - long double previousTrendDL; + double previousSampleAL; + double previousTrendAL; + double previousSampleBL; + double previousTrendBL; + double previousSampleCL; + double previousTrendCL; + double previousSampleDL; + double previousTrendDL; - long double previousSampleAR; - long double previousTrendAR; - long double previousSampleBR; - long double previousTrendBR; - long double previousSampleCR; - long double previousTrendCR; - long double previousSampleDR; - long double previousTrendDR; + double previousSampleAR; + double previousTrendAR; + double previousSampleBR; + double previousTrendBR; + double previousSampleCR; + double previousTrendCR; + double previousSampleDR; + double previousTrendDR; float A; diff --git a/plugins/WinVST/Holt/HoltProc.cpp b/plugins/WinVST/Holt/HoltProc.cpp index efe13495a..ca90811ad 100755 --- a/plugins/WinVST/Holt/HoltProc.cpp +++ b/plugins/WinVST/Holt/HoltProc.cpp @@ -20,8 +20,8 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -42,14 +42,14 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); @@ -157,8 +157,8 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa alpha += ((1.0-beta)*pow(A,3)); //correct for droop in frequency if (alpha > 1.0) alpha = 1.0; - long double trend; - long double forecast; //defining these here because we're copying the routine four times + double trend; + double forecast; //defining these here because we're copying the routine four times double aWet = 1.0; double bWet = 1.0; @@ -179,14 +179,14 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (aWet > 0.0) { trend = (beta * (inputSampleL - previousSampleAL) + ((0.999-beta) * previousTrendAL)); diff --git a/plugins/WinVST/Hombre/Hombre.cpp b/plugins/WinVST/Hombre/Hombre.cpp index 8b03ed124..ebf3e4b36 100755 --- a/plugins/WinVST/Hombre/Hombre.cpp +++ b/plugins/WinVST/Hombre/Hombre.cpp @@ -17,8 +17,8 @@ Hombre::Hombre(audioMasterCallback audioMaster) : for(int count = 0; count < 4000; count++) {pL[count] = 0.0; pR[count] = 0.0;} gcount = 0; slide = 0.421; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Hombre/Hombre.h b/plugins/WinVST/Hombre/Hombre.h index e23f6f323..af14c14ed 100755 --- a/plugins/WinVST/Hombre/Hombre.h +++ b/plugins/WinVST/Hombre/Hombre.h @@ -58,8 +58,8 @@ private: double slide; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Hombre/HombreProc.cpp b/plugins/WinVST/Hombre/HombreProc.cpp index 16bf51377..5a24dde58 100755 --- a/plugins/WinVST/Hombre/HombreProc.cpp +++ b/plugins/WinVST/Hombre/HombreProc.cpp @@ -29,8 +29,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -38,44 +38,8 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -131,14 +95,14 @@ void Hombre::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -172,8 +136,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double totalR; int count; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -181,44 +145,8 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -274,16 +202,14 @@ void Hombre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Hull/Hull.h b/plugins/WinVST/Hull/Hull.h index bee68e58b..1d9df9e4d 100644 --- a/plugins/WinVST/Hull/Hull.h +++ b/plugins/WinVST/Hull/Hull.h @@ -53,11 +53,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bL[4005]; - long double bR[4005]; + double bL[4005]; + double bR[4005]; int bPointer; - long double cL[105]; - long double cR[105]; + double cL[105]; + double cR[105]; int cPointer; uint32_t fpdL; diff --git a/plugins/WinVST/Hull/HullProc.cpp b/plugins/WinVST/Hull/HullProc.cpp index ed19ddc25..4cdbe2d03 100644 --- a/plugins/WinVST/Hull/HullProc.cpp +++ b/plugins/WinVST/Hull/HullProc.cpp @@ -21,31 +21,31 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -69,8 +69,8 @@ void Hull::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -120,31 +120,31 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //it just cuts out the maximum (2000) depth of averaging you can get double hullSetting = pow(A,3)*overallscale; int limitA = (hullSetting*2000.0)+1.0; - long double divisorA = 1.0/limitA; + double divisorA = 1.0/limitA; int limitB = (hullSetting*1000.0)+1.0; - long double divisorB = 1.0/limitB; + double divisorB = 1.0/limitB; int limitC = sqrt(hullSetting*2000.0)+1.0; - long double divisorC = 1.0/limitC; + double divisorC = 1.0/limitC; double wet = -((B*2.0)-1.0); //functions as dark/bright while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bPointer--; if (bPointer < 0) bPointer += 2000; bL[bPointer] = bL[bPointer+2000] = inputSampleL; bR[bPointer] = bR[bPointer+2000] = inputSampleR; int x = bPointer; - long double longAverageL = 0.0; - long double longAverageR = 0.0; - long double shortAverageL = 0.0; - long double shortAverageR = 0.0; + double longAverageL = 0.0; + double longAverageR = 0.0; + double shortAverageL = 0.0; + double shortAverageR = 0.0; while (x < bPointer+limitB) { shortAverageL += bL[x]; shortAverageR += bR[x]; @@ -168,8 +168,8 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa cR[cPointer] = cR[cPointer+50] = shortAverageR+(shortAverageR-longAverageR); x = cPointer; - long double shortestAverageL = 0.0; - long double shortestAverageR = 0.0; + double shortestAverageL = 0.0; + double shortestAverageR = 0.0; while (x < cPointer+limitC) { shortestAverageL += cL[x]; shortestAverageR += cR[x]; @@ -187,12 +187,12 @@ void Hull::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/HypersonX/HypersonXProc.cpp b/plugins/WinVST/HypersonX/HypersonXProc.cpp index 43ed3ec33..bd88aeefa 100644 --- a/plugins/WinVST/HypersonX/HypersonXProc.cpp +++ b/plugins/WinVST/HypersonX/HypersonXProc.cpp @@ -149,7 +149,7 @@ void HypersonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Hypersonic/HypersonicProc.cpp b/plugins/WinVST/Hypersonic/HypersonicProc.cpp index 7e914e796..d3361986c 100644 --- a/plugins/WinVST/Hypersonic/HypersonicProc.cpp +++ b/plugins/WinVST/Hypersonic/HypersonicProc.cpp @@ -319,7 +319,7 @@ void Hypersonic::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = outSample; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - //only relevant if buss is long double + //only relevant if buss is double //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Infinity/Infinity.h b/plugins/WinVST/Infinity/Infinity.h index e17c3a139..6a3a0b593 100755 --- a/plugins/WinVST/Infinity/Infinity.h +++ b/plugins/WinVST/Infinity/Infinity.h @@ -55,9 +55,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/WinVST/Infinity/InfinityProc.cpp b/plugins/WinVST/Infinity/InfinityProc.cpp index 67dce7467..70c57ee1b 100755 --- a/plugins/WinVST/Infinity/InfinityProc.cpp +++ b/plugins/WinVST/Infinity/InfinityProc.cpp @@ -65,19 +65,19 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -88,15 +88,15 @@ void Infinity::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -350,19 +350,19 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -373,15 +373,15 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL *= 0.5; inputSampleR *= 0.5; - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -559,12 +559,12 @@ void Infinity::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Infinity2/Infinity2.h b/plugins/WinVST/Infinity2/Infinity2.h index 2304eb777..60c0f9004 100644 --- a/plugins/WinVST/Infinity2/Infinity2.h +++ b/plugins/WinVST/Infinity2/Infinity2.h @@ -57,9 +57,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/WinVST/Infinity2/Infinity2Proc.cpp b/plugins/WinVST/Infinity2/Infinity2Proc.cpp index 81b745fab..cf8e5f6f8 100644 --- a/plugins/WinVST/Infinity2/Infinity2Proc.cpp +++ b/plugins/WinVST/Infinity2/Infinity2Proc.cpp @@ -65,32 +65,32 @@ void Infinity2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -366,32 +366,32 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -591,12 +591,12 @@ void Infinity2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Infrasonic/Infrasonic.h b/plugins/WinVST/Infrasonic/Infrasonic.h index 940f13fc4..ef33b30ed 100755 --- a/plugins/WinVST/Infrasonic/Infrasonic.h +++ b/plugins/WinVST/Infrasonic/Infrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Infrasonic/InfrasonicProc.cpp b/plugins/WinVST/Infrasonic/InfrasonicProc.cpp index 0ebfbc7d0..135fd5e33 100755 --- a/plugins/WinVST/Infrasonic/InfrasonicProc.cpp +++ b/plugins/WinVST/Infrasonic/InfrasonicProc.cpp @@ -63,12 +63,12 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Infrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Infrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/WinVST/Interstage/Interstage.h b/plugins/WinVST/Interstage/Interstage.h index 146b84c0a..bb23c5c57 100755 --- a/plugins/WinVST/Interstage/Interstage.h +++ b/plugins/WinVST/Interstage/Interstage.h @@ -57,14 +57,14 @@ private: double iirSampleDL; double iirSampleEL; double iirSampleFL; - long double lastSampleL; + double lastSampleL; double iirSampleAR; double iirSampleBR; double iirSampleCR; double iirSampleDR; double iirSampleER; double iirSampleFR; - long double lastSampleR; + double lastSampleR; uint32_t fpd; bool flip; }; diff --git a/plugins/WinVST/Interstage/InterstageProc.cpp b/plugins/WinVST/Interstage/InterstageProc.cpp index df5bb385c..181983f57 100755 --- a/plugins/WinVST/Interstage/InterstageProc.cpp +++ b/plugins/WinVST/Interstage/InterstageProc.cpp @@ -24,12 +24,12 @@ void Interstage::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average @@ -111,12 +111,12 @@ void Interstage::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = (inputSampleL+lastSampleL)*0.5; inputSampleR = (inputSampleR+lastSampleR)*0.5; //start the lowpassing with an average diff --git a/plugins/WinVST/IronOxide5/IronOxide5.cpp b/plugins/WinVST/IronOxide5/IronOxide5.cpp index 914f53b5c..9d720380d 100755 --- a/plugins/WinVST/IronOxide5/IronOxide5.cpp +++ b/plugins/WinVST/IronOxide5/IronOxide5.cpp @@ -45,8 +45,8 @@ IronOxide5::IronOxide5(audioMasterCallback audioMaster) : rateof = 0.5; nextmax = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/IronOxide5/IronOxide5.h b/plugins/WinVST/IronOxide5/IronOxide5.h index 82d4c9ae3..8e1173796 100755 --- a/plugins/WinVST/IronOxide5/IronOxide5.h +++ b/plugins/WinVST/IronOxide5/IronOxide5.h @@ -101,8 +101,8 @@ private: double nextmax; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp index e42d69f49..a79d2d315 100755 --- a/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp +++ b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp @@ -62,8 +62,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -71,44 +71,8 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -419,14 +383,14 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp } //end invdrywet block with outputgain - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -493,8 +457,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0; if (invdrywet > 0.0) dry -= invdrywet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -502,44 +466,8 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -850,16 +778,14 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn } //end invdrywet block with outputgain - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp b/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp index 8ce7103db..a52227101 100755 --- a/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp @@ -23,8 +23,8 @@ IronOxideClassic::IronOxideClassic(audioMasterCallback audioMaster) : fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; iirSampleAR = iirSampleBR = 0.0; fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassic.h b/plugins/WinVST/IronOxideClassic/IronOxideClassic.h index bafb457f3..118b6fd9d 100755 --- a/plugins/WinVST/IronOxideClassic/IronOxideClassic.h +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassic.h @@ -72,8 +72,8 @@ private: int gcount; bool fpFlip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp b/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp index 97bbacae1..8f7d52f98 100755 --- a/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp @@ -41,51 +41,15 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -342,14 +306,14 @@ void IronOxideClassic::processReplacing(float **inputs, float **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,51 +359,15 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, slowTaper = 1.0 + (slowTaper / overallscale); } - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -696,16 +624,14 @@ void IronOxideClassic::processDoubleReplacing(double **inputs, double **outputs, } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h index 6d0a6b3ae..816678bb0 100644 --- a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h +++ b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h @@ -72,8 +72,8 @@ private: double slowIIRBR; double lastRefR[7]; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; int cycle; int gcount; diff --git a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp index 1b4d68ec4..cbd05ac5f 100644 --- a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp +++ b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp @@ -67,11 +67,11 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -107,14 +107,14 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -129,7 +129,7 @@ void IronOxideClassic2::processReplacing(float **inputs, float **outputs, VstInt int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -479,11 +479,11 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double tempSample; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double tempSample; if (flip) { @@ -519,14 +519,14 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs inputSampleR *= inputgain; } - long double bridgerectifierL = fabs(inputSampleL); + double bridgerectifierL = fabs(inputSampleL); if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; bridgerectifierL = sin(bridgerectifierL); if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; else inputSampleL = -bridgerectifierL; //preliminary gain stage using antialiasing - long double bridgerectifierR = fabs(inputSampleR); + double bridgerectifierR = fabs(inputSampleR); if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; bridgerectifierR = sin(bridgerectifierR); if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; @@ -541,7 +541,7 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs int count = gcount; //increment the counter - long double temp; + double temp; dL[count+131] = dL[count] = inputSampleL; dR[count+131] = dR[count] = inputSampleR; @@ -813,12 +813,12 @@ void IronOxideClassic2::processDoubleReplacing(double **inputs, double **outputs flip = !flip; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Isolator/Isolator.h b/plugins/WinVST/Isolator/Isolator.h index 36bb24290..c353897e0 100755 --- a/plugins/WinVST/Isolator/Isolator.h +++ b/plugins/WinVST/Isolator/Isolator.h @@ -54,9 +54,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Isolator/IsolatorProc.cpp b/plugins/WinVST/Isolator/IsolatorProc.cpp index ec083b419..ca777d947 100755 --- a/plugins/WinVST/Isolator/IsolatorProc.cpp +++ b/plugins/WinVST/Isolator/IsolatorProc.cpp @@ -62,18 +62,18 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -82,7 +82,7 @@ void Isolator::processReplacing(float **inputs, float **outputs, VstInt32 sample outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -182,18 +182,18 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double drySampleL = *in1; + double drySampleR = *in2; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -202,7 +202,7 @@ void Isolator::processDoubleReplacing(double **inputs, double **outputs, VstInt3 outSampleL = biquadC[2]*inputSampleL+biquadC[3]*biquadC[7]+biquadC[4]*biquadC[8]-biquadC[5]*biquadC[9]-biquadC[6]*biquadC[10]; biquadC[8] = biquadC[7]; biquadC[7] = inputSampleL; inputSampleL = outSampleL; biquadC[10] = biquadC[9]; biquadC[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/WinVST/Logical4/Logical4.cpp b/plugins/WinVST/Logical4/Logical4.cpp index 15d185bea..72da4ad93 100755 --- a/plugins/WinVST/Logical4/Logical4.cpp +++ b/plugins/WinVST/Logical4/Logical4.cpp @@ -78,8 +78,8 @@ Logical4::Logical4(audioMasterCallback audioMaster) : gcount = 0; //end Power Sags fpFlip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Logical4/Logical4Proc.cpp b/plugins/WinVST/Logical4/Logical4Proc.cpp index 5d079f36b..df5c110f4 100755 --- a/plugins/WinVST/Logical4/Logical4Proc.cpp +++ b/plugins/WinVST/Logical4/Logical4Proc.cpp @@ -17,8 +17,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -119,44 +119,8 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -871,14 +835,14 @@ void Logical4::processReplacing(float **inputs, float **outputs, VstInt32 sample fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -900,8 +864,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; float drySampleL; float drySampleR; @@ -1001,44 +965,8 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1752,16 +1680,14 @@ void Logical4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Loud/LoudProc.cpp b/plugins/WinVST/Loud/LoudProc.cpp index 85d98996d..906f51dbd 100755 --- a/plugins/WinVST/Loud/LoudProc.cpp +++ b/plugins/WinVST/Loud/LoudProc.cpp @@ -21,8 +21,8 @@ void Loud::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; @@ -138,8 +138,8 @@ void Loud::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double output = B; double wet = C; double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; double clamp; diff --git a/plugins/WinVST/Lowpass/Lowpass.cpp b/plugins/WinVST/Lowpass/Lowpass.cpp index 18064fcae..9b6a6f4eb 100755 --- a/plugins/WinVST/Lowpass/Lowpass.cpp +++ b/plugins/WinVST/Lowpass/Lowpass.cpp @@ -19,8 +19,8 @@ Lowpass::Lowpass(audioMasterCallback audioMaster) : iirSampleBL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/Lowpass/Lowpass.h b/plugins/WinVST/Lowpass/Lowpass.h index 40ac45681..f9d4ec8c7 100755 --- a/plugins/WinVST/Lowpass/Lowpass.h +++ b/plugins/WinVST/Lowpass/Lowpass.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Lowpass/LowpassProc.cpp b/plugins/WinVST/Lowpass/LowpassProc.cpp index bcc369049..ea450b239 100755 --- a/plugins/WinVST/Lowpass/LowpassProc.cpp +++ b/plugins/WinVST/Lowpass/LowpassProc.cpp @@ -41,44 +41,8 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -120,14 +84,14 @@ void Lowpass::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; @@ -173,44 +137,8 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = inputSampleL; outputSampleR = inputSampleR; @@ -252,16 +180,14 @@ void Lowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = outputSampleL; *out2 = outputSampleR; diff --git a/plugins/WinVST/Lowpass2/Lowpass2Proc.cpp b/plugins/WinVST/Lowpass2/Lowpass2Proc.cpp index e46b16e75..1dd3af06f 100755 --- a/plugins/WinVST/Lowpass2/Lowpass2Proc.cpp +++ b/plugins/WinVST/Lowpass2/Lowpass2Proc.cpp @@ -38,8 +38,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void Lowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sample } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); @@ -209,8 +209,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -248,8 +248,8 @@ void Lowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (tight > 0) offsetL = (1 - tight) + (fabs(inputSampleL)*tight); else offsetL = (1 + tight) + ((1-fabs(inputSampleL))*tight); diff --git a/plugins/WinVST/Luxor/LuxorProc.cpp b/plugins/WinVST/Luxor/LuxorProc.cpp index 086b1741e..c8d0add39 100755 --- a/plugins/WinVST/Luxor/LuxorProc.cpp +++ b/plugins/WinVST/Luxor/LuxorProc.cpp @@ -37,8 +37,8 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -218,8 +218,8 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/MV/MVProc.cpp b/plugins/WinVST/MV/MVProc.cpp index 00082b487..11da2fce9 100755 --- a/plugins/WinVST/MV/MVProc.cpp +++ b/plugins/WinVST/MV/MVProc.cpp @@ -31,8 +31,8 @@ void MV::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -827,8 +827,8 @@ void MV::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; diff --git a/plugins/WinVST/MackEQ/MackEQ.h b/plugins/WinVST/MackEQ/MackEQ.h index 9447e67f3..d413503b3 100644 --- a/plugins/WinVST/MackEQ/MackEQ.h +++ b/plugins/WinVST/MackEQ/MackEQ.h @@ -56,22 +56,22 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleCL; - long double iirSampleDL; - long double iirSampleEL; - long double iirSampleFL; - long double iirSampleAR; - long double iirSampleBR; - long double iirSampleCR; - long double iirSampleDR; - long double iirSampleER; - long double iirSampleFR; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/MackEQ/MackEQProc.cpp b/plugins/WinVST/MackEQ/MackEQProc.cpp index 6713aed49..00466fda1 100644 --- a/plugins/WinVST/MackEQ/MackEQProc.cpp +++ b/plugins/WinVST/MackEQ/MackEQProc.cpp @@ -73,12 +73,12 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -90,10 +90,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -123,10 +123,10 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -149,11 +149,11 @@ void MackEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -294,12 +294,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -311,10 +311,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} //begin Mackity input stage - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -344,10 +344,10 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleCR)<1.18e-37) iirSampleCR = 0.0; iirSampleCR = (iirSampleCR * (1.0 - iirBassMid)) + (inputSampleR * iirBassMid); - long double bassSampleL = iirSampleCL; - long double midSampleL = inputSampleL - bassSampleL; - long double bassSampleR = iirSampleCR; - long double midSampleR = inputSampleR - bassSampleR; + double bassSampleL = iirSampleCL; + double midSampleL = inputSampleL - bassSampleL; + double bassSampleR = iirSampleCR; + double midSampleR = inputSampleR - bassSampleR; if (gainBass != 1.0) {bassSampleL *= gainBass; bassSampleR *= gainBass;} @@ -370,11 +370,11 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (fabs(iirSampleEL)<1.18e-37) iirSampleEL = 0.0; iirSampleEL = (iirSampleEL * (1.0 - iirMidHigh)) + (midSampleL * iirMidHigh); - long double highSampleL = midSampleL - iirSampleEL; + double highSampleL = midSampleL - iirSampleEL; midSampleL = iirSampleEL; if (fabs(iirSampleER)<1.18e-37) iirSampleER = 0.0; iirSampleER = (iirSampleER * (1.0 - iirMidHigh)) + (midSampleR * iirMidHigh); - long double highSampleR = midSampleR - iirSampleER; + double highSampleR = midSampleR - iirSampleER; midSampleR = iirSampleER; //here is where we make the high sample out of the mid, and take highs //away from the mid. @@ -431,12 +431,12 @@ void MackEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Mackity/Mackity.h b/plugins/WinVST/Mackity/Mackity.h index f6ecb608a..338df8de9 100644 --- a/plugins/WinVST/Mackity/Mackity.h +++ b/plugins/WinVST/Mackity/Mackity.h @@ -54,12 +54,12 @@ private: std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; - long double biquadA[15]; - long double biquadB[15]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + double biquadA[15]; + double biquadB[15]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Mackity/MackityProc.cpp b/plugins/WinVST/Mackity/MackityProc.cpp index 97a9b7fb6..ff7c1631a 100644 --- a/plugins/WinVST/Mackity/MackityProc.cpp +++ b/plugins/WinVST/Mackity/MackityProc.cpp @@ -47,10 +47,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -61,10 +61,10 @@ void Mackity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -148,10 +148,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(iirSampleAL)<1.18e-37) iirSampleAL = 0.0; iirSampleAL = (iirSampleAL * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); @@ -162,10 +162,10 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right if (inputSampleL > 1.0) inputSampleL = 1.0; @@ -191,12 +191,12 @@ void Mackity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (outPad != 1.0) {inputSampleL *= outPad; inputSampleR *= outPad;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/MatrixVerb/MatrixVerb.h b/plugins/WinVST/MatrixVerb/MatrixVerb.h index 3b2c0a62b..3f3b8298c 100755 --- a/plugins/WinVST/MatrixVerb/MatrixVerb.h +++ b/plugins/WinVST/MatrixVerb/MatrixVerb.h @@ -58,9 +58,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/WinVST/MatrixVerb/MatrixVerbProc.cpp b/plugins/WinVST/MatrixVerb/MatrixVerbProc.cpp index 15ee2871e..4099a1853 100755 --- a/plugins/WinVST/MatrixVerb/MatrixVerbProc.cpp +++ b/plugins/WinVST/MatrixVerb/MatrixVerbProc.cpp @@ -77,12 +77,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -91,12 +91,12 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -108,15 +108,15 @@ void MatrixVerb::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -470,12 +470,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -484,12 +484,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -501,15 +501,15 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -775,12 +775,12 @@ void MatrixVerb::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Melt/Melt.cpp b/plugins/WinVST/Melt/Melt.cpp index 35ede1e0d..b2f8301bc 100755 --- a/plugins/WinVST/Melt/Melt.cpp +++ b/plugins/WinVST/Melt/Melt.cpp @@ -26,8 +26,8 @@ Melt::Melt(audioMasterCallback audioMaster) : slowCount = 0; gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Melt/Melt.h b/plugins/WinVST/Melt/Melt.h index af11f0fc5..07cf0075c 100755 --- a/plugins/WinVST/Melt/Melt.h +++ b/plugins/WinVST/Melt/Melt.h @@ -70,8 +70,8 @@ private: int slowCount; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Melt/MeltProc.cpp b/plugins/WinVST/Melt/MeltProc.cpp index 8a55732df..c990386b6 100755 --- a/plugins/WinVST/Melt/MeltProc.cpp +++ b/plugins/WinVST/Melt/MeltProc.cpp @@ -22,10 +22,10 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -63,44 +63,8 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -268,14 +232,14 @@ void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -302,10 +266,10 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double dry = 1.0-wet; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); @@ -343,44 +307,8 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -548,16 +476,14 @@ void Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/MidSide/MidSide.cpp b/plugins/WinVST/MidSide/MidSide.cpp index 8f61cffda..4bb31183d 100755 --- a/plugins/WinVST/MidSide/MidSide.cpp +++ b/plugins/WinVST/MidSide/MidSide.cpp @@ -13,8 +13,8 @@ MidSide::MidSide(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/MidSide/MidSide.h b/plugins/WinVST/MidSide/MidSide.h index 4d139c874..086fbea98 100755 --- a/plugins/WinVST/MidSide/MidSide.h +++ b/plugins/WinVST/MidSide/MidSide.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/MidSide/MidSideProc.cpp b/plugins/WinVST/MidSide/MidSideProc.cpp index cca7a5cda..46fb1397e 100755 --- a/plugins/WinVST/MidSide/MidSideProc.cpp +++ b/plugins/WinVST/MidSide/MidSideProc.cpp @@ -15,11 +15,11 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -28,44 +28,8 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -75,7 +39,7 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); mid += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)side, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -100,11 +64,11 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; - long double mid; - long double side; + double mid; + double side; double sidegain = A * 2.0; double midgain = 2.0 - sidegain; @@ -113,44 +77,8 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -160,7 +88,7 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //stereo 64 bit dither, made small and tidy. int expon; frexp((double)mid, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone mid += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)side, &expon); diff --git a/plugins/WinVST/MoNoam/MoNoamProc.cpp b/plugins/WinVST/MoNoam/MoNoamProc.cpp index 105d34b15..64cc63a99 100755 --- a/plugins/WinVST/MoNoam/MoNoamProc.cpp +++ b/plugins/WinVST/MoNoam/MoNoamProc.cpp @@ -18,13 +18,13 @@ void MoNoam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; @@ -69,13 +69,13 @@ void MoNoam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing == kMONO || processing == kMONOR || processing == kMONOL) side = 0.0; if (processing == kSIDE || processing == kSIDEM || processing == kSIDER || processing == kSIDEL) mid = 0.0; diff --git a/plugins/WinVST/Mojo/MojoProc.cpp b/plugins/WinVST/Mojo/MojoProc.cpp index 60f986d64..6687feea8 100755 --- a/plugins/WinVST/Mojo/MojoProc.cpp +++ b/plugins/WinVST/Mojo/MojoProc.cpp @@ -18,8 +18,8 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -28,7 +28,7 @@ void Mojo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); @@ -65,8 +65,8 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -75,7 +75,7 @@ void Mojo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= gain; } - long double mojo = pow(fabs(inputSampleL),0.25); + double mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo) * 0.987654321; //mojo is the one that flattens WAAAAY out very softly before wavefolding mojo = pow(fabs(inputSampleR),0.25); diff --git a/plugins/WinVST/Monitoring/Monitoring.h b/plugins/WinVST/Monitoring/Monitoring.h index f92a46b42..8dd0210fc 100755 --- a/plugins/WinVST/Monitoring/Monitoring.h +++ b/plugins/WinVST/Monitoring/Monitoring.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13], bynR[13]; - long double noiseShapingL, noiseShapingR; + double bynL[13], bynR[13]; + double noiseShapingL, noiseShapingR; //NJAD double aL[1503], bL[1503], cL[1503], dL[1503]; double aR[1503], bR[1503], cR[1503], dR[1503]; @@ -73,8 +73,8 @@ private: double iirSampleTR, iirSampleUR, iirSampleVR; double iirSampleWR, iirSampleXR, iirSampleYR, iirSampleZR; // o/` //SubsOnly - long double biquadL[11]; - long double biquadR[11]; + double biquadL[11]; + double biquadR[11]; //Bandpasses uint32_t fpd; diff --git a/plugins/WinVST/Monitoring/MonitoringProc.cpp b/plugins/WinVST/Monitoring/MonitoringProc.cpp index ddb1f6f98..397d31b12 100755 --- a/plugins/WinVST/Monitoring/MonitoringProc.cpp +++ b/plugins/WinVST/Monitoring/MonitoringProc.cpp @@ -48,8 +48,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -116,7 +116,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -289,8 +289,8 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -305,17 +305,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -337,9 +337,9 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -396,7 +396,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -415,17 +415,17 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -439,7 +439,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -448,7 +448,7 @@ void Monitoring::processReplacing(float **inputs, float **outputs, VstInt32 samp totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -565,8 +565,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -633,7 +633,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn case 3: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -806,8 +806,8 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn break; case 5: case 6: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < 6) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -822,17 +822,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == 9) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == 10) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == 11) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == 11) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; + double tempSampleL; tempSampleL = (inputSampleL * biquadL[2]) + biquadL[7]; biquadL[7] = (-tempSampleL * biquadL[5]) + biquadL[8]; biquadL[8] = (inputSampleL * biquadL[4]) - (tempSampleL * biquadL[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; + double tempSampleR; tempSampleR = (inputSampleR * biquadR[2]) + biquadR[7]; biquadR[7] = (-tempSampleR * biquadR[5]) + biquadR[8]; biquadR[8] = (inputSampleR * biquadR[4]) - (tempSampleR * biquadR[6]); inputSampleR = tempSampleR; // we are using the mono configuration @@ -854,9 +854,9 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -913,7 +913,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn //ConsoleBuss processing break; case 16: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -932,17 +932,17 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -956,7 +956,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -965,7 +965,7 @@ void Monitoring::processDoubleReplacing(double **inputs, double **outputs, VstIn totalB += (58-bynL[7]); totalB += (51-bynL[8]); totalB += (46-bynL[9]); bynL[hotbinB] -= 1; } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line diff --git a/plugins/WinVST/Monitoring2/Monitoring2.h b/plugins/WinVST/Monitoring2/Monitoring2.h index 34e9aac76..a1d6c5e4b 100644 --- a/plugins/WinVST/Monitoring2/Monitoring2.h +++ b/plugins/WinVST/Monitoring2/Monitoring2.h @@ -87,7 +87,7 @@ private: fix_sR2, fix_total }; - long double biquad[fix_total]; + double biquad[fix_total]; //Bandpasses float darkSampleL[100]; diff --git a/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp b/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp index d9af88b6a..82325d164 100644 --- a/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp +++ b/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp @@ -42,8 +42,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -113,7 +113,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -286,8 +286,8 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -302,17 +302,17 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -334,9 +334,9 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -393,7 +393,7 @@ void Monitoring2::processReplacing(float **inputs, float **outputs, VstInt32 sam //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; @@ -525,8 +525,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -596,7 +596,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI case kSLEW: double trim; trim = 2.302585092994045684017991; //natural logarithm of 10 - long double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; + double slewSample; slewSample = (inputSampleL - lastSampleL)*trim; lastSampleL = inputSampleL; if (slewSample > 1.0) slewSample = 1.0; if (slewSample < -1.0) slewSample = -1.0; inputSampleL = slewSample; @@ -769,8 +769,8 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI break; case kMONO: case kSIDE: - long double mid; mid = inputSampleL + inputSampleR; - long double side; side = inputSampleL - inputSampleR; + double mid; mid = inputSampleL + inputSampleR; + double side; side = inputSampleL - inputSampleR; if (processing < kSIDE) side = 0.0; else mid = 0.0; //mono monitoring, or side-only monitoring inputSampleL = (mid+side)/2.0; @@ -785,17 +785,17 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //7 Vinyl, 8 9 10 Aurat, 11 Phone if (processing == kMONORAT) {inputSampleR = (inputSampleL + inputSampleR)*0.5;inputSampleL = 0.0;} if (processing == kMONOLAT) {inputSampleL = (inputSampleL + inputSampleR)*0.5;inputSampleR = 0.0;} - if (processing == kPHONE) {long double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} + if (processing == kPHONE) {double M; M = (inputSampleL + inputSampleR)*0.5; inputSampleL = M;inputSampleR = M;} inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; + double tempSampleL; tempSampleL = (inputSampleL * biquad[fix_a0]) + biquad[fix_sL1]; biquad[fix_sL1] = (-tempSampleL * biquad[fix_b1]) + biquad[fix_sL2]; biquad[fix_sL2] = (inputSampleL * biquad[fix_a2]) - (tempSampleL * biquad[fix_b2]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; + double tempSampleR; tempSampleR = (inputSampleR * biquad[fix_a0]) + biquad[fix_sR1]; biquad[fix_sR1] = (-tempSampleR * biquad[fix_b1]) + biquad[fix_sR2]; biquad[fix_sR2] = (inputSampleR * biquad[fix_a2]) - (tempSampleR * biquad[fix_b2]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -817,9 +817,9 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //we do a volume compensation immediately to gain stage stuff cleanly inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console - long double bass; bass = (processing * processing * 0.00001) / overallscale; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; //everything runs 'inside' Console + double bass; bass = (processing * processing * 0.00001) / overallscale; //we are using the iir filters from out of SubsOnly mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -876,7 +876,7 @@ void Monitoring2::processDoubleReplacing(double **inputs, double **outputs, VstI //ConsoleBuss processing break; case kTRICK: - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; inputSampleL = -inputSample; inputSampleR = inputSample; break; diff --git a/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp b/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp index c2e097a11..0336c96dc 100644 --- a/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp +++ b/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp @@ -51,10 +51,10 @@ void MultiBandDistortion::processReplacing(float **inputs, float **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -296,10 +296,10 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; ataDrySampleL = inputSampleL; ataHalfDrySampleL = ataHalfwaySampleL = (inputSampleL + ataLast1SampleL + ((-ataLast2SampleL + ataLast3SampleL) * ataUpsampleHighTweakL)) / 2.0; @@ -479,12 +479,12 @@ void MultiBandDistortion::processDoubleReplacing(double **inputs, double **outpu inputSampleR *= outputGlobal; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/NC-17/NCSeventeen.cpp b/plugins/WinVST/NC-17/NCSeventeen.cpp index 409f98398..a0a9a061d 100755 --- a/plugins/WinVST/NC-17/NCSeventeen.cpp +++ b/plugins/WinVST/NC-17/NCSeventeen.cpp @@ -31,8 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : flip = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/NC-17/NCSeventeen.h b/plugins/WinVST/NC-17/NCSeventeen.h index b3ecd9486..100f02bdb 100755 --- a/plugins/WinVST/NC-17/NCSeventeen.h +++ b/plugins/WinVST/NC-17/NCSeventeen.h @@ -70,8 +70,8 @@ private: bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/NC-17/NCSeventeenProc.cpp b/plugins/WinVST/NC-17/NCSeventeenProc.cpp index e124cb5ff..aebc1ba49 100755 --- a/plugins/WinVST/NC-17/NCSeventeenProc.cpp +++ b/plugins/WinVST/NC-17/NCSeventeenProc.cpp @@ -39,13 +39,13 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -59,44 +59,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -344,14 +308,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -395,13 +359,13 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -414,44 +378,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -699,16 +627,14 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/NCSeventeen/NCSeventeen.h b/plugins/WinVST/NCSeventeen/NCSeventeen.h index 01179e93f..7ca781c3b 100755 --- a/plugins/WinVST/NCSeventeen/NCSeventeen.h +++ b/plugins/WinVST/NCSeventeen/NCSeventeen.h @@ -70,10 +70,10 @@ private: bool flip; - long double fpNShapeLA; - long double fpNShapeLB; - long double fpNShapeRA; - long double fpNShapeRB; + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; bool fpFlip; //default stuff diff --git a/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp index b2f2aa1eb..4711f6b90 100755 --- a/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp +++ b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp @@ -20,8 +20,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam overallscale /= 44100.0; overallscale *= getSampleRate(); float fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0004716; double bassScaleback = 0.0002364; @@ -42,13 +42,13 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -62,44 +62,8 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; @@ -390,8 +354,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI overallscale /= 44100.0; overallscale *= getSampleRate(); double fpTemp; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0004716; double bassScaleback = 0.0002364; @@ -412,13 +376,13 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double maxfeedTreb = 0.972; double maxfeed = 0.975; double bridgerectifier; - long double inputSampleL; + double inputSampleL; double lowSampleL = 0.0; double highSampleL; double distSampleL; double minusSampleL; double plusSampleL; - long double inputSampleR; + double inputSampleR; double lowSampleR = 0.0; double highSampleR; double distSampleR; @@ -431,44 +395,8 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gain; inputSampleR *= gain; diff --git a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp index e0b2d86d0..ffc731e21 100755 --- a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp +++ b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp @@ -14,8 +14,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -27,44 +27,8 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -248,8 +212,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -261,44 +225,8 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/WinVST/Neverland/NeverlandProc.cpp b/plugins/WinVST/Neverland/NeverlandProc.cpp index de15a19fa..58493f8a3 100755 --- a/plugins/WinVST/Neverland/NeverlandProc.cpp +++ b/plugins/WinVST/Neverland/NeverlandProc.cpp @@ -37,8 +37,8 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -214,8 +214,8 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; inputSampleL *= indrive; diff --git a/plugins/WinVST/Nikola/NikolaProc.cpp b/plugins/WinVST/Nikola/NikolaProc.cpp index 1b439c6e8..59738686d 100755 --- a/plugins/WinVST/Nikola/NikolaProc.cpp +++ b/plugins/WinVST/Nikola/NikolaProc.cpp @@ -20,12 +20,12 @@ void Nikola::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; @@ -1040,12 +1040,12 @@ void Nikola::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > outlevelL) outlevelL = bridgerectifier; else outlevelL = ((outlevelL * decay) + bridgerectifier) / (decay+1.0); diff --git a/plugins/WinVST/NodeDither/NodeDitherProc.cpp b/plugins/WinVST/NodeDither/NodeDitherProc.cpp index 3d6046485..50f3e85f9 100755 --- a/plugins/WinVST/NodeDither/NodeDitherProc.cpp +++ b/plugins/WinVST/NodeDither/NodeDitherProc.cpp @@ -25,8 +25,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -34,44 +34,8 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; @@ -135,8 +99,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn int phase = floor(B*1.999); //0 default is out of phase, 1 is in phase - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double currentDitherL; double currentDitherR; @@ -144,44 +108,8 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= 8388608.0; inputSampleR *= 8388608.0; diff --git a/plugins/WinVST/Noise/Noise.cpp b/plugins/WinVST/Noise/Noise.cpp index d955a290a..ebb384dbe 100755 --- a/plugins/WinVST/Noise/Noise.cpp +++ b/plugins/WinVST/Noise/Noise.cpp @@ -36,8 +36,8 @@ Noise::Noise(audioMasterCallback audioMaster) : flipR = false; filterflip = false; for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Noise/Noise.h b/plugins/WinVST/Noise/Noise.h index 67c32bcf5..d14ef6305 100755 --- a/plugins/WinVST/Noise/Noise.h +++ b/plugins/WinVST/Noise/Noise.h @@ -81,8 +81,8 @@ private: double f[11]; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Noise/NoiseProc.cpp b/plugins/WinVST/Noise/NoiseProc.cpp index 31cba201a..0f75966cc 100755 --- a/plugins/WinVST/Noise/NoiseProc.cpp +++ b/plugins/WinVST/Noise/NoiseProc.cpp @@ -22,8 +22,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -111,44 +111,8 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -296,14 +260,14 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -330,8 +294,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double invcutoffR; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double highpass = C*38.0; int lowcut = floor(highpass); int dcut; @@ -417,44 +381,8 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -602,16 +530,14 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this //and breaking it somehow. So, there ya go, strange obtuse code. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp b/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp index eb05bc33a..48eac47c8 100755 --- a/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp +++ b/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp @@ -195,8 +195,8 @@ NonlinearSpace::NonlinearSpace(audioMasterCallback audioMaster) : countdown = -1; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpace.h b/plugins/WinVST/NonlinearSpace/NonlinearSpace.h index dbaa0b3a4..b75c7a51d 100755 --- a/plugins/WinVST/NonlinearSpace/NonlinearSpace.h +++ b/plugins/WinVST/NonlinearSpace/NonlinearSpace.h @@ -208,8 +208,8 @@ private: double nonlin; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp b/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp index f9df9fcc2..c7efecbc4 100755 --- a/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp +++ b/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp @@ -17,10 +17,10 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -99,44 +99,8 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -743,14 +707,14 @@ void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; @@ -773,10 +737,10 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; double overallscale = 1.0; int samplerate = (int)( A * 6.999 )+1; switch (samplerate) @@ -855,44 +819,8 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -1499,16 +1427,14 @@ void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, V inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither flip = !flip; *out1 = inputSampleL; diff --git a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h index 39f785e9e..d27f0cc5c 100755 --- a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h +++ b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h @@ -53,8 +53,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; }; diff --git a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp index af4320013..f129dda8f 100755 --- a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp +++ b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp @@ -14,8 +14,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -29,44 +29,8 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -263,8 +227,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double benfordize; int hotbinA; @@ -278,44 +242,8 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h index 5ca0c0a85..184a9269e 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h @@ -55,8 +55,8 @@ private: double bynL[13]; double bynR[13]; - long double noiseShapingL; - long double noiseShapingR; + double noiseShapingL; + double noiseShapingR; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp index 1a8071115..7e38de75c 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp @@ -29,8 +29,8 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -43,18 +43,18 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -70,7 +70,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -81,7 +81,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSample; + double outputSample; if (totalA < totalB) {bynL[hotbinA] += 1; outputSample = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSample = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -183,8 +183,8 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -197,18 +197,18 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp //begin Not Just Another Dither bool cutbinsL; cutbinsL = false; bool cutbinsR; cutbinsR = false; - long double drySampleL; drySampleL = inputSampleL; - long double drySampleR; drySampleR = inputSampleR; + double drySampleL; drySampleL = inputSampleL; + double drySampleR; drySampleR = inputSampleR; inputSampleL -= noiseShapingL; inputSampleR -= noiseShapingR; //NJAD L - long double benfordize; benfordize = floor(inputSampleL); + double benfordize; benfordize = floor(inputSampleL); while (benfordize >= 1.0) benfordize /= 10; while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinA; hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA; totalA = 0; + double totalA; totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; if (bynL[hotbinA] > 982) cutbinsL = true; @@ -224,7 +224,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp while (benfordize < 1.0 && benfordize > 0.0000001) benfordize *= 10; int hotbinB; hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB; totalB = 0; + double totalB; totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; if (bynL[hotbinB] > 982) cutbinsL = true; @@ -235,7 +235,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleL; + double outputSampleL; if (totalA < totalB) {bynL[hotbinA] += 1; outputSampleL = floor(inputSampleL);} else {bynL[hotbinB] += 1; outputSampleL = floor(inputSampleL+1);} //assign the relevant one to the delay line @@ -282,7 +282,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp } else hotbinB = 10; //produce total number- smaller is closer to Benford real - long double outputSampleR; + double outputSampleR; if (totalA < totalB) {bynR[hotbinA] += 1; outputSampleR = floor(inputSampleR);} else {bynR[hotbinB] += 1; outputSampleR = floor(inputSampleR+1);} //assign the relevant one to the delay line diff --git a/plugins/WinVST/OneCornerClip/OneCornerClip.cpp b/plugins/WinVST/OneCornerClip/OneCornerClip.cpp index 59e28246f..ea15e1fe2 100755 --- a/plugins/WinVST/OneCornerClip/OneCornerClip.cpp +++ b/plugins/WinVST/OneCornerClip/OneCornerClip.cpp @@ -25,8 +25,8 @@ OneCornerClip::OneCornerClip(audioMasterCallback audioMaster) : limitPosR = 0.0; limitNegR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/OneCornerClip/OneCornerClip.h b/plugins/WinVST/OneCornerClip/OneCornerClip.h index 4f039fa00..a69f185b2 100755 --- a/plugins/WinVST/OneCornerClip/OneCornerClip.h +++ b/plugins/WinVST/OneCornerClip/OneCornerClip.h @@ -56,8 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleL; diff --git a/plugins/WinVST/OneCornerClip/OneCornerClipProc.cpp b/plugins/WinVST/OneCornerClip/OneCornerClipProc.cpp index c45c69b91..194cab890 100755 --- a/plugins/WinVST/OneCornerClip/OneCornerClipProc.cpp +++ b/plugins/WinVST/OneCornerClip/OneCornerClipProc.cpp @@ -41,51 +41,15 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -154,14 +118,14 @@ void OneCornerClip::processReplacing(float **inputs, float **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither if (clipEngage == false) { @@ -214,52 +178,16 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs double dry = 1.0 - wet; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -328,16 +256,14 @@ void OneCornerClip::processDoubleReplacing(double **inputs, double **outputs, Vs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither if (clipEngage == false) { diff --git a/plugins/WinVST/PDBuss/PDBuss.cpp b/plugins/WinVST/PDBuss/PDBuss.cpp index 8b31d8b58..60bdec0bd 100755 --- a/plugins/WinVST/PDBuss/PDBuss.cpp +++ b/plugins/WinVST/PDBuss/PDBuss.cpp @@ -21,8 +21,8 @@ PDBuss::PDBuss(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PDBuss/PDBuss.h b/plugins/WinVST/PDBuss/PDBuss.h index 3e6d9b8da..0b962dcfb 100755 --- a/plugins/WinVST/PDBuss/PDBuss.h +++ b/plugins/WinVST/PDBuss/PDBuss.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/WinVST/PDBuss/PDBussProc.cpp b/plugins/WinVST/PDBuss/PDBussProc.cpp index 6da8fa0c4..00b05af39 100755 --- a/plugins/WinVST/PDBuss/PDBussProc.cpp +++ b/plugins/WinVST/PDBuss/PDBussProc.cpp @@ -21,8 +21,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -119,14 +83,14 @@ void PDBuss::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -152,8 +116,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -166,44 +130,8 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -250,16 +178,14 @@ void PDBuss::processDoubleReplacing(double **inputs, double **outputs, VstInt32 previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PDChannel/PDChannel.cpp b/plugins/WinVST/PDChannel/PDChannel.cpp index aef639d5e..6cf15db30 100755 --- a/plugins/WinVST/PDChannel/PDChannel.cpp +++ b/plugins/WinVST/PDChannel/PDChannel.cpp @@ -21,8 +21,8 @@ PDChannel::PDChannel(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PDChannel/PDChannel.h b/plugins/WinVST/PDChannel/PDChannel.h index ea233e26b..cd7c14fb7 100755 --- a/plugins/WinVST/PDChannel/PDChannel.h +++ b/plugins/WinVST/PDChannel/PDChannel.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/WinVST/PDChannel/PDChannelProc.cpp b/plugins/WinVST/PDChannel/PDChannelProc.cpp index fb5932de6..2277acc7d 100755 --- a/plugins/WinVST/PDChannel/PDChannelProc.cpp +++ b/plugins/WinVST/PDChannel/PDChannelProc.cpp @@ -21,8 +21,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -35,44 +35,8 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -112,14 +76,14 @@ void PDChannel::processReplacing(float **inputs, float **outputs, VstInt32 sampl previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -145,8 +109,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; if (settingchase != inputgain) { chasespeed *= 2.0; @@ -159,44 +123,8 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; chasespeed *= 0.9999; chasespeed -= 0.01; @@ -236,16 +164,14 @@ void PDChannel::processDoubleReplacing(double **inputs, double **outputs, VstInt previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Pafnuty/Pafnuty.cpp b/plugins/WinVST/Pafnuty/Pafnuty.cpp index 8c6f42d09..14eb30129 100755 --- a/plugins/WinVST/Pafnuty/Pafnuty.cpp +++ b/plugins/WinVST/Pafnuty/Pafnuty.cpp @@ -25,8 +25,8 @@ Pafnuty::Pafnuty(audioMasterCallback audioMaster) : K = 0.5; L = 0.5; M = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Pafnuty/Pafnuty.h b/plugins/WinVST/Pafnuty/Pafnuty.h index 3a832b773..80eba3e36 100755 --- a/plugins/WinVST/Pafnuty/Pafnuty.h +++ b/plugins/WinVST/Pafnuty/Pafnuty.h @@ -64,8 +64,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Pafnuty/PafnutyProc.cpp b/plugins/WinVST/Pafnuty/PafnutyProc.cpp index 710bcdc8f..79d2326a1 100755 --- a/plugins/WinVST/Pafnuty/PafnutyProc.cpp +++ b/plugins/WinVST/Pafnuty/PafnutyProc.cpp @@ -14,52 +14,52 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF float* out1 = outputs[0]; float* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -258,14 +258,14 @@ void Pafnuty::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -284,52 +284,52 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double chebyshev; - long double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST - long double inP2; - long double inP3; - long double inP4; - long double inP5; - long double inP6; - long double inP7; - long double inP8; - long double inP9; - long double inP10; - long double inP11; - long double inP12; - long double inP13; - long double second = (((A*2.0)-1.0)*1.0); + double chebyshev; + double effxct; //this highlighted when spelled 'effect', might be a reserved word for VST + double inP2; + double inP3; + double inP4; + double inP5; + double inP6; + double inP7; + double inP8; + double inP9; + double inP10; + double inP11; + double inP12; + double inP13; + double second = (((A*2.0)-1.0)*1.0); second = second * fabs(second); - long double third = -(((B*2.0)-1.0)*0.60); + double third = -(((B*2.0)-1.0)*0.60); third = third * fabs(third); - long double fourth = -(((C*2.0)-1.0)*0.60); + double fourth = -(((C*2.0)-1.0)*0.60); fourth = fourth * fabs(fourth); - long double fifth = (((D*2.0)-1.0)*0.45); + double fifth = (((D*2.0)-1.0)*0.45); fifth = fifth * fabs(fifth); - long double sixth = (((E*2.0)-1.0)*0.45); + double sixth = (((E*2.0)-1.0)*0.45); sixth = sixth * fabs(sixth); - long double seventh = -(((F*2.0)-1.0)*0.38); + double seventh = -(((F*2.0)-1.0)*0.38); seventh = seventh * fabs(seventh); - long double eighth = -(((G*2.0)-1.0)*0.38); + double eighth = -(((G*2.0)-1.0)*0.38); eighth = eighth * fabs(eighth); - long double ninth = (((H*2.0)-1.0)*0.35); + double ninth = (((H*2.0)-1.0)*0.35); ninth = ninth * fabs(ninth); - long double tenth = (((I*2.0)-1.0)*0.35); + double tenth = (((I*2.0)-1.0)*0.35); tenth = tenth * fabs(tenth); - long double eleventh = -(((J*2.0)-1.0)*0.32); + double eleventh = -(((J*2.0)-1.0)*0.32); eleventh = eleventh * fabs(eleventh); - long double twelvth = -(((K*2.0)-1.0)*0.32); + double twelvth = -(((K*2.0)-1.0)*0.32); twelvth = twelvth * fabs(twelvth); - long double thirteenth = (((L*2.0)-1.0)*0.30); + double thirteenth = (((L*2.0)-1.0)*0.30); thirteenth = thirteenth * fabs(thirteenth); - long double amount = (M*2.0)-1.0; + double amount = (M*2.0)-1.0; amount = amount * fabs(amount); //setting up while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -528,16 +528,14 @@ void Pafnuty::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //You too can make a horrible graunch and then SUBTRACT it leaving only the refreshing smell of pine... //end right channel - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PaulDither/PaulDitherProc.cpp b/plugins/WinVST/PaulDither/PaulDitherProc.cpp index 759c49820..476bfd332 100755 --- a/plugins/WinVST/PaulDither/PaulDitherProc.cpp +++ b/plugins/WinVST/PaulDither/PaulDitherProc.cpp @@ -31,8 +31,8 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -103,8 +103,8 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/PaulWide/PaulWideProc.cpp b/plugins/WinVST/PaulWide/PaulWideProc.cpp index c8ba4a921..13cd58f79 100644 --- a/plugins/WinVST/PaulWide/PaulWideProc.cpp +++ b/plugins/WinVST/PaulWide/PaulWideProc.cpp @@ -28,8 +28,8 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -46,14 +46,14 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises @@ -116,8 +116,8 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -134,14 +134,14 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - long double currentDither = (rand()/(double)RAND_MAX); - long double ditherL = currentDither; + double currentDither = (rand()/(double)RAND_MAX); + double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises currentDither = (rand()/(double)RAND_MAX); - long double ditherR = currentDither; + double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises diff --git a/plugins/WinVST/PeaksOnly/PeaksOnlyProc.cpp b/plugins/WinVST/PeaksOnly/PeaksOnlyProc.cpp index 89aa62f35..39a49e8c1 100755 --- a/plugins/WinVST/PeaksOnly/PeaksOnlyProc.cpp +++ b/plugins/WinVST/PeaksOnly/PeaksOnlyProc.cpp @@ -26,8 +26,8 @@ void PeaksOnly::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -165,8 +165,8 @@ void PeaksOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/PhaseNudge/PhaseNudge.cpp b/plugins/WinVST/PhaseNudge/PhaseNudge.cpp index e9e5c8d6d..7c200bd4d 100755 --- a/plugins/WinVST/PhaseNudge/PhaseNudge.cpp +++ b/plugins/WinVST/PhaseNudge/PhaseNudge.cpp @@ -16,8 +16,8 @@ PhaseNudge::PhaseNudge(audioMasterCallback audioMaster) : B = 1.0; for(int count = 0; count < 1502; count++) {dL[count] = 0.0; dR[count] = 0.0;} one = 1; maxdelay = 9001; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PhaseNudge/PhaseNudge.h b/plugins/WinVST/PhaseNudge/PhaseNudge.h index 2926ccbea..a2f0dedbc 100755 --- a/plugins/WinVST/PhaseNudge/PhaseNudge.h +++ b/plugins/WinVST/PhaseNudge/PhaseNudge.h @@ -57,8 +57,8 @@ private: double dR[1503]; int one, maxdelay; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp index 150ecd567..449d1f224 100755 --- a/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp +++ b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp @@ -23,53 +23,17 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -133,14 +97,14 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,53 +132,17 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn double dry = 1.0 - wet; double bridgerectifier; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -277,16 +205,14 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (drySampleR * dry)+(inputSampleR * wet); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PitchDelay/PitchDelay.h b/plugins/WinVST/PitchDelay/PitchDelay.h index b5c0fc1b2..2c6f52ffc 100644 --- a/plugins/WinVST/PitchDelay/PitchDelay.h +++ b/plugins/WinVST/PitchDelay/PitchDelay.h @@ -63,8 +63,8 @@ private: double regenSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; @@ -72,8 +72,8 @@ private: double regenSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/WinVST/PitchDelay/PitchDelayProc.cpp b/plugins/WinVST/PitchDelay/PitchDelayProc.cpp index 4dcdcbafe..be0bb419f 100644 --- a/plugins/WinVST/PitchDelay/PitchDelayProc.cpp +++ b/plugins/WinVST/PitchDelay/PitchDelayProc.cpp @@ -64,12 +64,12 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void PitchDelay::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -294,12 +294,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -309,7 +309,7 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + (regenSampleL*feedbackL); - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -449,12 +449,12 @@ void PitchDelay::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PocketVerbs/PocketVerbsProc.cpp b/plugins/WinVST/PocketVerbs/PocketVerbsProc.cpp index 4ea8f5120..c6ab00834 100755 --- a/plugins/WinVST/PocketVerbs/PocketVerbsProc.cpp +++ b/plugins/WinVST/PocketVerbs/PocketVerbsProc.cpp @@ -469,14 +469,14 @@ void PocketVerbs::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); @@ -9645,14 +9645,14 @@ void PocketVerbs::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; peakL -= release; if (peakL < fabs(inputSampleL*2.0)) peakL = fabs(inputSampleL*2.0); diff --git a/plugins/WinVST/Podcast/PodcastProc.cpp b/plugins/WinVST/Podcast/PodcastProc.cpp index e8fd9949a..4a4c4fdd6 100755 --- a/plugins/WinVST/Podcast/PodcastProc.cpp +++ b/plugins/WinVST/Podcast/PodcastProc.cpp @@ -30,12 +30,12 @@ void Podcast::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; @@ -189,12 +189,12 @@ void Podcast::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL *= c1L; trigger = fabs(inputSampleL)*4.7; diff --git a/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp b/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp index 5349f2eb0..eafe49669 100644 --- a/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp +++ b/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp @@ -45,8 +45,8 @@ void PodcastDeluxe::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -371,8 +371,8 @@ void PodcastDeluxe::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Point/Point.cpp b/plugins/WinVST/Point/Point.cpp index f79547099..636dec5f7 100755 --- a/plugins/WinVST/Point/Point.cpp +++ b/plugins/WinVST/Point/Point.cpp @@ -24,8 +24,8 @@ Point::Point(audioMasterCallback audioMaster) : nibBR = 0.0; nobBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/Point/Point.h b/plugins/WinVST/Point/Point.h index ff898cb39..046c81f6b 100755 --- a/plugins/WinVST/Point/Point.h +++ b/plugins/WinVST/Point/Point.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff double nibAL; diff --git a/plugins/WinVST/Point/PointProc.cpp b/plugins/WinVST/Point/PointProc.cpp index a3bbe3cf2..70173909f 100755 --- a/plugins/WinVST/Point/PointProc.cpp +++ b/plugins/WinVST/Point/PointProc.cpp @@ -27,51 +27,15 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -127,14 +91,14 @@ void Point::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,51 +130,15 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double nibnobFactor = 0.0; //start with the fallthrough value, why not double absolute; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= gaintrim; absolute = fabs(inputSampleL); @@ -266,16 +194,14 @@ void Point::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= nibnobFactor; fpFlip = !fpFlip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Pop/Pop.h b/plugins/WinVST/Pop/Pop.h index c598dfcaa..9784b4ee5 100755 --- a/plugins/WinVST/Pop/Pop.h +++ b/plugins/WinVST/Pop/Pop.h @@ -64,12 +64,12 @@ private: double muSpeedBL; double muCoefficientAL; double muCoefficientBL; - long double thickenL; - long double previousL; - long double previous2L; - long double previous3L; - long double previous4L; - long double previous5L; + double thickenL; + double previousL; + double previous2L; + double previous3L; + double previous4L; + double previous5L; double dL[10001]; double muVaryR; @@ -79,12 +79,12 @@ private: double muSpeedBR; double muCoefficientAR; double muCoefficientBR; - long double thickenR; - long double previousR; - long double previous2R; - long double previous3R; - long double previous4R; - long double previous5R; + double thickenR; + double previousR; + double previous2R; + double previous3R; + double previous4R; + double previous5R; double dR[10001]; int delay; diff --git a/plugins/WinVST/Pop/PopProc.cpp b/plugins/WinVST/Pop/PopProc.cpp index a7174cf46..44e7efd3a 100755 --- a/plugins/WinVST/Pop/PopProc.cpp +++ b/plugins/WinVST/Pop/PopProc.cpp @@ -34,14 +34,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -51,7 +51,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -66,7 +66,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -195,14 +195,14 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -211,7 +211,7 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm @@ -281,14 +281,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; dL[delay] = inputSampleL; dR[delay] = inputSampleR; @@ -298,7 +298,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam inputSampleL = (inputSampleL * thickenL) + (dL[delay] * (1.0-thickenL)); inputSampleR = (inputSampleR * thickenR) + (dR[delay] * (1.0-thickenR)); - long double lowestSampleL = inputSampleL; + double lowestSampleL = inputSampleL; if (fabs(inputSampleL) > fabs(previousL)) lowestSampleL = previousL; if (fabs(lowestSampleL) > fabs(previous2L)) lowestSampleL = (lowestSampleL + previous2L) / 1.99; if (fabs(lowestSampleL) > fabs(previous3L)) lowestSampleL = (lowestSampleL + previous3L) / 1.98; @@ -313,7 +313,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double punchinessL = 0.95-fabs(inputSampleL*0.08); if (punchinessL < 0.65) punchinessL = 0.65; - long double lowestSampleR = inputSampleR; + double lowestSampleR = inputSampleR; if (fabs(inputSampleR) > fabs(previousR)) lowestSampleR = previousR; if (fabs(lowestSampleR) > fabs(previous2R)) lowestSampleR = (lowestSampleR + previous2R) / 1.99; if (fabs(lowestSampleR) > fabs(previous3R)) lowestSampleR = (lowestSampleR + previous3R) / 1.98; @@ -442,14 +442,14 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam } //got coefficients, adjusted speeds for R - long double coefficientL = highGainOffset; + double coefficientL = highGainOffset; if (flip) coefficientL += pow(muCoefficientAL,2); else coefficientL += pow(muCoefficientBL,2); inputSampleL *= coefficientL; thickenL = (coefficientL/5)+punchinessL;//0.80; thickenL = (1.0-wet)+(wet*thickenL); - long double coefficientR = highGainOffset; + double coefficientR = highGainOffset; if (flip) coefficientR += pow(muCoefficientAR,2); else coefficientR += pow(muCoefficientBR,2); inputSampleR *= coefficientR; @@ -458,7 +458,7 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ //applied gain correction to control output level- tends to constrain sound rather than inflate it - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; bridgerectifier = sin(bridgerectifier * fabs(bridgerectifier)) / ((fabs(bridgerectifier) == 0.0) ?1:fabs(bridgerectifier)); //using Spiral instead of Density algorithm diff --git a/plugins/WinVST/PowerSag/PowerSag.cpp b/plugins/WinVST/PowerSag/PowerSag.cpp index d1d0745bc..12c46489a 100755 --- a/plugins/WinVST/PowerSag/PowerSag.cpp +++ b/plugins/WinVST/PowerSag/PowerSag.cpp @@ -18,8 +18,8 @@ PowerSag::PowerSag(audioMasterCallback audioMaster) : gcount = 0; A = 0.0; B = 0.3; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PowerSag/PowerSag.h b/plugins/WinVST/PowerSag/PowerSag.h index 38839b650..106a02c34 100755 --- a/plugins/WinVST/PowerSag/PowerSag.h +++ b/plugins/WinVST/PowerSag/PowerSag.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double dL[9000]; double dR[9000]; diff --git a/plugins/WinVST/PowerSag/PowerSagProc.cpp b/plugins/WinVST/PowerSag/PowerSagProc.cpp index de43be625..61c9be8c7 100755 --- a/plugins/WinVST/PowerSag/PowerSagProc.cpp +++ b/plugins/WinVST/PowerSag/PowerSagProc.cpp @@ -23,51 +23,15 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -120,14 +84,14 @@ void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -155,51 +119,15 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > 4000) {gcount = 4000;} @@ -252,16 +180,14 @@ void PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PowerSag2/PowerSag2Proc.cpp b/plugins/WinVST/PowerSag2/PowerSag2Proc.cpp index 645d7b259..69e12f697 100755 --- a/plugins/WinVST/PowerSag2/PowerSag2Proc.cpp +++ b/plugins/WinVST/PowerSag2/PowerSag2Proc.cpp @@ -20,12 +20,12 @@ void PowerSag2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); @@ -89,12 +89,12 @@ void PowerSag2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gcount < 0 || gcount > 16384) {gcount = 16384;} dL[gcount] = fabs(inputSampleL); diff --git a/plugins/WinVST/Precious/PreciousProc.cpp b/plugins/WinVST/Precious/PreciousProc.cpp index 01aeef35c..d15680a95 100755 --- a/plugins/WinVST/Precious/PreciousProc.cpp +++ b/plugins/WinVST/Precious/PreciousProc.cpp @@ -37,8 +37,8 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -216,8 +216,8 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Preponderant/Preponderant.h b/plugins/WinVST/Preponderant/Preponderant.h index dd7949024..731430fb8 100755 --- a/plugins/WinVST/Preponderant/Preponderant.h +++ b/plugins/WinVST/Preponderant/Preponderant.h @@ -56,25 +56,25 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; - long double bassBalanceL; - long double midBalanceL; - long double highBalanceL; - long double bassTrackL; - long double midTrackL; - long double highTrackL; - long double quicknessL; + double bassBalanceL; + double midBalanceL; + double highBalanceL; + double bassTrackL; + double midTrackL; + double highTrackL; + double quicknessL; - long double bassBalanceR; - long double midBalanceR; - long double highBalanceR; - long double bassTrackR; - long double midTrackR; - long double highTrackR; - long double quicknessR; + double bassBalanceR; + double midBalanceR; + double highBalanceR; + double bassTrackR; + double midTrackR; + double highTrackR; + double quicknessR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Preponderant/PreponderantProc.cpp b/plugins/WinVST/Preponderant/PreponderantProc.cpp index d1956b1a6..9ea118e03 100755 --- a/plugins/WinVST/Preponderant/PreponderantProc.cpp +++ b/plugins/WinVST/Preponderant/PreponderantProc.cpp @@ -62,43 +62,43 @@ void Preponderant::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -258,43 +258,43 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = *in1; - long double drySampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = *in1; + double drySampleR = *in2; - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = -(tempSampleL * biquadA[5]) + biquadA[8]; //BANDPASS form biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); - long double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double bassSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = -(tempSampleR * biquadA[5]) + biquadA[10]; //BANDPASS form biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); - long double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel + double bassSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadB[2]) + biquadB[7]; biquadB[7] = -(tempSampleL * biquadB[5]) + biquadB[8]; //BANDPASS form biquadB[8] = (inputSampleL * biquadB[4]) - (tempSampleL * biquadB[6]); - long double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double midSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadB[2]) + biquadB[9]; biquadB[9] = -(tempSampleR * biquadB[5]) + biquadB[10]; //BANDPASS form biquadB[10] = (inputSampleR * biquadB[4]) - (tempSampleR * biquadB[6]); - long double midSampleR = tempSampleR; //note: 9 and 10 store the R channel + double midSampleR = tempSampleR; //note: 9 and 10 store the R channel tempSampleL = (inputSampleL * biquadC[2]) + biquadC[7]; biquadC[7] = -(tempSampleL * biquadC[5]) + biquadC[8]; //BANDPASS form biquadC[8] = (inputSampleL * biquadC[4]) - (tempSampleL * biquadC[6]); - long double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel + double highSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel tempSampleR = (inputSampleR * biquadC[2]) + biquadC[9]; biquadC[9] = -(tempSampleR * biquadC[5]) + biquadC[10]; //BANDPASS form biquadC[10] = (inputSampleR * biquadC[4]) - (tempSampleR * biquadC[6]); - long double highSampleR = tempSampleR; //note: 9 and 10 store the R channel + double highSampleR = tempSampleR; //note: 9 and 10 store the R channel if (bassBalanceL < 0.00125) bassBalanceL = 0.00125; if (bassBalanceL > 1.0) bassBalanceL = 1.0; @@ -381,12 +381,12 @@ void Preponderant::processDoubleReplacing(double **inputs, double **outputs, Vst } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Pressure4/Pressure4.cpp b/plugins/WinVST/Pressure4/Pressure4.cpp index 10ed5facf..cdfc41d8b 100755 --- a/plugins/WinVST/Pressure4/Pressure4.cpp +++ b/plugins/WinVST/Pressure4/Pressure4.cpp @@ -16,8 +16,8 @@ Pressure4::Pressure4(audioMasterCallback audioMaster) : B = 0.2; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/WinVST/Pressure4/Pressure4.h b/plugins/WinVST/Pressure4/Pressure4.h index 6cf344845..1e30c3f88 100755 --- a/plugins/WinVST/Pressure4/Pressure4.h +++ b/plugins/WinVST/Pressure4/Pressure4.h @@ -62,8 +62,8 @@ private: double muSpeedB; double muCoefficientA; double muCoefficientB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/WinVST/Pressure4/Pressure4Proc.cpp b/plugins/WinVST/Pressure4/Pressure4Proc.cpp index 7e285df60..2c1445a6b 100755 --- a/plugins/WinVST/Pressure4/Pressure4Proc.cpp +++ b/plugins/WinVST/Pressure4/Pressure4Proc.cpp @@ -24,7 +24,7 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -44,51 +44,15 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -192,14 +156,14 @@ void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampl else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; @@ -228,7 +192,7 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt release /= overallscale; double fastest = sqrt(release); //speed settings around release - long double bridgerectifier; + double bridgerectifier; double coefficient; double inputSense; double mewiness = (C*2.0)-1.0; @@ -248,52 +212,16 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt } // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *inputL; inputSampleR = *inputR; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -397,16 +325,14 @@ void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt else {inputSampleR = -bridgerectifier;} //second stage of overdrive to prevent overs and allow bloody loud extremeness - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *outputL = inputSampleL; *outputR = inputSampleR; diff --git a/plugins/WinVST/Pressure5/Pressure5.h b/plugins/WinVST/Pressure5/Pressure5.h index de0e13480..479d94b12 100644 --- a/plugins/WinVST/Pressure5/Pressure5.h +++ b/plugins/WinVST/Pressure5/Pressure5.h @@ -82,15 +82,15 @@ private: fix_lastSampleR, fix_total }; - long double fixA[fix_total]; - long double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo + double fixA[fix_total]; + double fixB[fix_total]; //fixed frequency biquad filter for ultrasonics, stereo - long double lastSampleL; - long double intermediateL[16]; + double lastSampleL; + double intermediateL[16]; bool wasPosClipL; bool wasNegClipL; - long double lastSampleR; - long double intermediateR[16]; + double lastSampleR; + double intermediateR[16]; bool wasPosClipR; bool wasNegClipR; //Stereo ClipOnly2 diff --git a/plugins/WinVST/Pressure5/Pressure5Proc.cpp b/plugins/WinVST/Pressure5/Pressure5Proc.cpp index 42d8fe532..41fbf6480 100644 --- a/plugins/WinVST/Pressure5/Pressure5Proc.cpp +++ b/plugins/WinVST/Pressure5/Pressure5Proc.cpp @@ -49,18 +49,18 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -160,7 +160,7 @@ void Pressure5::processReplacing(float **inputs, float **outputs, VstInt32 sampl flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -276,18 +276,18 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; if (fixA[fix_freq] < 0.4999) { - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; @@ -387,7 +387,7 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt flip = !flip; if (fixB[fix_freq] < 0.49999) { - long double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; + double temp = (inputSampleL * fixB[fix_a0]) + fixB[fix_sL1]; fixB[fix_sL1] = (inputSampleL * fixB[fix_a1]) - (temp * fixB[fix_b1]) + fixB[fix_sL2]; fixB[fix_sL2] = (inputSampleL * fixB[fix_a2]) - (temp * fixB[fix_b2]); inputSampleL = temp; @@ -443,12 +443,12 @@ void Pressure5::processDoubleReplacing(double **inputs, double **outputs, VstInt //final clip runs AFTER the Dry/Wet. It serves as a safety clip even if you're not full wet //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PurestAir/PurestAir.h b/plugins/WinVST/PurestAir/PurestAir.h index 5b592c3b4..d077af8c5 100755 --- a/plugins/WinVST/PurestAir/PurestAir.h +++ b/plugins/WinVST/PurestAir/PurestAir.h @@ -56,23 +56,23 @@ private: uint32_t fpd; //default stuff - long double last1SampleL; - long double halfwaySampleL; - long double halfDrySampleL; - long double halfDiffSampleL; - long double diffSampleL; - long double lastSampleL; + double last1SampleL; + double halfwaySampleL; + double halfDrySampleL; + double halfDiffSampleL; + double diffSampleL; + double lastSampleL; double s1L; double s2L; double s3L; double applyL; - long double last1SampleR; - long double halfwaySampleR; - long double halfDrySampleR; - long double halfDiffSampleR; - long double diffSampleR; - long double lastSampleR; + double last1SampleR; + double halfwaySampleR; + double halfDrySampleR; + double halfDiffSampleR; + double diffSampleR; + double lastSampleR; double s1R; double s2R; double s3R; diff --git a/plugins/WinVST/PurestAir/PurestAirProc.cpp b/plugins/WinVST/PurestAir/PurestAirProc.cpp index 73939a77e..362e27217 100755 --- a/plugins/WinVST/PurestAir/PurestAirProc.cpp +++ b/plugins/WinVST/PurestAir/PurestAirProc.cpp @@ -23,12 +23,12 @@ void PurestAir::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; @@ -128,12 +128,12 @@ void PurestAir::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; halfDrySampleL = halfwaySampleL = (inputSampleL + last1SampleL) / 2.0; last1SampleL = inputSampleL; diff --git a/plugins/WinVST/PurestConsole2Buss/PurestConsole2Buss.h b/plugins/WinVST/PurestConsole2Buss/PurestConsole2Buss.h index b65aa472f..d625c7545 100755 --- a/plugins/WinVST/PurestConsole2Buss/PurestConsole2Buss.h +++ b/plugins/WinVST/PurestConsole2Buss/PurestConsole2Buss.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/PurestConsole2Buss/PurestConsole2BussProc.cpp b/plugins/WinVST/PurestConsole2Buss/PurestConsole2BussProc.cpp index 346bf2ae8..08b4a4904 100755 --- a/plugins/WinVST/PurestConsole2Buss/PurestConsole2BussProc.cpp +++ b/plugins/WinVST/PurestConsole2Buss/PurestConsole2BussProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Buss::processReplacing(float **inputs, float **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -90,13 +90,13 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -115,12 +115,12 @@ void PurestConsole2Buss::processDoubleReplacing(double **inputs, double **output //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PurestConsole2Channel/PurestConsole2Channel.h b/plugins/WinVST/PurestConsole2Channel/PurestConsole2Channel.h index ac89c047d..6c7a2753e 100755 --- a/plugins/WinVST/PurestConsole2Channel/PurestConsole2Channel.h +++ b/plugins/WinVST/PurestConsole2Channel/PurestConsole2Channel.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/PurestConsole2Channel/PurestConsole2ChannelProc.cpp b/plugins/WinVST/PurestConsole2Channel/PurestConsole2ChannelProc.cpp index 124b27f16..127c7910b 100755 --- a/plugins/WinVST/PurestConsole2Channel/PurestConsole2ChannelProc.cpp +++ b/plugins/WinVST/PurestConsole2Channel/PurestConsole2ChannelProc.cpp @@ -27,13 +27,13 @@ void PurestConsole2Channel::processReplacing(float **inputs, float **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -89,13 +89,13 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (biquadA[0] < 0.49999) { - long double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double tempSample = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = tempSample; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left tempSample = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; @@ -113,12 +113,12 @@ void PurestConsole2Channel::processDoubleReplacing(double **inputs, double **out //amplitude aspect //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.cpp b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.cpp index 2d8e61900..c7b1ee68e 100755 --- a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.cpp +++ b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleBuss::PurestConsoleBuss(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.h b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.h index 51495fcc9..2c49190a0 100755 --- a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.h +++ b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBuss.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBussProc.cpp b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBussProc.cpp index 6211eeb29..95223c51e 100755 --- a/plugins/WinVST/PurestConsoleBuss/PurestConsoleBussProc.cpp +++ b/plugins/WinVST/PurestConsoleBuss/PurestConsoleBussProc.cpp @@ -15,51 +15,15 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -71,14 +35,14 @@ void PurestConsoleBuss::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -98,51 +62,15 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -154,16 +82,14 @@ void PurestConsoleBuss::processDoubleReplacing(double **inputs, double **outputs inputSampleR = asin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.cpp b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.cpp index 35649a6f6..909f43b68 100755 --- a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.cpp +++ b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new P PurestConsoleChannel::PurestConsoleChannel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.h b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.h index 51e728f59..aa984365d 100755 --- a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.h +++ b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannel.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannelProc.cpp b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannelProc.cpp index 2fc513aa3..4a500fadf 100755 --- a/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannelProc.cpp +++ b/plugins/WinVST/PurestConsoleChannel/PurestConsoleChannelProc.cpp @@ -15,64 +15,28 @@ void PurestConsoleChannel::processReplacing(float **inputs, float **outputs, Vst float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -92,66 +56,28 @@ void PurestConsoleChannel::processDoubleReplacing(double **inputs, double **outp double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //amplitude aspect - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PurestDrive/PurestDrive.cpp b/plugins/WinVST/PurestDrive/PurestDrive.cpp index a1d926444..08c592079 100755 --- a/plugins/WinVST/PurestDrive/PurestDrive.cpp +++ b/plugins/WinVST/PurestDrive/PurestDrive.cpp @@ -17,8 +17,8 @@ PurestDrive::PurestDrive(audioMasterCallback audioMaster) : previousSampleL = 0.0; previousSampleR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestDrive/PurestDrive.h b/plugins/WinVST/PurestDrive/PurestDrive.h index abcd65bb4..2b84c79e1 100755 --- a/plugins/WinVST/PurestDrive/PurestDrive.h +++ b/plugins/WinVST/PurestDrive/PurestDrive.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double previousSampleL; diff --git a/plugins/WinVST/PurestDrive/PurestDriveProc.cpp b/plugins/WinVST/PurestDrive/PurestDriveProc.cpp index f5cc80477..39c9096f5 100755 --- a/plugins/WinVST/PurestDrive/PurestDriveProc.cpp +++ b/plugins/WinVST/PurestDrive/PurestDriveProc.cpp @@ -18,52 +18,16 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -87,14 +51,14 @@ void PurestDrive::processReplacing(float **inputs, float **outputs, VstInt32 sam previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -117,8 +81,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI double intensity = A; double drySampleL; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double apply; @@ -126,44 +90,8 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -187,16 +115,14 @@ void PurestDrive::processDoubleReplacing(double **inputs, double **outputs, VstI previousSampleR = sin(drySampleR); //apply the sine while storing previous sample - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PurestEcho/PurestEcho.cpp b/plugins/WinVST/PurestEcho/PurestEcho.cpp index 6bcaa3f69..d54d53c1e 100755 --- a/plugins/WinVST/PurestEcho/PurestEcho.cpp +++ b/plugins/WinVST/PurestEcho/PurestEcho.cpp @@ -19,8 +19,8 @@ PurestEcho::PurestEcho(audioMasterCallback audioMaster) : E = 0.0; for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestEcho/PurestEcho.h b/plugins/WinVST/PurestEcho/PurestEcho.h index 870e15822..e16cde658 100755 --- a/plugins/WinVST/PurestEcho/PurestEcho.h +++ b/plugins/WinVST/PurestEcho/PurestEcho.h @@ -62,8 +62,8 @@ private: int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/PurestEcho/PurestEchoProc.cpp b/plugins/WinVST/PurestEcho/PurestEchoProc.cpp index e8e141cd4..a64daf546 100755 --- a/plugins/WinVST/PurestEcho/PurestEchoProc.cpp +++ b/plugins/WinVST/PurestEcho/PurestEchoProc.cpp @@ -77,51 +77,15 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -174,14 +138,14 @@ void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 samp gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -263,51 +227,15 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn double delaysBufferR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; @@ -360,16 +288,14 @@ void PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstIn gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PurestFade/PurestFadeProc.cpp b/plugins/WinVST/PurestFade/PurestFadeProc.cpp index ef2f9fc09..31f0a9d17 100755 --- a/plugins/WinVST/PurestFade/PurestFadeProc.cpp +++ b/plugins/WinVST/PurestFade/PurestFadeProc.cpp @@ -31,24 +31,24 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -119,24 +119,24 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn //plugin is instantiated. //Otherwise it's the target, in dB. } - long double targetgain; + double targetgain; //done with top controller - long double targetBgain = B; + double targetBgain = B; if (gainBchase < 0.0) gainBchase = targetBgain; //this one is not a dB value, but straight multiplication //done with slow fade controller - long double fadeSpeed = targetBgain; + double fadeSpeed = targetBgain; if (fadeSpeed < 0.0027) fadeSpeed = 0.0027; //minimum fade speed fadeSpeed = ((getSampleRate()*0.004) / fadeSpeed); //this will tend to be much slower than PurestGain, and also adapt to sample rates - long double outputgain; + double outputgain; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/PurestGain/PurestGain.cpp b/plugins/WinVST/PurestGain/PurestGain.cpp index b1b77fe18..d068d7fac 100755 --- a/plugins/WinVST/PurestGain/PurestGain.cpp +++ b/plugins/WinVST/PurestGain/PurestGain.cpp @@ -18,8 +18,8 @@ PurestGain::PurestGain(audioMasterCallback audioMaster) : settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestGain/PurestGain.h b/plugins/WinVST/PurestGain/PurestGain.h index 9e2baeab4..b9d3a2d47 100755 --- a/plugins/WinVST/PurestGain/PurestGain.h +++ b/plugins/WinVST/PurestGain/PurestGain.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/WinVST/PurestGain/PurestGainProc.cpp b/plugins/WinVST/PurestGain/PurestGainProc.cpp index 4aa6d96fb..2ca5b8478 100755 --- a/plugins/WinVST/PurestGain/PurestGainProc.cpp +++ b/plugins/WinVST/PurestGain/PurestGainProc.cpp @@ -44,8 +44,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; //A is 0-1 (you can't feed other values to VST hosts, it's always 0-1 internally) //B is 0-1 and you need to multiply it by 100 if you want to use the 'percent' @@ -74,44 +74,8 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -122,7 +86,7 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= outputgain; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -176,8 +140,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn double outputgain; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { @@ -200,44 +164,8 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (1.0 == outputgain) { @@ -248,7 +176,7 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/WinVST/PurestSquish/PurestSquishProc.cpp b/plugins/WinVST/PurestSquish/PurestSquishProc.cpp index 1be853713..946d23963 100755 --- a/plugins/WinVST/PurestSquish/PurestSquishProc.cpp +++ b/plugins/WinVST/PurestSquish/PurestSquishProc.cpp @@ -18,10 +18,10 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -29,8 +29,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -68,8 +68,8 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); @@ -522,10 +522,10 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst overallscale /= 44100.0; overallscale *= getSampleRate(); - long double highpassSampleL; - long double highpassSampleBL; - long double highpassSampleR; - long double highpassSampleBR; + double highpassSampleL; + double highpassSampleBL; + double highpassSampleR; + double highpassSampleBR; double threshold = 1.01 - (1.0-pow(1.0-(A*0.5),4)); double iirAmount = pow(B,4)/overallscale; double output = C; @@ -533,8 +533,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -572,8 +572,8 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; double muMakeupGainL = 1.0 / threshold; double outMakeupGainL = sqrt(muMakeupGainL); diff --git a/plugins/WinVST/PurestWarm/PurestWarm.cpp b/plugins/WinVST/PurestWarm/PurestWarm.cpp index eeee37b58..13dbe8bd6 100755 --- a/plugins/WinVST/PurestWarm/PurestWarm.cpp +++ b/plugins/WinVST/PurestWarm/PurestWarm.cpp @@ -13,8 +13,8 @@ PurestWarm::PurestWarm(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestWarm/PurestWarm.h b/plugins/WinVST/PurestWarm/PurestWarm.h index 98bb0ce4e..83fd9c336 100755 --- a/plugins/WinVST/PurestWarm/PurestWarm.h +++ b/plugins/WinVST/PurestWarm/PurestWarm.h @@ -52,8 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/PurestWarm/PurestWarmProc.cpp b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp index 101c9319d..b34bfb596 100755 --- a/plugins/WinVST/PurestWarm/PurestWarmProc.cpp +++ b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp @@ -17,51 +17,15 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -70,7 +34,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -82,7 +46,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -95,7 +59,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -108,7 +72,7 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 32 bit dither, made small and tidy. int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexpf((float)inputSampleR, &expon); dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); @@ -138,51 +102,15 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn int polarity = (int) ( A * 1.999 ); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (polarity == 1) { @@ -191,7 +119,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -206,7 +134,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -221,7 +149,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); @@ -235,7 +163,7 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; //stereo 64 bit dither, made small and tidy. int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); + double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); dither /= 536870912.0; //needs this to scale to 64 bit zone inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; frexp((double)inputSampleR, &expon); diff --git a/plugins/WinVST/Pyewacket/Pyewacket.cpp b/plugins/WinVST/Pyewacket/Pyewacket.cpp index d500e7449..2be4313fe 100755 --- a/plugins/WinVST/Pyewacket/Pyewacket.cpp +++ b/plugins/WinVST/Pyewacket/Pyewacket.cpp @@ -18,8 +18,8 @@ Pyewacket::Pyewacket(audioMasterCallback audioMaster) : chase = 1.0; lastrectifierL = 0.0; lastrectifierR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Pyewacket/Pyewacket.h b/plugins/WinVST/Pyewacket/Pyewacket.h index 087a198ee..5624c4b93 100755 --- a/plugins/WinVST/Pyewacket/Pyewacket.h +++ b/plugins/WinVST/Pyewacket/Pyewacket.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double chase; double lastrectifierL; diff --git a/plugins/WinVST/Pyewacket/PyewacketProc.cpp b/plugins/WinVST/Pyewacket/PyewacketProc.cpp index 8b3021a9e..8b21a91fb 100755 --- a/plugins/WinVST/Pyewacket/PyewacketProc.cpp +++ b/plugins/WinVST/Pyewacket/PyewacketProc.cpp @@ -17,12 +17,12 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -41,44 +41,8 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -133,14 +97,14 @@ void Pyewacket::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,12 +126,12 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double bridgerectifier; double temprectifier; double inputSense; @@ -186,44 +150,8 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputGain != 1.0) { inputSampleL *= inputGain; @@ -278,16 +206,14 @@ void Pyewacket::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/RawGlitters/RawGlittersProc.cpp b/plugins/WinVST/RawGlitters/RawGlittersProc.cpp index 4ee485fa4..a4414634e 100755 --- a/plugins/WinVST/RawGlitters/RawGlittersProc.cpp +++ b/plugins/WinVST/RawGlitters/RawGlittersProc.cpp @@ -27,8 +27,8 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -84,8 +84,8 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/RawTimbers/RawTimbersProc.cpp b/plugins/WinVST/RawTimbers/RawTimbersProc.cpp index 78e012e26..0a1b401c3 100755 --- a/plugins/WinVST/RawTimbers/RawTimbersProc.cpp +++ b/plugins/WinVST/RawTimbers/RawTimbersProc.cpp @@ -28,8 +28,8 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -87,8 +87,8 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Recurve/Recurve.h b/plugins/WinVST/Recurve/Recurve.h index 52a507738..bb90e4bac 100755 --- a/plugins/WinVST/Recurve/Recurve.h +++ b/plugins/WinVST/Recurve/Recurve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/Recurve/RecurveProc.cpp b/plugins/WinVST/Recurve/RecurveProc.cpp index 8a0b85d85..fc20e5b25 100755 --- a/plugins/WinVST/Recurve/RecurveProc.cpp +++ b/plugins/WinVST/Recurve/RecurveProc.cpp @@ -16,8 +16,8 @@ void Recurve::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -71,8 +71,8 @@ void Recurve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Remap/RemapProc.cpp b/plugins/WinVST/Remap/RemapProc.cpp index 594800c96..b9227743f 100755 --- a/plugins/WinVST/Remap/RemapProc.cpp +++ b/plugins/WinVST/Remap/RemapProc.cpp @@ -21,18 +21,18 @@ void Remap::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; @@ -95,18 +95,18 @@ void Remap::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double gaintrimL = fabs(inputSampleL); - long double gaintrimR = fabs(inputSampleR); + double gaintrimL = fabs(inputSampleL); + double gaintrimR = fabs(inputSampleR); - long double bridgerectifierL = gaintrimL*gain; - long double bridgerectifierR = gaintrimR*gain; + double bridgerectifierL = gaintrimL*gain; + double bridgerectifierR = gaintrimR*gain; if (gaintrimL > 1.0) gaintrimL = 1.0; else gaintrimL *= gaintrimL; diff --git a/plugins/WinVST/ResEQ/ResEQProc.cpp b/plugins/WinVST/ResEQ/ResEQProc.cpp index 99fa31999..c9c21c0dd 100644 --- a/plugins/WinVST/ResEQ/ResEQProc.cpp +++ b/plugins/WinVST/ResEQ/ResEQProc.cpp @@ -128,12 +128,12 @@ void ResEQ::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; @@ -422,14 +422,14 @@ void ResEQ::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; bL[59] = bL[58]; bL[58] = bL[57]; bL[57] = bL[56]; bL[56] = bL[55]; bL[55] = bL[54]; bL[54] = bL[53]; bL[53] = bL[52]; bL[52] = bL[51]; bL[51] = bL[50]; bL[50] = bL[49]; bL[49] = bL[48]; bL[48] = bL[47]; bL[47] = bL[46]; bL[46] = bL[45]; bL[45] = bL[44]; bL[44] = bL[43]; bL[43] = bL[42]; bL[42] = bL[41]; bL[41] = bL[40]; bL[40] = bL[39]; bL[39] = bL[38]; diff --git a/plugins/WinVST/Reverb/Reverb.h b/plugins/WinVST/Reverb/Reverb.h index a7b966d93..5d6f36229 100755 --- a/plugins/WinVST/Reverb/Reverb.h +++ b/plugins/WinVST/Reverb/Reverb.h @@ -53,9 +53,9 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[11]; - long double biquadB[11]; - long double biquadC[11]; + double biquadA[11]; + double biquadB[11]; + double biquadC[11]; double aAL[8111]; double aBL[7511]; diff --git a/plugins/WinVST/Reverb/ReverbProc.cpp b/plugins/WinVST/Reverb/ReverbProc.cpp index 7140d1781..3dce2d8af 100755 --- a/plugins/WinVST/Reverb/ReverbProc.cpp +++ b/plugins/WinVST/Reverb/ReverbProc.cpp @@ -68,12 +68,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -82,12 +82,12 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -99,15 +99,15 @@ void Reverb::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -446,12 +446,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aML[countM] = inputSampleL; aMR[countM] = inputSampleR; @@ -460,12 +460,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = aMR[countM]; //predelay - long double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; + double tempSampleL = (inputSampleL * biquadA[2]) + biquadA[7]; biquadA[7] = (inputSampleL * biquadA[3]) - (tempSampleL * biquadA[5]) + biquadA[8]; biquadA[8] = (inputSampleL * biquadA[4]) - (tempSampleL * biquadA[6]); inputSampleL = tempSampleL; //like mono AU, 7 and 8 store L channel - long double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; + double tempSampleR = (inputSampleR * biquadA[2]) + biquadA[9]; biquadA[9] = (inputSampleR * biquadA[3]) - (tempSampleR * biquadA[5]) + biquadA[10]; biquadA[10] = (inputSampleR * biquadA[4]) - (tempSampleR * biquadA[6]); inputSampleR = tempSampleR; //note: 9 and 10 store the R channel @@ -477,15 +477,15 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); - long double allpassIL = inputSampleL; - long double allpassJL = inputSampleL; - long double allpassKL = inputSampleL; - long double allpassLL = inputSampleL; + double allpassIL = inputSampleL; + double allpassJL = inputSampleL; + double allpassKL = inputSampleL; + double allpassLL = inputSampleL; - long double allpassIR = inputSampleR; - long double allpassJR = inputSampleR; - long double allpassKR = inputSampleR; - long double allpassLR = inputSampleR; + double allpassIR = inputSampleR; + double allpassJR = inputSampleR; + double allpassKR = inputSampleR; + double allpassLR = inputSampleR; int allpasstemp = countI + 1; if (allpasstemp < 0 || allpasstemp > delayI) {allpasstemp = 0;} @@ -745,12 +745,12 @@ void Reverb::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Righteous4/Righteous4.cpp b/plugins/WinVST/Righteous4/Righteous4.cpp index 3c50a7493..ffedc9292 100755 --- a/plugins/WinVST/Righteous4/Righteous4.cpp +++ b/plugins/WinVST/Righteous4/Righteous4.cpp @@ -105,8 +105,8 @@ Righteous4::Righteous4(audioMasterCallback audioMaster) : gwAR = 0.0; gwBR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Righteous4/Righteous4.h b/plugins/WinVST/Righteous4/Righteous4.h index 8b9e44b57..4ddd61ec9 100755 --- a/plugins/WinVST/Righteous4/Righteous4.h +++ b/plugins/WinVST/Righteous4/Righteous4.h @@ -108,7 +108,7 @@ private: double rightSampleZ; double bynL[13]; - long double noiseShapingL; + double noiseShapingL; double lastSampleL; double IIRsampleL; double gwPrevL; @@ -116,15 +116,15 @@ private: double gwBL; double bynR[13]; - long double noiseShapingR; + double noiseShapingR; double lastSampleR; double IIRsampleR; double gwPrevR; double gwAR; double gwBR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Righteous4/Righteous4Proc.cpp b/plugins/WinVST/Righteous4/Righteous4Proc.cpp index feff69b52..3b330cb6d 100755 --- a/plugins/WinVST/Righteous4/Righteous4Proc.cpp +++ b/plugins/WinVST/Righteous4/Righteous4Proc.cpp @@ -13,8 +13,8 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); @@ -42,46 +42,10 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -95,7 +59,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -300,14 +264,14 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp //output dither section if (bitDepth == 3) { - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out @@ -523,8 +487,8 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! - long double fpNew = 1.0 - fpOld; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0002597;//scaleback of harmonic avg IIRscaleback /= overallscale; IIRscaleback = 1.0 - IIRscaleback; @@ -549,46 +513,10 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; //begin the whole distortion dealiebop @@ -602,7 +530,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn double secondharmonicR = sin((2.0 * inputSampleR * inputSampleR) * IIRsampleR); //secondharmonic is calculated before IIRsample is updated, to delay reaction - long double bridgerectifier = inputSampleL; + double bridgerectifier = inputSampleL; if (bridgerectifier > 1.2533141373155) bridgerectifier = 1.2533141373155; if (bridgerectifier < -1.2533141373155) bridgerectifier = -1.2533141373155; //clip to 1.2533141373155 to reach maximum output @@ -807,16 +735,14 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn //output dither section if (bitDepth == 3) { - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } else { //entire Naturalize section used when not on 32 bit out diff --git a/plugins/WinVST/SideDull/SideDull.cpp b/plugins/WinVST/SideDull/SideDull.cpp index 479bdfd5d..1153e90bc 100755 --- a/plugins/WinVST/SideDull/SideDull.cpp +++ b/plugins/WinVST/SideDull/SideDull.cpp @@ -16,8 +16,8 @@ SideDull::SideDull(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/SideDull/SideDull.h b/plugins/WinVST/SideDull/SideDull.h index ef5e892c8..36950fd08 100755 --- a/plugins/WinVST/SideDull/SideDull.h +++ b/plugins/WinVST/SideDull/SideDull.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; float A; }; diff --git a/plugins/WinVST/SideDull/SideDullProc.cpp b/plugins/WinVST/SideDull/SideDullProc.cpp index 7b777444b..06f8ec15b 100755 --- a/plugins/WinVST/SideDull/SideDullProc.cpp +++ b/plugins/WinVST/SideDull/SideDullProc.cpp @@ -18,9 +18,9 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -28,44 +28,8 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -85,14 +49,14 @@ void SideDull::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -115,9 +79,9 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; double iirAmount = pow(A,3)/overallscale; @@ -125,44 +89,8 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -182,16 +110,14 @@ void SideDull::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Sidepass/Sidepass.cpp b/plugins/WinVST/Sidepass/Sidepass.cpp index a28c21233..8dc84167f 100755 --- a/plugins/WinVST/Sidepass/Sidepass.cpp +++ b/plugins/WinVST/Sidepass/Sidepass.cpp @@ -16,8 +16,8 @@ Sidepass::Sidepass(audioMasterCallback audioMaster) : iirSampleA = 0.0; iirSampleB = 0.0; flip = true; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Sidepass/Sidepass.h b/plugins/WinVST/Sidepass/Sidepass.h index 1b31b911e..4755073ea 100755 --- a/plugins/WinVST/Sidepass/Sidepass.h +++ b/plugins/WinVST/Sidepass/Sidepass.h @@ -55,8 +55,8 @@ private: double iirSampleA; double iirSampleB; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Sidepass/SidepassProc.cpp b/plugins/WinVST/Sidepass/SidepassProc.cpp index 834ae3e26..b6b664d3f 100755 --- a/plugins/WinVST/Sidepass/SidepassProc.cpp +++ b/plugins/WinVST/Sidepass/SidepassProc.cpp @@ -18,53 +18,17 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -84,14 +48,14 @@ void Sidepass::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -114,53 +78,17 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 overallscale /= 44100.0; overallscale *= getSampleRate(); double iirAmount = pow(A,3)/overallscale; - long double inputSampleL; - long double inputSampleR; - long double mid; + double inputSampleL; + double inputSampleR; + double mid; double side; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -180,16 +108,14 @@ void Sidepass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.cpp b/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.cpp index fd8a06a35..28ba08c34 100755 --- a/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.cpp +++ b/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.cpp @@ -19,8 +19,8 @@ SingleEndedTriode::SingleEndedTriode(audioMasterCallback audioMaster) : postsine = sin(0.5); - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.h b/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.h index c162512f3..340d8dbd8 100755 --- a/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.h +++ b/plugins/WinVST/SingleEndedTriode/SingleEndedTriode.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double postsine; diff --git a/plugins/WinVST/SingleEndedTriode/SingleEndedTriodeProc.cpp b/plugins/WinVST/SingleEndedTriode/SingleEndedTriodeProc.cpp index ef6694c21..882fca727 100755 --- a/plugins/WinVST/SingleEndedTriode/SingleEndedTriodeProc.cpp +++ b/plugins/WinVST/SingleEndedTriode/SingleEndedTriodeProc.cpp @@ -23,46 +23,10 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -73,7 +37,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -93,7 +57,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -109,7 +73,7 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -127,14 +91,14 @@ void SingleEndedTriode::processReplacing(float **inputs, float **outputs, VstInt inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -162,46 +126,10 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; double drySampleL = inputSampleL; double drySampleR = inputSampleR; @@ -212,7 +140,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleL -= 0.5; inputSampleR -= 0.5; - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; bridgerectifier = sin(bridgerectifier); if (inputSampleL > 0) inputSampleL = bridgerectifier; @@ -232,7 +160,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (softcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); if (bridgerectifier > 0.0) bridgerectifier -= (softcrossover*(bridgerectifier+sqrt(bridgerectifier))); if (bridgerectifier < 0.0) bridgerectifier = 0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -248,7 +176,7 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs if (hardcrossover > 0.0) { - long double bridgerectifier = fabs(inputSampleL); + double bridgerectifier = fabs(inputSampleL); bridgerectifier -= hardcrossover; if (bridgerectifier < 0.0) bridgerectifier = 0.0; if (inputSampleL > 0.0) inputSampleL = bridgerectifier; @@ -266,16 +194,14 @@ void SingleEndedTriode::processDoubleReplacing(double **inputs, double **outputs inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Slew/SlewProc.cpp b/plugins/WinVST/Slew/SlewProc.cpp index 5618bb793..480beb3fd 100644 --- a/plugins/WinVST/Slew/SlewProc.cpp +++ b/plugins/WinVST/Slew/SlewProc.cpp @@ -33,44 +33,8 @@ void Slew::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; @@ -122,44 +86,8 @@ void Slew::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; clamp = inputSampleL - lastSampleL; outputSampleL = inputSampleL; diff --git a/plugins/WinVST/Slew2/Slew2Proc.cpp b/plugins/WinVST/Slew2/Slew2Proc.cpp index 07b1bb9d3..cea1b98e8 100755 --- a/plugins/WinVST/Slew2/Slew2Proc.cpp +++ b/plugins/WinVST/Slew2/Slew2Proc.cpp @@ -26,44 +26,8 @@ void Slew2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; @@ -173,44 +137,8 @@ void Slew2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; LataDrySample = inputSampleL; RataDrySample = inputSampleR; diff --git a/plugins/WinVST/Slew3/Slew3Proc.cpp b/plugins/WinVST/Slew3/Slew3Proc.cpp index eacd1386f..18177c5ea 100755 --- a/plugins/WinVST/Slew3/Slew3Proc.cpp +++ b/plugins/WinVST/Slew3/Slew3Proc.cpp @@ -22,8 +22,8 @@ void Slew3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void Slew3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/SlewOnly/SlewOnlyProc.cpp b/plugins/WinVST/SlewOnly/SlewOnlyProc.cpp index 5fc12c3a8..5676a6f91 100755 --- a/plugins/WinVST/SlewOnly/SlewOnlyProc.cpp +++ b/plugins/WinVST/SlewOnly/SlewOnlyProc.cpp @@ -14,54 +14,18 @@ void SlewOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; outputSampleR = (inputSampleR - lastSampleR)*trim; @@ -89,54 +53,18 @@ void SlewOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; - long double outputSampleL; - long double outputSampleR; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; double trim = 2.302585092994045684017991; //natural logarithm of 10 while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; outputSampleL = (inputSampleL - lastSampleL)*trim; diff --git a/plugins/WinVST/Smooth/SmoothProc.cpp b/plugins/WinVST/Smooth/SmoothProc.cpp index 1fb135570..81df54143 100755 --- a/plugins/WinVST/Smooth/SmoothProc.cpp +++ b/plugins/WinVST/Smooth/SmoothProc.cpp @@ -28,8 +28,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -67,8 +67,8 @@ void Smooth::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); @@ -214,8 +214,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -253,8 +253,8 @@ void Smooth::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it again. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; //left channel clamp = fabs(inputSampleL - lastSampleAL); diff --git a/plugins/WinVST/SoftGate/SoftGateProc.cpp b/plugins/WinVST/SoftGate/SoftGateProc.cpp index a09429bfc..ba8d6358c 100755 --- a/plugins/WinVST/SoftGate/SoftGateProc.cpp +++ b/plugins/WinVST/SoftGate/SoftGateProc.cpp @@ -26,8 +26,8 @@ void SoftGate::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -95,8 +95,8 @@ void SoftGate::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp b/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp index 4a611e8fa..bf9da7ef7 100755 --- a/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp +++ b/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp @@ -34,8 +34,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -125,8 +125,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Spiral/SpiralProc.cpp b/plugins/WinVST/Spiral/SpiralProc.cpp index 0ad97429c..f672d63d1 100755 --- a/plugins/WinVST/Spiral/SpiralProc.cpp +++ b/plugins/WinVST/Spiral/SpiralProc.cpp @@ -16,8 +16,8 @@ void Spiral::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -55,8 +55,8 @@ void Spiral::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/Spiral2/Spiral2.h b/plugins/WinVST/Spiral2/Spiral2.h index a65051eab..7da43323c 100755 --- a/plugins/WinVST/Spiral2/Spiral2.h +++ b/plugins/WinVST/Spiral2/Spiral2.h @@ -56,14 +56,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleBL; - long double prevSampleL; + double iirSampleAL; + double iirSampleBL; + double prevSampleL; uint32_t fpd; - long double iirSampleAR; - long double iirSampleBR; - long double prevSampleR; + double iirSampleAR; + double iirSampleBR; + double prevSampleR; bool flip; //default stuff diff --git a/plugins/WinVST/Spiral2/Spiral2Proc.cpp b/plugins/WinVST/Spiral2/Spiral2Proc.cpp index 2655f678a..36f15560c 100755 --- a/plugins/WinVST/Spiral2/Spiral2Proc.cpp +++ b/plugins/WinVST/Spiral2/Spiral2Proc.cpp @@ -26,14 +26,14 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -58,8 +58,8 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); @@ -124,14 +124,14 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; @@ -156,8 +156,8 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //highpass section - long double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); - long double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); + double presenceSampleL = sin(inputSampleL * fabs(prevSampleL)) / ((prevSampleL == 0.0) ?1:fabs(prevSampleL)); + double presenceSampleR = sin(inputSampleR * fabs(prevSampleR)) / ((prevSampleR == 0.0) ?1:fabs(prevSampleR)); //change from first Spiral: delay of one sample on the scaling factor. inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((fabs(inputSampleL) == 0.0) ?1:fabs(inputSampleL)); inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); diff --git a/plugins/WinVST/Srsly/Srsly.h b/plugins/WinVST/Srsly/Srsly.h index 0f1654320..6d1dcc7d9 100644 --- a/plugins/WinVST/Srsly/Srsly.h +++ b/plugins/WinVST/Srsly/Srsly.h @@ -56,17 +56,17 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Srsly/SrslyProc.cpp b/plugins/WinVST/Srsly/SrslyProc.cpp index 9ecc01cd1..066119dac 100644 --- a/plugins/WinVST/Srsly/SrslyProc.cpp +++ b/plugins/WinVST/Srsly/SrslyProc.cpp @@ -16,7 +16,7 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -127,81 +127,81 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -254,7 +254,7 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -365,81 +365,81 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them inputSampleL += processingL; @@ -465,12 +465,12 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Srsly2/Srsly2.h b/plugins/WinVST/Srsly2/Srsly2.h index 78d5df5f7..f8c2bdbef 100755 --- a/plugins/WinVST/Srsly2/Srsly2.h +++ b/plugins/WinVST/Srsly2/Srsly2.h @@ -57,17 +57,17 @@ private: std::set< std::string > _canDo; - long double biquadM2[11]; - long double biquadM7[11]; - long double biquadM10[11]; + double biquadM2[11]; + double biquadM7[11]; + double biquadM10[11]; - long double biquadL3[11]; - long double biquadL7[11]; - long double biquadR3[11]; - long double biquadR7[11]; + double biquadL3[11]; + double biquadL7[11]; + double biquadR3[11]; + double biquadR7[11]; - long double biquadS3[11]; - long double biquadS5[11]; + double biquadS3[11]; + double biquadS5[11]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Srsly2/Srsly2Proc.cpp b/plugins/WinVST/Srsly2/Srsly2Proc.cpp index a1eb1ce15..13306512c 100755 --- a/plugins/WinVST/Srsly2/Srsly2Proc.cpp +++ b/plugins/WinVST/Srsly2/Srsly2Proc.cpp @@ -16,7 +16,7 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -132,81 +132,81 @@ void Srsly2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -273,7 +273,7 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double sampleRate = getSampleRate(); if (sampleRate < 22000) sampleRate = 22000; //keep biquads in range - long double tempSample; + double tempSample; biquadM2[0] = 2000 / sampleRate; //up biquadM7[0] = 7000 / sampleRate; //down @@ -389,81 +389,81 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; inputSampleL = sin(inputSampleL); inputSampleR = sin(inputSampleR); //encode Console5: good cleanness - long double mid = inputSampleL + inputSampleR; - long double rawmid = mid * 0.5; //we'll use this to isolate L&R a little - long double side = inputSampleL - inputSampleR; - long double boostside = side * depthS; + double mid = inputSampleL + inputSampleR; + double rawmid = mid * 0.5; //we'll use this to isolate L&R a little + double side = inputSampleL - inputSampleR; + double boostside = side * depthS; //assign mid and side.Between these sections, you can do mid/side processing tempSample = (mid * biquadM2[2]) + biquadM2[7]; biquadM2[7] = (-tempSample * biquadM2[5]) + biquadM2[8]; biquadM2[8] = (mid * biquadM2[4]) - (tempSample * biquadM2[6]); - long double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel + double M2Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM7[2]) + biquadM7[7]; biquadM7[7] = (-tempSample * biquadM7[5]) + biquadM7[8]; biquadM7[8] = (mid * biquadM7[4]) - (tempSample * biquadM7[6]); - long double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M7Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (mid * biquadM10[2]) + biquadM10[7]; biquadM10[7] = (-tempSample * biquadM10[5]) + biquadM10[8]; biquadM10[8] = (mid * biquadM10[4]) - (tempSample * biquadM10[6]); - long double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel + double M10Sample = -tempSample*2.0; //like mono AU, 7 and 8 store L channel //mid tempSample = (side * biquadS3[2]) + biquadS3[7]; biquadS3[7] = (-tempSample * biquadS3[5]) + biquadS3[8]; biquadS3[8] = (side * biquadS3[4]) - (tempSample * biquadS3[6]); - long double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel + double S3Sample = tempSample*2.0; //like mono AU, 7 and 8 store L channel tempSample = (side * biquadS5[2]) + biquadS5[7]; biquadS5[7] = (-tempSample * biquadS5[5]) + biquadS5[8]; biquadS5[8] = (side * biquadS5[4]) - (tempSample * biquadS5[6]); - long double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel + double S5Sample = -tempSample*5.0; //like mono AU, 7 and 8 store L channel mid = (M2Sample + M7Sample + M10Sample)*depthM; side = (S3Sample + S5Sample + boostside)*depthS; - long double msOutSampleL = (mid+side)/2.0; - long double msOutSampleR = (mid-side)/2.0; + double msOutSampleL = (mid+side)/2.0; + double msOutSampleR = (mid-side)/2.0; //unassign mid and side - long double isoSampleL = inputSampleL-rawmid; - long double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little + double isoSampleL = inputSampleL-rawmid; + double isoSampleR = inputSampleR-rawmid; //trying to isolate L and R a little tempSample = (isoSampleL * biquadL3[2]) + biquadL3[7]; biquadL3[7] = (-tempSample * biquadL3[5]) + biquadL3[8]; biquadL3[8] = (isoSampleL * biquadL3[4]) - (tempSample * biquadL3[6]); - long double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel + double L3Sample = tempSample; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR3[2]) + biquadR3[9]; biquadR3[9] = (-tempSample * biquadR3[5]) + biquadR3[10]; biquadR3[10] = (isoSampleR * biquadR3[4]) - (tempSample * biquadR3[6]); - long double R3Sample = tempSample; //note: 9 and 10 store the R channel + double R3Sample = tempSample; //note: 9 and 10 store the R channel tempSample = (isoSampleL * biquadL7[2]) + biquadL7[7]; biquadL7[7] = (-tempSample * biquadL7[5]) + biquadL7[8]; biquadL7[8] = (isoSampleL * biquadL7[4]) - (tempSample * biquadL7[6]); - long double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel + double L7Sample = tempSample*3.0; //like mono AU, 7 and 8 store L channel tempSample = (isoSampleR * biquadR7[2]) + biquadR7[9]; biquadR7[9] = (-tempSample * biquadR7[5]) + biquadR7[10]; biquadR7[10] = (isoSampleR * biquadR7[4]) - (tempSample * biquadR7[6]); - long double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel + double R7Sample = tempSample*3.0; //note: 9 and 10 store the R channel - long double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); - long double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); + double processingL = msOutSampleL + ((L3Sample + L7Sample)*depthS); + double processingR = msOutSampleR + ((R3Sample + R7Sample)*depthS); //done with making filters, now we apply them mid = inputSampleL + inputSampleR; @@ -503,12 +503,12 @@ void Srsly2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/StarChild/StarChild.cpp b/plugins/WinVST/StarChild/StarChild.cpp index 6e4bf3e9a..610c87efc 100644 --- a/plugins/WinVST/StarChild/StarChild.cpp +++ b/plugins/WinVST/StarChild/StarChild.cpp @@ -66,8 +66,8 @@ StarChild::StarChild(audioMasterCallback audioMaster) : increment = 1; dutyCycle = 1; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/StarChild/StarChild.h b/plugins/WinVST/StarChild/StarChild.h index 630be3c82..157454b92 100644 --- a/plugins/WinVST/StarChild/StarChild.h +++ b/plugins/WinVST/StarChild/StarChild.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double d[45102]; diff --git a/plugins/WinVST/StarChild/StarChildProc.cpp b/plugins/WinVST/StarChild/StarChildProc.cpp index 047948abe..608c93157 100644 --- a/plugins/WinVST/StarChild/StarChildProc.cpp +++ b/plugins/WinVST/StarChild/StarChildProc.cpp @@ -76,44 +76,8 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -389,14 +353,14 @@ void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -476,44 +440,8 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -790,16 +718,14 @@ void StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += drySampleR; //here we combine the tanks with the dry signal - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/StereoFX/StereoFX.cpp b/plugins/WinVST/StereoFX/StereoFX.cpp index 704cbf375..8531bcdbe 100755 --- a/plugins/WinVST/StereoFX/StereoFX.cpp +++ b/plugins/WinVST/StereoFX/StereoFX.cpp @@ -17,8 +17,8 @@ StereoFX::StereoFX(audioMasterCallback audioMaster) : C = 0.0; iirSampleA = 0.0; iirSampleB = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = false; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/StereoFX/StereoFX.h b/plugins/WinVST/StereoFX/StereoFX.h index 7a3605921..04d34a587 100755 --- a/plugins/WinVST/StereoFX/StereoFX.h +++ b/plugins/WinVST/StereoFX/StereoFX.h @@ -56,8 +56,8 @@ private: double iirSampleA; double iirSampleB; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; //default stuff diff --git a/plugins/WinVST/StereoFX/StereoFXProc.cpp b/plugins/WinVST/StereoFX/StereoFXProc.cpp index 0e9de7478..0c3ae4962 100755 --- a/plugins/WinVST/StereoFX/StereoFXProc.cpp +++ b/plugins/WinVST/StereoFX/StereoFXProc.cpp @@ -17,10 +17,10 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -40,44 +40,8 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -135,14 +99,14 @@ void StereoFX::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -164,10 +128,10 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double mid; - long double side; + double inputSampleL; + double inputSampleR; + double mid; + double side; //High Impact section double stereowide = A; double centersquish = C; @@ -187,44 +151,8 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; //assign working variables mid = inputSampleL + inputSampleR; side = inputSampleL - inputSampleR; @@ -282,16 +210,14 @@ void StereoFX::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/StudioTan/StudioTan.h b/plugins/WinVST/StudioTan/StudioTan.h index 66caf4866..9e17ad768 100755 --- a/plugins/WinVST/StudioTan/StudioTan.h +++ b/plugins/WinVST/StudioTan/StudioTan.h @@ -52,15 +52,15 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double bynL[13]; - long double noiseShapingL; - long double lastSampleL; - long double lastSample2L; + double bynL[13]; + double noiseShapingL; + double lastSampleL; + double lastSample2L; - long double bynR[13]; - long double noiseShapingR; - long double lastSampleR; - long double lastSample2R; + double bynR[13]; + double noiseShapingR; + double lastSampleR; + double lastSample2R; float A; diff --git a/plugins/WinVST/StudioTan/StudioTanProc.cpp b/plugins/WinVST/StudioTan/StudioTanProc.cpp index 3258f7b4f..de2418d10 100755 --- a/plugins/WinVST/StudioTan/StudioTanProc.cpp +++ b/plugins/WinVST/StudioTan/StudioTanProc.cpp @@ -30,12 +30,12 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -54,7 +54,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -66,7 +66,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -93,7 +93,7 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -252,11 +252,11 @@ void StudioTan::processReplacing(float **inputs, float **outputs, VstInt32 sampl } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; @@ -308,12 +308,12 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL; - long double outputSampleL; - long double drySampleL; - long double inputSampleR; - long double outputSampleR; - long double drySampleR; + double inputSampleL; + double outputSampleL; + double drySampleL; + double inputSampleR; + double outputSampleR; + double drySampleR; if (highres) { inputSampleL = *in1 * 8388608.0; @@ -332,7 +332,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR -= noiseShapingR; cutbins = false; - long double benfordize; //we get to re-use this for each channel + double benfordize; //we get to re-use this for each channel //begin left channel NJAD benfordize = floor(inputSampleL); @@ -344,7 +344,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinA = floor(benfordize); //hotbin becomes the Benford bin value for this number floored - long double totalA = 0; + double totalA = 0; if ((hotbinA > 0) && (hotbinA < 10)) { bynL[hotbinA] += 1; @@ -371,7 +371,7 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt if (benfordize < 1.0) {benfordize *= 10;} int hotbinB = floor(benfordize); //hotbin becomes the Benford bin value for this number ceiled - long double totalB = 0; + double totalB = 0; if ((hotbinB > 0) && (hotbinB < 10)) { bynL[hotbinB] += 1; @@ -530,11 +530,11 @@ void StudioTan::processDoubleReplacing(double **inputs, double **outputs, VstInt } //shared output stage - long double noiseSuppressL = fabs(inputSampleL); + double noiseSuppressL = fabs(inputSampleL); if (noiseShapingL > noiseSuppressL) noiseShapingL = noiseSuppressL; if (noiseShapingL < -noiseSuppressL) noiseShapingL = -noiseSuppressL; - long double noiseSuppressR = fabs(inputSampleR); + double noiseSuppressR = fabs(inputSampleR); if (noiseShapingR > noiseSuppressR) noiseShapingR = noiseSuppressR; if (noiseShapingR < -noiseSuppressR) noiseShapingR = -noiseSuppressR; diff --git a/plugins/WinVST/SubsOnly/SubsOnlyProc.cpp b/plugins/WinVST/SubsOnly/SubsOnlyProc.cpp index 23e79231f..3a7df87a0 100755 --- a/plugins/WinVST/SubsOnly/SubsOnlyProc.cpp +++ b/plugins/WinVST/SubsOnly/SubsOnlyProc.cpp @@ -22,51 +22,15 @@ void SubsOnly::processReplacing(float **inputs, float **outputs, VstInt32 sample double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; @@ -306,51 +270,15 @@ void SubsOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double gain; iirAmount /= overallscale; double altAmount = 1.0 - iirAmount; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; gain = gaintarget; diff --git a/plugins/WinVST/Surge/Surge.cpp b/plugins/WinVST/Surge/Surge.cpp index 222fbcf96..e330af883 100755 --- a/plugins/WinVST/Surge/Surge.cpp +++ b/plugins/WinVST/Surge/Surge.cpp @@ -12,8 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new S Surge::Surge(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/WinVST/Surge/Surge.h b/plugins/WinVST/Surge/Surge.h index 7f42c9f74..18d47a94a 100755 --- a/plugins/WinVST/Surge/Surge.h +++ b/plugins/WinVST/Surge/Surge.h @@ -53,14 +53,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; - long double chaseD; - long double chaseMax; + double chaseA; + double chaseB; + double chaseC; + double chaseD; + double chaseMax; float A; float B; diff --git a/plugins/WinVST/Surge/SurgeProc.cpp b/plugins/WinVST/Surge/SurgeProc.cpp index cd82badfb..53cac6996 100755 --- a/plugins/WinVST/Surge/SurgeProc.cpp +++ b/plugins/WinVST/Surge/SurgeProc.cpp @@ -18,10 +18,10 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -36,44 +36,8 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -117,14 +81,14 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -147,10 +111,10 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double chaseMax = 0.0; double intensity = (1.0-(pow((1.0-A),2)))*0.7; @@ -164,44 +128,8 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -245,16 +173,14 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/SurgeTide/SurgeTide.cpp b/plugins/WinVST/SurgeTide/SurgeTide.cpp index 494e886b8..ba28ed38f 100755 --- a/plugins/WinVST/SurgeTide/SurgeTide.cpp +++ b/plugins/WinVST/SurgeTide/SurgeTide.cpp @@ -15,8 +15,8 @@ SurgeTide::SurgeTide(audioMasterCallback audioMaster) : A = 0.5; B = 0.3; C = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; chaseA = 0.0; chaseB = 0.0; diff --git a/plugins/WinVST/SurgeTide/SurgeTide.h b/plugins/WinVST/SurgeTide/SurgeTide.h index 8f8cd4241..f6a2b7cbf 100755 --- a/plugins/WinVST/SurgeTide/SurgeTide.h +++ b/plugins/WinVST/SurgeTide/SurgeTide.h @@ -54,12 +54,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; - long double chaseA; - long double chaseB; - long double chaseC; + double chaseA; + double chaseB; + double chaseC; float A; float B; diff --git a/plugins/WinVST/SurgeTide/SurgeTideProc.cpp b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp index 59a92aa02..ea08259c9 100755 --- a/plugins/WinVST/SurgeTide/SurgeTideProc.cpp +++ b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp @@ -18,10 +18,10 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -34,44 +34,8 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -107,14 +71,14 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -137,10 +101,10 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; double intensity = A; double attack = ((B+0.1)*0.0005)/overallscale; @@ -153,44 +117,8 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -226,16 +154,14 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = drySampleR - (inputSampleR * intensity); inputSampleR = (drySampleR * dry) + (inputSampleR * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Swell/Swell.cpp b/plugins/WinVST/Swell/Swell.cpp index e197cfb5f..f1b5da9a3 100755 --- a/plugins/WinVST/Swell/Swell.cpp +++ b/plugins/WinVST/Swell/Swell.cpp @@ -21,8 +21,8 @@ Swell::Swell(audioMasterCallback audioMaster) : louderL = false; louderR = false; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Swell/Swell.h b/plugins/WinVST/Swell/Swell.h index 7c108b728..1acfaf86c 100755 --- a/plugins/WinVST/Swell/Swell.h +++ b/plugins/WinVST/Swell/Swell.h @@ -54,13 +54,13 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff - long double swellL; - long double swellR; + double swellL; + double swellR; bool louderL; bool louderR; diff --git a/plugins/WinVST/Swell/SwellProc.cpp b/plugins/WinVST/Swell/SwellProc.cpp index 3ab1e9b43..447613b50 100755 --- a/plugins/WinVST/Swell/SwellProc.cpp +++ b/plugins/WinVST/Swell/SwellProc.cpp @@ -25,53 +25,17 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -94,14 +58,14 @@ void Swell::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -131,53 +95,17 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s double wet = C; double dry = 1.0 - wet; - long double drySampleL; - long double drySampleR; - long double inputSampleL; - long double inputSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -200,16 +128,14 @@ void Swell::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp b/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp index 865cd643d..e51504299 100755 --- a/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp +++ b/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp @@ -28,8 +28,8 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -86,8 +86,8 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/TPDFWide/TPDFWideProc.cpp b/plugins/WinVST/TPDFWide/TPDFWideProc.cpp index 810a8ebac..45b831dac 100644 --- a/plugins/WinVST/TPDFWide/TPDFWideProc.cpp +++ b/plugins/WinVST/TPDFWide/TPDFWideProc.cpp @@ -28,8 +28,8 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -39,12 +39,12 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises @@ -104,8 +104,8 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; @@ -115,12 +115,12 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - long double ditherL = -1.0; + double ditherL = -1.0; ditherL += (rand()/(double)RAND_MAX); ditherL += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises - long double ditherR = -1.0; + double ditherR = -1.0; ditherR += (rand()/(double)RAND_MAX); ditherR += (rand()/(double)RAND_MAX); //TPDF: two 0-1 random noises diff --git a/plugins/WinVST/Tape/Tape.h b/plugins/WinVST/Tape/Tape.h index 932247bac..1ab35bd88 100755 --- a/plugins/WinVST/Tape/Tape.h +++ b/plugins/WinVST/Tape/Tape.h @@ -63,19 +63,19 @@ private: double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/Tape/TapeProc.cpp b/plugins/WinVST/Tape/TapeProc.cpp index 961a1c1e4..4d498b2cd 100755 --- a/plugins/WinVST/Tape/TapeProc.cpp +++ b/plugins/WinVST/Tape/TapeProc.cpp @@ -45,18 +45,18 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -158,15 +158,15 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain != 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -324,8 +324,8 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -334,14 +334,14 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleR *= inputgain; } //gain cut before anything, even dry - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -443,15 +443,15 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } flip = !flip; - long double groundSampleL = drySampleL - inputSampleL; //set up UnBox - long double groundSampleR = drySampleR - inputSampleR; //set up UnBox + double groundSampleL = drySampleL - inputSampleL; //set up UnBox + double groundSampleR = drySampleR - inputSampleR; //set up UnBox if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } //gain boost inside UnBox: do not boost fringe audio - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; diff --git a/plugins/WinVST/TapeDelay/TapeDelay.cpp b/plugins/WinVST/TapeDelay/TapeDelay.cpp index f7690dbd9..345f06d58 100755 --- a/plugins/WinVST/TapeDelay/TapeDelay.cpp +++ b/plugins/WinVST/TapeDelay/TapeDelay.cpp @@ -26,8 +26,8 @@ TapeDelay::TapeDelay(audioMasterCallback audioMaster) : gcount = 0; chase = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TapeDelay/TapeDelay.h b/plugins/WinVST/TapeDelay/TapeDelay.h index f5fcb6ce3..d1708fa60 100755 --- a/plugins/WinVST/TapeDelay/TapeDelay.h +++ b/plugins/WinVST/TapeDelay/TapeDelay.h @@ -66,8 +66,8 @@ private: int maxdelay; int chase; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TapeDelay/TapeDelayProc.cpp b/plugins/WinVST/TapeDelay/TapeDelayProc.cpp index e2f1ade22..ef32867b9 100755 --- a/plugins/WinVST/TapeDelay/TapeDelayProc.cpp +++ b/plugins/WinVST/TapeDelay/TapeDelayProc.cpp @@ -35,8 +35,8 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -156,14 +156,14 @@ void TapeDelay::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -202,8 +202,8 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -323,16 +323,14 @@ void TapeDelay::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = (inputSampleL * dry) + (dL[delay] * wet); inputSampleR = (inputSampleR * dry) + (dR[delay] * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TapeDelay2/TapeDelay2.h b/plugins/WinVST/TapeDelay2/TapeDelay2.h index 5f9d9e7a3..178d356fb 100644 --- a/plugins/WinVST/TapeDelay2/TapeDelay2.h +++ b/plugins/WinVST/TapeDelay2/TapeDelay2.h @@ -62,16 +62,16 @@ private: double prevSampleL; double delayL; double sweepL; - long double regenFilterL[9]; - long double outFilterL[9]; + double regenFilterL[9]; + double outFilterL[9]; double lastRefL[10]; double dR[88211]; double prevSampleR; double delayR; double sweepR; - long double regenFilterR[9]; - long double outFilterR[9]; + double regenFilterR[9]; + double outFilterR[9]; double lastRefR[10]; int cycle; diff --git a/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp b/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp index 3fbb9d938..a6b4e4b2d 100644 --- a/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp +++ b/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp @@ -62,12 +62,12 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -79,7 +79,7 @@ void TapeDelay2::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -266,12 +266,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; cycle++; if (cycle == cycleEnd) { @@ -283,7 +283,7 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //begin left channel int pos = floor(delayL); double newSample = inputSampleL + dL[pos]*feedback; - long double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; + double tempSample = (newSample * regenFilterL[2]) + regenFilterL[7]; regenFilterL[7] = -(tempSample * regenFilterL[5]) + regenFilterL[8]; regenFilterL[8] = (newSample * regenFilterL[4]) - (tempSample * regenFilterL[6]); newSample = tempSample; @@ -397,12 +397,12 @@ void TapeDelay2::processDoubleReplacing(double **inputs, double **outputs, VstIn //purpose is that, if you're adding echo, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/TapeDither/TapeDitherProc.cpp b/plugins/WinVST/TapeDither/TapeDitherProc.cpp index 9011c04d9..4bf9003fd 100755 --- a/plugins/WinVST/TapeDither/TapeDitherProc.cpp +++ b/plugins/WinVST/TapeDither/TapeDitherProc.cpp @@ -30,8 +30,8 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -99,8 +99,8 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/TapeDust/TapeDust.cpp b/plugins/WinVST/TapeDust/TapeDust.cpp index 0ce16e093..11ff21768 100755 --- a/plugins/WinVST/TapeDust/TapeDust.cpp +++ b/plugins/WinVST/TapeDust/TapeDust.cpp @@ -22,8 +22,8 @@ TapeDust::TapeDust(audioMasterCallback audioMaster) : fR[count] = 0.0; } - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/TapeDust/TapeDust.h b/plugins/WinVST/TapeDust/TapeDust.h index facbf408f..4918fdcb3 100755 --- a/plugins/WinVST/TapeDust/TapeDust.h +++ b/plugins/WinVST/TapeDust/TapeDust.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool fpFlip; //default stuff diff --git a/plugins/WinVST/TapeDust/TapeDustProc.cpp b/plugins/WinVST/TapeDust/TapeDustProc.cpp index 429a3667f..9d7aceff9 100755 --- a/plugins/WinVST/TapeDust/TapeDustProc.cpp +++ b/plugins/WinVST/TapeDust/TapeDustProc.cpp @@ -13,8 +13,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -32,44 +32,8 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -118,14 +82,14 @@ void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -143,8 +107,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double* in2 = inputs[1]; double* out1 = outputs[0]; double* out2 = outputs[1]; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; @@ -162,44 +126,8 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -248,16 +176,14 @@ void TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TapeFat/TapeFat.cpp b/plugins/WinVST/TapeFat/TapeFat.cpp index 26478dfe6..bcb1927b5 100755 --- a/plugins/WinVST/TapeFat/TapeFat.cpp +++ b/plugins/WinVST/TapeFat/TapeFat.cpp @@ -18,8 +18,8 @@ TapeFat::TapeFat(audioMasterCallback audioMaster) : for(int count = 0; count < 257; count++) {pL[count] = 0;pR[count] = 0;} gcount = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TapeFat/TapeFat.h b/plugins/WinVST/TapeFat/TapeFat.h index 614ee47ff..0ce30222f 100755 --- a/plugins/WinVST/TapeFat/TapeFat.h +++ b/plugins/WinVST/TapeFat/TapeFat.h @@ -57,8 +57,8 @@ private: int pR[258]; int gcount; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TapeFat/TapeFatProc.cpp b/plugins/WinVST/TapeFat/TapeFatProc.cpp index 8eb0e98e9..7d0e52a57 100755 --- a/plugins/WinVST/TapeFat/TapeFatProc.cpp +++ b/plugins/WinVST/TapeFat/TapeFatProc.cpp @@ -25,8 +25,8 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -119,14 +119,14 @@ void TapeFat::processReplacing(float **inputs, float **outputs, VstInt32 sampleF gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -156,8 +156,8 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -250,16 +250,14 @@ void TapeFat::processDoubleReplacing(double **inputs, double **outputs, VstInt32 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Thunder/Thunder.cpp b/plugins/WinVST/Thunder/Thunder.cpp index 7bc8226ab..b206dace5 100755 --- a/plugins/WinVST/Thunder/Thunder.cpp +++ b/plugins/WinVST/Thunder/Thunder.cpp @@ -15,8 +15,8 @@ Thunder::Thunder(audioMasterCallback audioMaster) : A = 0.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedA = 10000; muSpeedB = 10000; muCoefficientA = 1; diff --git a/plugins/WinVST/Thunder/Thunder.h b/plugins/WinVST/Thunder/Thunder.h index 9e49054f5..fc8bf411e 100755 --- a/plugins/WinVST/Thunder/Thunder.h +++ b/plugins/WinVST/Thunder/Thunder.h @@ -69,8 +69,8 @@ private: double iirSampleAM; double iirSampleBM; double iirSampleCM; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; bool flip; float A; diff --git a/plugins/WinVST/Thunder/ThunderProc.cpp b/plugins/WinVST/Thunder/ThunderProc.cpp index 2cf454d35..ce6b41c13 100755 --- a/plugins/WinVST/Thunder/ThunderProc.cpp +++ b/plugins/WinVST/Thunder/ThunderProc.cpp @@ -40,51 +40,15 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -222,14 +186,14 @@ void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= outputGain; } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -275,51 +239,15 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double resultML; double resultMR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL = inputSampleL * muMakeupGain; inputSampleR = inputSampleR * muMakeupGain; @@ -457,16 +385,14 @@ void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= outputGain; } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ToTape5/ToTape5.cpp b/plugins/WinVST/ToTape5/ToTape5.cpp index 6136aafb5..509c70874 100755 --- a/plugins/WinVST/ToTape5/ToTape5.cpp +++ b/plugins/WinVST/ToTape5/ToTape5.cpp @@ -98,8 +98,8 @@ ToTape5::ToTape5(audioMasterCallback audioMaster) : hcount = 0; flip = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ToTape5/ToTape5.h b/plugins/WinVST/ToTape5/ToTape5.h index d049014d6..b35426a07 100755 --- a/plugins/WinVST/ToTape5/ToTape5.h +++ b/plugins/WinVST/ToTape5/ToTape5.h @@ -140,8 +140,8 @@ private: double iirSampleZR; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ToTape5/ToTape5Proc.cpp b/plugins/WinVST/ToTape5/ToTape5Proc.cpp index 5824f8030..3db88a2ec 100755 --- a/plugins/WinVST/ToTape5/ToTape5Proc.cpp +++ b/plugins/WinVST/ToTape5/ToTape5Proc.cpp @@ -17,7 +17,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -63,52 +63,16 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -355,14 +319,14 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -384,7 +348,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - long double fpOld = 0.618033988749894848204586; //golden ratio! + double fpOld = 0.618033988749894848204586; //golden ratio! double inputgain = pow(A+1.0,3); double outputgain = E; double wet = F; @@ -429,51 +393,15 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifierR; double tempSampleR; double drySampleR; - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -720,16 +648,14 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ToTape6/ToTape6.h b/plugins/WinVST/ToTape6/ToTape6.h index fba651fd1..a613c4812 100755 --- a/plugins/WinVST/ToTape6/ToTape6.h +++ b/plugins/WinVST/ToTape6/ToTape6.h @@ -73,19 +73,19 @@ private: double iirMidRollerBR; double iirHeadBumpAR; double iirHeadBumpBR; - long double biquadAL[9]; - long double biquadBL[9]; - long double biquadCL[9]; - long double biquadDL[9]; + double biquadAL[9]; + double biquadBL[9]; + double biquadCL[9]; + double biquadDL[9]; - long double biquadAR[9]; - long double biquadBR[9]; - long double biquadCR[9]; - long double biquadDR[9]; + double biquadAR[9]; + double biquadBR[9]; + double biquadCR[9]; + double biquadDR[9]; bool flip; - long double lastSampleL; - long double lastSampleR; + double lastSampleL; + double lastSampleR; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/ToTape6/ToTape6Proc.cpp b/plugins/WinVST/ToTape6/ToTape6Proc.cpp index 1b4ff7de7..49e72323b 100755 --- a/plugins/WinVST/ToTape6/ToTape6Proc.cpp +++ b/plugins/WinVST/ToTape6/ToTape6Proc.cpp @@ -54,12 +54,12 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -74,7 +74,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -93,13 +93,13 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -201,15 +201,15 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -241,7 +241,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding @@ -388,12 +388,12 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (inputgain < 1.0) { inputSampleL *= inputgain; @@ -408,7 +408,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 int count = gcount; if (depth != 0.0) { - long double offset = depth + (depth * pow(rateof,2) * sin(sweep)); + double offset = depth + (depth * pow(rateof,2) * sin(sweep)); count += (int)floor(offset); inputSampleL = (dL[count-((count > 499)?500:0)] * (1-(offset-floor(offset))) ); @@ -427,13 +427,13 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } gcount--; - long double vibDrySampleL = inputSampleL; - long double vibDrySampleR = inputSampleR; - long double HighsSampleL = 0.0; - long double HighsSampleR = 0.0; - long double NonHighsSampleL = 0.0; - long double NonHighsSampleR = 0.0; - long double tempSample; + double vibDrySampleL = inputSampleL; + double vibDrySampleR = inputSampleR; + double HighsSampleL = 0.0; + double HighsSampleR = 0.0; + double NonHighsSampleL = 0.0; + double NonHighsSampleR = 0.0; + double tempSample; if (flip) { @@ -535,15 +535,15 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } flip = !flip; - long double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio - long double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio + double groundSampleL = vibDrySampleL - inputSampleL; //set up UnBox on fluttered audio + double groundSampleR = vibDrySampleR - inputSampleR; //set up UnBox on fluttered audio if (inputgain > 1.0) { inputSampleL *= inputgain; inputSampleR *= inputgain; } - long double applySoften = fabs(HighsSampleL)*1.57079633; + double applySoften = fabs(HighsSampleL)*1.57079633; if (applySoften > 1.57079633) applySoften = 1.57079633; applySoften = 1-cos(applySoften); if (HighsSampleL > 0) inputSampleL -= applySoften; @@ -575,7 +575,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; - long double mojo; mojo = pow(fabs(inputSampleL),0.25); + double mojo; mojo = pow(fabs(inputSampleL),0.25); if (mojo > 0.0) inputSampleL = (sin(inputSampleL * mojo * M_PI * 0.5) / mojo); //mojo is the one that flattens WAAAAY out very softly before wavefolding diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4.cpp b/plugins/WinVST/ToVinyl4/ToVinyl4.cpp index 429187cf3..3d46fd518 100755 --- a/plugins/WinVST/ToVinyl4/ToVinyl4.cpp +++ b/plugins/WinVST/ToVinyl4/ToVinyl4.cpp @@ -87,8 +87,8 @@ ToVinyl4::ToVinyl4(audioMasterCallback audioMaster) : B = 0.3424051; //44.0 hz = ((B*B)*290)+10 (B*B)*290 = 34 (B*B) = 0.1172413 sqrt() = 0.3424051 C = 0.32; D = 0.064; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4.h b/plugins/WinVST/ToVinyl4/ToVinyl4.h index 6a2dc26ed..d1a7363eb 100755 --- a/plugins/WinVST/ToVinyl4/ToVinyl4.h +++ b/plugins/WinVST/ToVinyl4/ToVinyl4.h @@ -142,8 +142,8 @@ private: double bMidPrev; double bSidePrev; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp b/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp index a67af995f..1bb4c1841 100755 --- a/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp +++ b/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp @@ -217,44 +217,8 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -461,14 +425,14 @@ void ToVinyl4::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -689,44 +653,8 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; s3L = s2L; s2L = s1L; @@ -933,16 +861,14 @@ void ToVinyl4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR = accumulatorSample; //we just re-use accumulatorSample to do this little shuffle - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ToneSlant/ToneSlant.cpp b/plugins/WinVST/ToneSlant/ToneSlant.cpp index d99fa60a7..6bc494340 100755 --- a/plugins/WinVST/ToneSlant/ToneSlant.cpp +++ b/plugins/WinVST/ToneSlant/ToneSlant.cpp @@ -15,8 +15,8 @@ ToneSlant::ToneSlant(audioMasterCallback audioMaster) : A = 0.0; B = 0.0; for(int count = 0; count < 102; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ToneSlant/ToneSlant.h b/plugins/WinVST/ToneSlant/ToneSlant.h index 7c52bca20..ca55bbf14 100755 --- a/plugins/WinVST/ToneSlant/ToneSlant.h +++ b/plugins/WinVST/ToneSlant/ToneSlant.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ToneSlant/ToneSlantProc.cpp b/plugins/WinVST/ToneSlant/ToneSlantProc.cpp index d78cfb574..7397d8aa4 100755 --- a/plugins/WinVST/ToneSlant/ToneSlantProc.cpp +++ b/plugins/WinVST/ToneSlant/ToneSlantProc.cpp @@ -48,44 +48,8 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -106,14 +70,14 @@ void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -165,44 +129,8 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; bL[0] = accumulatorSampleL = drySampleL = inputSampleL; bR[0] = accumulatorSampleR = drySampleR = inputSampleR; @@ -223,16 +151,14 @@ void ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (correctionSampleR * applySlant); //our one math operation on the input data coming in - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TransDesk/TransDesk.cpp b/plugins/WinVST/TransDesk/TransDesk.cpp index 3f352f7fe..d26434509 100755 --- a/plugins/WinVST/TransDesk/TransDesk.cpp +++ b/plugins/WinVST/TransDesk/TransDesk.cpp @@ -25,8 +25,8 @@ TransDesk::TransDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TransDesk/TransDesk.h b/plugins/WinVST/TransDesk/TransDesk.h index 5729b4c4e..4657525a2 100755 --- a/plugins/WinVST/TransDesk/TransDesk.h +++ b/plugins/WinVST/TransDesk/TransDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[20]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[20]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/WinVST/TransDesk/TransDeskProc.cpp b/plugins/WinVST/TransDesk/TransDeskProc.cpp index c8b45c2d5..9768c73fb 100755 --- a/plugins/WinVST/TransDesk/TransDeskProc.cpp +++ b/plugins/WinVST/TransDesk/TransDeskProc.cpp @@ -40,53 +40,17 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -197,14 +161,14 @@ void TransDesk::processReplacing(float **inputs, float **outputs, VstInt32 sampl gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -249,53 +213,17 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -406,16 +334,14 @@ void TransDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TremoSquare/TremoSquareProc.cpp b/plugins/WinVST/TremoSquare/TremoSquareProc.cpp index ef99feb16..1c627a8e6 100755 --- a/plugins/WinVST/TremoSquare/TremoSquareProc.cpp +++ b/plugins/WinVST/TremoSquare/TremoSquareProc.cpp @@ -23,12 +23,12 @@ void TremoSquare::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code @@ -92,12 +92,12 @@ void TremoSquare::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; osc += increment; if (osc > 1.0) osc = 0.0; //this is our little oscillator code diff --git a/plugins/WinVST/Tremolo/Tremolo.cpp b/plugins/WinVST/Tremolo/Tremolo.cpp index f0b649d78..b57f9ec20 100755 --- a/plugins/WinVST/Tremolo/Tremolo.cpp +++ b/plugins/WinVST/Tremolo/Tremolo.cpp @@ -21,8 +21,8 @@ Tremolo::Tremolo(audioMasterCallback audioMaster) : depthAmount = 0.0; lastSpeed = 1000.0; lastDepth = 1000.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Tremolo/Tremolo.h b/plugins/WinVST/Tremolo/Tremolo.h index 11fc718fb..1f1d00675 100755 --- a/plugins/WinVST/Tremolo/Tremolo.h +++ b/plugins/WinVST/Tremolo/Tremolo.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double sweep; diff --git a/plugins/WinVST/Tremolo/TremoloProc.cpp b/plugins/WinVST/Tremolo/TremoloProc.cpp index d27dc86c7..e63f0b044 100755 --- a/plugins/WinVST/Tremolo/TremoloProc.cpp +++ b/plugins/WinVST/Tremolo/TremoloProc.cpp @@ -38,53 +38,17 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -148,14 +112,14 @@ void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -198,53 +162,17 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double bridgerectifier; double offset; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -309,16 +237,14 @@ void Tremolo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); //end R - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TripleSpread/TripleSpreadProc.cpp b/plugins/WinVST/TripleSpread/TripleSpreadProc.cpp index 09b8dd534..6bd70e790 100755 --- a/plugins/WinVST/TripleSpread/TripleSpreadProc.cpp +++ b/plugins/WinVST/TripleSpread/TripleSpreadProc.cpp @@ -21,12 +21,12 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -291,8 +291,8 @@ void TripleSpread::processReplacing(float **inputs, float **outputs, VstInt32 sa thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; @@ -340,12 +340,12 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; airFactorL = airPrevL - inputSampleL; if (flip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} @@ -610,8 +610,8 @@ void TripleSpread::processDoubleReplacing(double **inputs, double **outputs, Vst thirdtempR = lasttempR; lasttempR = tempR; - long double mid = (inputSampleL + inputSampleR)*(1-wet); - long double side = inputSampleL - inputSampleR; + double mid = (inputSampleL + inputSampleR)*(1-wet); + double side = inputSampleL - inputSampleR; //assign mid and side.Between these sections, you can do mid/side processing inputSampleL = (mid+side)/2.0; inputSampleR = (mid-side)/2.0; diff --git a/plugins/WinVST/Tube/Tube.h b/plugins/WinVST/Tube/Tube.h index d44d0e3ab..c423e2802 100644 --- a/plugins/WinVST/Tube/Tube.h +++ b/plugins/WinVST/Tube/Tube.h @@ -52,10 +52,10 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Tube/TubeProc.cpp b/plugins/WinVST/Tube/TubeProc.cpp index 8952b4238..068a6ea5e 100644 --- a/plugins/WinVST/Tube/TubeProc.cpp +++ b/plugins/WinVST/Tube/TubeProc.cpp @@ -33,13 +33,13 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -87,7 +87,7 @@ void Tube::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -138,13 +138,13 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -192,19 +192,19 @@ void Tube::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa */ if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; } //for high sample rates on this plugin we are going to do a simple average //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Tube2/Tube2.h b/plugins/WinVST/Tube2/Tube2.h index 24f7f73cd..80bfcc84b 100644 --- a/plugins/WinVST/Tube2/Tube2.h +++ b/plugins/WinVST/Tube2/Tube2.h @@ -53,12 +53,12 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double previousSampleA; - long double previousSampleB; - long double previousSampleC; - long double previousSampleD; - long double previousSampleE; - long double previousSampleF; + double previousSampleA; + double previousSampleB; + double previousSampleC; + double previousSampleD; + double previousSampleE; + double previousSampleF; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/Tube2/Tube2Proc.cpp b/plugins/WinVST/Tube2/Tube2Proc.cpp index 33dc4d827..e3c528b96 100644 --- a/plugins/WinVST/Tube2/Tube2Proc.cpp +++ b/plugins/WinVST/Tube2/Tube2Proc.cpp @@ -27,10 +27,10 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -38,7 +38,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -51,7 +51,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -84,7 +84,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -92,9 +92,9 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -107,7 +107,7 @@ void Tube2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -158,10 +158,10 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (inputPad < 1.0) { inputSampleL *= inputPad; @@ -169,7 +169,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleA; previousSampleA = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleB; previousSampleB = stored; inputSampleR *= 0.5; @@ -182,7 +182,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //flatten bottom, point top of sine waveshaper L inputSampleL /= asymPad; - long double sharpen = -inputSampleL; + double sharpen = -inputSampleL; if (sharpen > 0.0) sharpen = 1.0+sqrt(sharpen); else sharpen = 1.0-sqrt(-sharpen); inputSampleL -= inputSampleL*fabs(inputSampleL)*sharpen*0.25; @@ -215,7 +215,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR *= outputscaling; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleC; previousSampleC = stored; inputSampleL *= 0.5; stored = inputSampleR; inputSampleR += previousSampleD; previousSampleD = stored; inputSampleR *= 0.5; @@ -223,9 +223,9 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end original Tube. Now we have a boosted fat sound peaking at 0dB exactly //hysteresis and spiky fuzz L - long double slew = previousSampleE - inputSampleL; + double slew = previousSampleE - inputSampleL; if (overallscale > 1.9) { - long double stored = inputSampleL; + double stored = inputSampleL; inputSampleL += previousSampleE; previousSampleE = stored; inputSampleL *= 0.5; } else previousSampleE = inputSampleL; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -238,7 +238,7 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //hysteresis and spiky fuzz R slew = previousSampleF - inputSampleR; if (overallscale > 1.9) { - long double stored = inputSampleR; + double stored = inputSampleR; inputSampleR += previousSampleF; previousSampleF = stored; inputSampleR *= 0.5; } else previousSampleF = inputSampleR; //for this, need previousSampleC always if (slew > 0.0) slew = 1.0+(sqrt(slew)*0.5); @@ -251,12 +251,12 @@ void Tube2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s //end hysteresis and spiky fuzz section //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/TubeDesk/TubeDesk.cpp b/plugins/WinVST/TubeDesk/TubeDesk.cpp index 5a7465c3b..5a42bb4aa 100755 --- a/plugins/WinVST/TubeDesk/TubeDesk.cpp +++ b/plugins/WinVST/TubeDesk/TubeDesk.cpp @@ -25,8 +25,8 @@ TubeDesk::TubeDesk(audioMasterCallback audioMaster) : lastOutSampleR = 0.0; lastSlewR = 0.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TubeDesk/TubeDesk.h b/plugins/WinVST/TubeDesk/TubeDesk.h index fb15768fb..7ef3e35be 100755 --- a/plugins/WinVST/TubeDesk/TubeDesk.h +++ b/plugins/WinVST/TubeDesk/TubeDesk.h @@ -51,21 +51,21 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; double dL[5000]; double controlL; - long double lastSampleL; - long double lastOutSampleL; + double lastSampleL; + double lastOutSampleL; double lastSlewL; double dR[5000]; double controlR; - long double lastSampleR; - long double lastOutSampleR; + double lastSampleR; + double lastOutSampleR; double lastSlewR; }; diff --git a/plugins/WinVST/TubeDesk/TubeDeskProc.cpp b/plugins/WinVST/TubeDesk/TubeDeskProc.cpp index cccf6e2cc..72b8fe2c7 100755 --- a/plugins/WinVST/TubeDesk/TubeDeskProc.cpp +++ b/plugins/WinVST/TubeDesk/TubeDeskProc.cpp @@ -39,53 +39,17 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -196,14 +160,14 @@ void TubeDesk::processReplacing(float **inputs, float **outputs, VstInt32 sample gcount--; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -247,53 +211,17 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double bridgerectifier; double combSample; - long double inputSampleL; - long double inputSampleR; - long double drySampleL; - long double drySampleR; + double inputSampleL; + double inputSampleR; + double drySampleL; + double drySampleR; while (--sampleFrames >= 0) { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; @@ -404,16 +332,14 @@ void TubeDesk::processDoubleReplacing(double **inputs, double **outputs, VstInt3 gcount--; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/UltrasonX/UltrasonX.h b/plugins/WinVST/UltrasonX/UltrasonX.h index 439c12866..dccd0df88 100644 --- a/plugins/WinVST/UltrasonX/UltrasonX.h +++ b/plugins/WinVST/UltrasonX/UltrasonX.h @@ -66,7 +66,7 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; + double fixA[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/UltrasonX/UltrasonXProc.cpp b/plugins/WinVST/UltrasonX/UltrasonXProc.cpp index 8a0955704..09a93d0a6 100644 --- a/plugins/WinVST/UltrasonX/UltrasonXProc.cpp +++ b/plugins/WinVST/UltrasonX/UltrasonXProc.cpp @@ -34,8 +34,8 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -45,12 +45,12 @@ void UltrasonX::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -105,8 +105,8 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt break; } - long double K = tan(M_PI * fixA[fix_freq]); - long double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); + double K = tan(M_PI * fixA[fix_freq]); + double norm = 1.0 / (1.0 + K / fixA[fix_reso] + K * K); fixA[fix_a0] = K * K * norm; fixA[fix_a1] = 2.0 * fixA[fix_a0]; fixA[fix_a2] = fixA[fix_a0]; @@ -116,12 +116,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; + double temp = (inputSampleL * fixA[fix_a0]) + fixA[fix_sL1]; fixA[fix_sL1] = (inputSampleL * fixA[fix_a1]) - (temp * fixA[fix_b1]) + fixA[fix_sL2]; fixA[fix_sL2] = (inputSampleL * fixA[fix_a2]) - (temp * fixA[fix_b2]); inputSampleL = temp; //fixed biquad filtering ultrasonics @@ -131,12 +131,12 @@ void UltrasonX::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR = temp; //fixed biquad filtering ultrasonics //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Ultrasonic/Ultrasonic.h b/plugins/WinVST/Ultrasonic/Ultrasonic.h index 929c3c8aa..f853b70e2 100755 --- a/plugins/WinVST/Ultrasonic/Ultrasonic.h +++ b/plugins/WinVST/Ultrasonic/Ultrasonic.h @@ -51,11 +51,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; //note that this stereo form doesn't require L and R forms! + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; //note that this stereo form doesn't require L and R forms! //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. diff --git a/plugins/WinVST/Ultrasonic/UltrasonicProc.cpp b/plugins/WinVST/Ultrasonic/UltrasonicProc.cpp index 7049da762..0bb52e5e0 100755 --- a/plugins/WinVST/Ultrasonic/UltrasonicProc.cpp +++ b/plugins/WinVST/Ultrasonic/UltrasonicProc.cpp @@ -63,12 +63,12 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -83,7 +83,7 @@ void Ultrasonic::processReplacing(float **inputs, float **outputs, VstInt32 samp outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -173,12 +173,12 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; @@ -193,7 +193,7 @@ void Ultrasonic::processDoubleReplacing(double **inputs, double **outputs, VstIn outSampleL = biquadE[2]*inputSampleL+biquadE[3]*biquadE[7]+biquadE[4]*biquadE[8]-biquadE[5]*biquadE[9]-biquadE[6]*biquadE[10]; biquadE[8] = biquadE[7]; biquadE[7] = inputSampleL; inputSampleL = outSampleL; biquadE[10] = biquadE[9]; biquadE[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/WinVST/UltrasonicLite/UltrasonicLite.h b/plugins/WinVST/UltrasonicLite/UltrasonicLite.h index 73fb675ad..59fd77310 100644 --- a/plugins/WinVST/UltrasonicLite/UltrasonicLite.h +++ b/plugins/WinVST/UltrasonicLite/UltrasonicLite.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; + double biquadA[15]; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp b/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp index bd62ec460..8bf48c273 100644 --- a/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp +++ b/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp @@ -28,15 +28,15 @@ void UltrasonicLite::processReplacing(float **inputs, float **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 32 bit stereo floating point dither @@ -79,15 +79,15 @@ void UltrasonicLite::processDoubleReplacing(double **inputs, double **outputs, V while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right //begin 64 bit stereo floating point dither diff --git a/plugins/WinVST/UltrasonicMed/UltrasonicMed.h b/plugins/WinVST/UltrasonicMed/UltrasonicMed.h index ca6b4f9d1..0a3552480 100644 --- a/plugins/WinVST/UltrasonicMed/UltrasonicMed.h +++ b/plugins/WinVST/UltrasonicMed/UltrasonicMed.h @@ -51,8 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; + double biquadA[15]; + double biquadB[15]; uint32_t fpd; //default stuff diff --git a/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp b/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp index 9c584ac7c..152e5b0ce 100644 --- a/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp +++ b/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp @@ -41,18 +41,18 @@ void UltrasonicMed::processReplacing(float **inputs, float **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; @@ -111,18 +111,18 @@ void UltrasonicMed::processDoubleReplacing(double **inputs, double **outputs, Vs while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; + double outSampleL = biquadA[2]*inputSampleL+biquadA[3]*biquadA[7]+biquadA[4]*biquadA[8]-biquadA[5]*biquadA[9]-biquadA[6]*biquadA[10]; biquadA[8] = biquadA[7]; biquadA[7] = inputSampleL; inputSampleL = outSampleL; biquadA[10] = biquadA[9]; biquadA[9] = inputSampleL; //DF1 left outSampleL = biquadB[2]*inputSampleL+biquadB[3]*biquadB[7]+biquadB[4]*biquadB[8]-biquadB[5]*biquadB[9]-biquadB[6]*biquadB[10]; biquadB[8] = biquadB[7]; biquadB[7] = inputSampleL; inputSampleL = outSampleL; biquadB[10] = biquadB[9]; biquadB[9] = inputSampleL; //DF1 left - long double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; + double outSampleR = biquadA[2]*inputSampleR+biquadA[3]*biquadA[11]+biquadA[4]*biquadA[12]-biquadA[5]*biquadA[13]-biquadA[6]*biquadA[14]; biquadA[12] = biquadA[11]; biquadA[11] = inputSampleR; inputSampleR = outSampleR; biquadA[14] = biquadA[13]; biquadA[13] = inputSampleR; //DF1 right outSampleR = biquadB[2]*inputSampleR+biquadB[3]*biquadB[11]+biquadB[4]*biquadB[12]-biquadB[5]*biquadB[13]-biquadB[6]*biquadB[14]; diff --git a/plugins/WinVST/UnBox/UnBox.h b/plugins/WinVST/UnBox/UnBox.h index 73cb40f6b..0de78a63d 100755 --- a/plugins/WinVST/UnBox/UnBox.h +++ b/plugins/WinVST/UnBox/UnBox.h @@ -56,18 +56,18 @@ private: uint32_t fpd; //default stuff - long double aL[5]; - long double bL[5]; - long double cL[11]; - long double aR[5]; - long double bR[5]; - long double cR[11]; - long double e[5]; - long double f[11]; - long double iirSampleAL; - long double iirSampleBL; - long double iirSampleAR; - long double iirSampleBR; + double aL[5]; + double bL[5]; + double cL[11]; + double aR[5]; + double bR[5]; + double cR[11]; + double e[5]; + double f[11]; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; float A; diff --git a/plugins/WinVST/UnBox/UnBoxProc.cpp b/plugins/WinVST/UnBox/UnBoxProc.cpp index 40585b3ce..e45e21e08 100755 --- a/plugins/WinVST/UnBox/UnBoxProc.cpp +++ b/plugins/WinVST/UnBox/UnBoxProc.cpp @@ -68,16 +68,16 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -130,7 +130,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -146,7 +146,7 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; @@ -265,16 +265,16 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (input != 1.0) {inputSampleL *= input; inputSampleR *= input;} if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; aL[4] = aL[3]; aL[3] = aL[2]; aL[2] = aL[1]; aL[1] = aL[0]; aL[0] = inputSampleL; @@ -327,7 +327,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR /= unbox; //now we have a distorted inputSample at the correct volume relative to drySample - long double accumulatorSampleL = (drySampleL - inputSampleL); + double accumulatorSampleL = (drySampleL - inputSampleL); cL[9] = cL[8]; cL[8] = cL[7]; cL[7] = cL[6]; cL[6] = cL[5]; cL[5] = cL[4]; cL[4] = cL[3]; cL[3] = cL[2]; cL[2] = cL[1]; cL[1] = cL[0]; cL[0] = accumulatorSampleL; @@ -343,7 +343,7 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s accumulatorSampleL += (cL[9] * f[9]); //this is now an average of all the recent variances from dry - long double accumulatorSampleR = (drySampleR - inputSampleR); + double accumulatorSampleR = (drySampleR - inputSampleR); cR[9] = cR[8]; cR[8] = cR[7]; cR[7] = cR[6]; cR[6] = cR[5]; cR[5] = cR[4]; cR[4] = cR[3]; cR[3] = cR[2]; cR[2] = cR[1]; cR[1] = cR[0]; cR[0] = accumulatorSampleR; diff --git a/plugins/WinVST/VariMu/VariMu.cpp b/plugins/WinVST/VariMu/VariMu.cpp index c4d63b29e..e71b73000 100755 --- a/plugins/WinVST/VariMu/VariMu.cpp +++ b/plugins/WinVST/VariMu/VariMu.cpp @@ -32,8 +32,8 @@ VariMu::VariMu(audioMasterCallback audioMaster) : B = 0.5; C = 1.0; D = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/VariMu/VariMu.h b/plugins/WinVST/VariMu/VariMu.h index d79dff11b..d06ae8cfc 100755 --- a/plugins/WinVST/VariMu/VariMu.h +++ b/plugins/WinVST/VariMu/VariMu.h @@ -74,8 +74,8 @@ private: double previousR; bool flip; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/VariMu/VariMuProc.cpp b/plugins/WinVST/VariMu/VariMuProc.cpp index 323b5e490..a4482761f 100755 --- a/plugins/WinVST/VariMu/VariMuProc.cpp +++ b/plugins/WinVST/VariMu/VariMuProc.cpp @@ -31,15 +31,15 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -77,8 +77,8 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -233,14 +233,14 @@ void VariMu::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -276,15 +276,15 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double coefficient; double output = outGain * C; double wet = D; - long double squaredSampleL; - long double squaredSampleR; + double squaredSampleL; + double squaredSampleR; // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -322,8 +322,8 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //for live air, we always apply the dither noise. Then, if our result is //effectively digital black, we'll subtract it aVariMu. We want a 'air' hiss - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(inputSampleL) > fabs(previousL)) squaredSampleL = previousL * previousL; else squaredSampleL = inputSampleL * inputSampleL; @@ -478,16 +478,14 @@ void VariMu::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //nice little output stage template: if we have another scale of floating point //number, we really don't want to meaninglessly multiply that by 1.0. - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Verbity/VerbityProc.cpp b/plugins/WinVST/Verbity/VerbityProc.cpp index 9a719ea4d..286a798c8 100644 --- a/plugins/WinVST/Verbity/VerbityProc.cpp +++ b/plugins/WinVST/Verbity/VerbityProc.cpp @@ -56,12 +56,12 @@ void Verbity::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -292,12 +292,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (fabs(iirAL)<1.18e-37) iirAL = 0.0; iirAL = (iirAL*(1.0-lowpass))+(inputSampleL*lowpass); inputSampleL = iirAL; @@ -461,12 +461,12 @@ void Verbity::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //purpose is that, if you're adding verb, you're not altering other balances //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Vibrato/VibratoProc.cpp b/plugins/WinVST/Vibrato/VibratoProc.cpp index 551fb2d09..150da0987 100755 --- a/plugins/WinVST/Vibrato/VibratoProc.cpp +++ b/plugins/WinVST/Vibrato/VibratoProc.cpp @@ -22,8 +22,8 @@ void Vibrato::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; double drySampleL = inputSampleL; @@ -120,8 +120,8 @@ void Vibrato::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; double drySampleL = inputSampleL; diff --git a/plugins/WinVST/VinylDither/VinylDitherProc.cpp b/plugins/WinVST/VinylDither/VinylDitherProc.cpp index f6cd4e85b..d73eece2d 100755 --- a/plugins/WinVST/VinylDither/VinylDitherProc.cpp +++ b/plugins/WinVST/VinylDither/VinylDitherProc.cpp @@ -30,8 +30,8 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -169,8 +169,8 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.cpp b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.cpp index 19f1d9493..ac1ed8939 100755 --- a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.cpp +++ b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.cpp @@ -28,8 +28,8 @@ VoiceOfTheStarship::VoiceOfTheStarship(audioMasterCallback audioMaster) : for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} lastAlgorithm = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.h b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.h index 519923b71..51c66c043 100755 --- a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.h +++ b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarship.h @@ -73,8 +73,8 @@ private: int lastAlgorithm; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp index bbb14faf6..dda1805dc 100755 --- a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp +++ b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp @@ -178,14 +178,14 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn filterflip = !filterflip; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -367,16 +367,14 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output flipR = !flipR; filterflip = !filterflip; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/VoiceTrick/VoiceTrickProc.cpp b/plugins/WinVST/VoiceTrick/VoiceTrickProc.cpp index b57b695de..0de1f49ae 100755 --- a/plugins/WinVST/VoiceTrick/VoiceTrickProc.cpp +++ b/plugins/WinVST/VoiceTrick/VoiceTrickProc.cpp @@ -23,8 +23,8 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -32,7 +32,7 @@ void VoiceTrick::processReplacing(float **inputs, float **outputs, VstInt32 samp //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) @@ -126,8 +126,8 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; @@ -135,7 +135,7 @@ void VoiceTrick::processDoubleReplacing(double **inputs, double **outputs, VstIn //setting chase functionality of Capacitor Lowpass. I could just use this value directly from the control, //but if I say it's the lowpass out of Capacitor it should literally be that in every behavior. - long double inputSample = (inputSampleL + inputSampleR) * 0.5; + double inputSample = (inputSampleL + inputSampleR) * 0.5; //this is now our mono audio count++; if (count > 5) count = 0; switch (count) diff --git a/plugins/WinVST/Wider/Wider.cpp b/plugins/WinVST/Wider/Wider.cpp index 26d4d47d5..a7cb54608 100755 --- a/plugins/WinVST/Wider/Wider.cpp +++ b/plugins/WinVST/Wider/Wider.cpp @@ -17,8 +17,8 @@ Wider::Wider(audioMasterCallback audioMaster) : C = 1.0; for(int fcount = 0; fcount < 4098; fcount++) {p[fcount] = 0.0;} count = 0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Wider/Wider.h b/plugins/WinVST/Wider/Wider.h index 6a6a2dfc5..a79fa43f0 100755 --- a/plugins/WinVST/Wider/Wider.h +++ b/plugins/WinVST/Wider/Wider.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff double p[4099]; diff --git a/plugins/WinVST/Wider/WiderProc.cpp b/plugins/WinVST/Wider/WiderProc.cpp index f90fa210c..d860ce370 100755 --- a/plugins/WinVST/Wider/WiderProc.cpp +++ b/plugins/WinVST/Wider/WiderProc.cpp @@ -18,12 +18,12 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -46,44 +46,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -138,14 +102,14 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -168,12 +132,12 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s overallscale /= 44100.0; overallscale *= getSampleRate(); - long double inputSampleL; - long double inputSampleR; + double inputSampleL; + double inputSampleR; double drySampleL; double drySampleR; - long double mid; - long double side; + double mid; + double side; double out; double densityside = (A*2.0)-1.0; double densitymid = (B*2.0)-1.0; @@ -196,44 +160,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s { inputSampleL = *in1; inputSampleR = *in2; - if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { - static int noisesource = 0; - //this declares a variable before anything else is compiled. It won't keep assigning - //it to 0 for every sample, it's as if the declaration doesn't exist in this context, - //but it lets me add this denormalization fix in a single place rather than updating - //it in three different locations. The variable isn't thread-safe but this is only - //a random seed and we can share it with whatever. - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleL = applyresidue; - } - if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { - static int noisesource = 0; - noisesource = noisesource % 1700021; noisesource++; - int residue = noisesource * noisesource; - residue = residue % 170003; residue *= residue; - residue = residue % 17011; residue *= residue; - residue = residue % 1709; residue *= residue; - residue = residue % 173; residue *= residue; - residue = residue % 17; - double applyresidue = residue; - applyresidue *= 0.00000001; - applyresidue *= 0.00000001; - inputSampleR = applyresidue; - //this denormalization routine produces a white noise at -300 dB which the noise - //shaping will interact with to produce a bipolar output, but the noise is actually - //all positive. That should stop any variables from going denormal, and the routine - //only kicks in if digital black is input. As a final touch, if you save to 24-bit - //the silence will return to being digital black again. - } + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; drySampleL = inputSampleL; drySampleR = inputSampleR; //assign working variables @@ -288,16 +216,14 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL = (drySampleL * dry) + ((mid+side) * wet); inputSampleR = (drySampleR * dry) + ((mid-side) * wet); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/XBandpass/XBandpass.h b/plugins/WinVST/XBandpass/XBandpass.h index 144855c8b..d03811383 100644 --- a/plugins/WinVST/XBandpass/XBandpass.h +++ b/plugins/WinVST/XBandpass/XBandpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/XBandpass/XBandpassProc.cpp b/plugins/WinVST/XBandpass/XBandpassProc.cpp index 4540db0df..53f7c5f2a 100644 --- a/plugins/WinVST/XBandpass/XBandpassProc.cpp +++ b/plugins/WinVST/XBandpass/XBandpassProc.cpp @@ -46,24 +46,24 @@ void XBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -221,24 +221,24 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; outSample = biquad[2]*inputSampleL+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; @@ -339,12 +339,12 @@ void XBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/XHighpass/XHighpass.h b/plugins/WinVST/XHighpass/XHighpass.h index 54165b3e0..8001ab17b 100644 --- a/plugins/WinVST/XHighpass/XHighpass.h +++ b/plugins/WinVST/XHighpass/XHighpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/XHighpass/XHighpassProc.cpp b/plugins/WinVST/XHighpass/XHighpassProc.cpp index 7fb2f3100..dd6a8d08e 100644 --- a/plugins/WinVST/XHighpass/XHighpassProc.cpp +++ b/plugins/WinVST/XHighpass/XHighpassProc.cpp @@ -44,24 +44,24 @@ void XHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -197,24 +197,24 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -295,12 +295,12 @@ void XHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/XLowpass/XLowpass.h b/plugins/WinVST/XLowpass/XLowpass.h index 928e6d0b4..dac60bc2a 100644 --- a/plugins/WinVST/XLowpass/XLowpass.h +++ b/plugins/WinVST/XLowpass/XLowpass.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/XLowpass/XLowpassProc.cpp b/plugins/WinVST/XLowpass/XLowpassProc.cpp index a2b71cb1b..48ea9f36b 100644 --- a/plugins/WinVST/XLowpass/XLowpassProc.cpp +++ b/plugins/WinVST/XLowpass/XLowpassProc.cpp @@ -47,24 +47,24 @@ void XLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -223,24 +223,24 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; outSample = biquad[2]*inputSampleL+biquad[3]*biquad[7]+biquad[4]*biquad[8]-biquad[5]*biquad[9]-biquad[6]*biquad[10]; biquad[8] = biquad[7]; biquad[7] = inputSampleL; biquad[10] = biquad[9]; @@ -341,12 +341,12 @@ void XLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/XNotch/XNotch.h b/plugins/WinVST/XNotch/XNotch.h index e83b2c356..85a0781d7 100644 --- a/plugins/WinVST/XNotch/XNotch.h +++ b/plugins/WinVST/XNotch/XNotch.h @@ -55,11 +55,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/XNotch/XNotchProc.cpp b/plugins/WinVST/XNotch/XNotchProc.cpp index efccb1de8..3e867df7b 100644 --- a/plugins/WinVST/XNotch/XNotchProc.cpp +++ b/plugins/WinVST/XNotch/XNotchProc.cpp @@ -44,24 +44,24 @@ void XNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -223,24 +223,24 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; @@ -347,12 +347,12 @@ void XNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/XRegion/XRegion.h b/plugins/WinVST/XRegion/XRegion.h index e42abe2b3..5234fc31c 100644 --- a/plugins/WinVST/XRegion/XRegion.h +++ b/plugins/WinVST/XRegion/XRegion.h @@ -56,11 +56,11 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquad[15]; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; + double biquad[15]; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/WinVST/XRegion/XRegionProc.cpp b/plugins/WinVST/XRegion/XRegionProc.cpp index 3c7f95e46..a65f234e8 100644 --- a/plugins/WinVST/XRegion/XRegionProc.cpp +++ b/plugins/WinVST/XRegion/XRegionProc.cpp @@ -96,24 +96,24 @@ void XRegion::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -338,24 +338,24 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; if (gain != 1.0) { inputSampleL *= gain; inputSampleR *= gain; } - long double nukeLevelL = inputSampleL; - long double nukeLevelR = inputSampleR; + double nukeLevelL = inputSampleL; + double nukeLevelR = inputSampleR; inputSampleL *= clipFactor; if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; @@ -473,12 +473,12 @@ void XRegion::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/YBandpass/YBandpass.h b/plugins/WinVST/YBandpass/YBandpass.h index 903d563dc..e72e50d43 100644 --- a/plugins/WinVST/YBandpass/YBandpass.h +++ b/plugins/WinVST/YBandpass/YBandpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/YBandpass/YBandpassProc.cpp b/plugins/WinVST/YBandpass/YBandpassProc.cpp index bf9b2aa2b..efdf576b5 100644 --- a/plugins/WinVST/YBandpass/YBandpassProc.cpp +++ b/plugins/WinVST/YBandpass/YBandpassProc.cpp @@ -66,23 +66,23 @@ void YBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); //biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/YHighpass/YHighpass.h b/plugins/WinVST/YHighpass/YHighpass.h index 05eb71a64..079d3bc00 100644 --- a/plugins/WinVST/YHighpass/YHighpass.h +++ b/plugins/WinVST/YHighpass/YHighpass.h @@ -80,14 +80,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -103,8 +103,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/YHighpass/YHighpassProc.cpp b/plugins/WinVST/YHighpass/YHighpassProc.cpp index 3333b4158..60626324f 100644 --- a/plugins/WinVST/YHighpass/YHighpassProc.cpp +++ b/plugins/WinVST/YHighpass/YHighpassProc.cpp @@ -66,23 +66,23 @@ void YHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/YLowpass/YLowpass.h b/plugins/WinVST/YLowpass/YLowpass.h index ac52c3738..564336a3b 100644 --- a/plugins/WinVST/YLowpass/YLowpass.h +++ b/plugins/WinVST/YLowpass/YLowpass.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/YLowpass/YLowpassProc.cpp b/plugins/WinVST/YLowpass/YLowpassProc.cpp index 86343995d..a4c489f53 100644 --- a/plugins/WinVST/YLowpass/YLowpassProc.cpp +++ b/plugins/WinVST/YLowpass/YLowpassProc.cpp @@ -66,23 +66,23 @@ void YLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -220,23 +220,23 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -297,12 +297,12 @@ void YLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/YNotch/YNotch.h b/plugins/WinVST/YNotch/YNotch.h index 3a7074bec..e699edb1f 100644 --- a/plugins/WinVST/YNotch/YNotch.h +++ b/plugins/WinVST/YNotch/YNotch.h @@ -81,14 +81,14 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquad[biq_total]; + double biquad[biq_total]; - long double powFactorA; - long double powFactorB; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; + double powFactorA; + double powFactorB; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; enum { fix_freq, @@ -104,8 +104,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/YNotch/YNotchProc.cpp b/plugins/WinVST/YNotch/YNotchProc.cpp index ef6b9c773..f3535a645 100644 --- a/plugins/WinVST/YNotch/YNotchProc.cpp +++ b/plugins/WinVST/YNotch/YNotchProc.cpp @@ -65,23 +65,23 @@ void YNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -218,23 +218,23 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; - long double temp = (long double)sampleFrames/inFramesToProcess; + double temp = (double)sampleFrames/inFramesToProcess; biquad[biq_a0] = (biquad[biq_aA0]*temp)+(biquad[biq_aB0]*(1.0-temp)); biquad[biq_a1] = (biquad[biq_aA1]*temp)+(biquad[biq_aB1]*(1.0-temp)); biquad[biq_a2] = (biquad[biq_aA2]*temp)+(biquad[biq_aB2]*(1.0-temp)); biquad[biq_b1] = (biquad[biq_bA1]*temp)+(biquad[biq_bB1]*(1.0-temp)); biquad[biq_b2] = (biquad[biq_bA2]*temp)+(biquad[biq_bB2]*(1.0-temp)); //this is the interpolation code for the biquad - long double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); - long double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); - long double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); + double powFactor = (powFactorA*temp)+(powFactorB*(1.0-temp)); + double inTrim = (inTrimA*temp)+(inTrimB*(1.0-temp)); + double outTrim = (outTrimA*temp)+(outTrimB*(1.0-temp)); inputSampleL *= inTrim; inputSampleR *= inTrim; @@ -295,12 +295,12 @@ void YNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZBandpass/ZBandpass.h b/plugins/WinVST/ZBandpass/ZBandpass.h index febc1562b..6dd973ab7 100644 --- a/plugins/WinVST/ZBandpass/ZBandpass.h +++ b/plugins/WinVST/ZBandpass/ZBandpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZBandpass/ZBandpassProc.cpp b/plugins/WinVST/ZBandpass/ZBandpassProc.cpp index 1345861c0..ab264eb48 100644 --- a/plugins/WinVST/ZBandpass/ZBandpassProc.cpp +++ b/plugins/WinVST/ZBandpass/ZBandpassProc.cpp @@ -63,18 +63,18 @@ void ZBandpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -254,18 +254,18 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -371,12 +371,12 @@ void ZBandpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZBandpass2/ZBandpass2.h b/plugins/WinVST/ZBandpass2/ZBandpass2.h index 8aae72342..35e06499f 100644 --- a/plugins/WinVST/ZBandpass2/ZBandpass2.h +++ b/plugins/WinVST/ZBandpass2/ZBandpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp b/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp index 641a5634a..60ec7317e 100644 --- a/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp +++ b/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp @@ -62,16 +62,16 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZBandpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZBandpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZHighpass/ZHighpass.h b/plugins/WinVST/ZHighpass/ZHighpass.h index 3985b75ae..fc00f8ff8 100644 --- a/plugins/WinVST/ZHighpass/ZHighpass.h +++ b/plugins/WinVST/ZHighpass/ZHighpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZHighpass/ZHighpassProc.cpp b/plugins/WinVST/ZHighpass/ZHighpassProc.cpp index 43ed909bb..09a18cfb2 100644 --- a/plugins/WinVST/ZHighpass/ZHighpassProc.cpp +++ b/plugins/WinVST/ZHighpass/ZHighpassProc.cpp @@ -61,18 +61,18 @@ void ZHighpass::processReplacing(float **inputs, float **outputs, VstInt32 sampl //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -243,18 +243,18 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -355,12 +355,12 @@ void ZHighpass::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZHighpass2/ZHighpass2.h b/plugins/WinVST/ZHighpass2/ZHighpass2.h index d5bb73f3a..7c8d3a52f 100644 --- a/plugins/WinVST/ZHighpass2/ZHighpass2.h +++ b/plugins/WinVST/ZHighpass2/ZHighpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp b/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp index 7bb5b9a99..5add1560b 100644 --- a/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp +++ b/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp @@ -62,16 +62,16 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZHighpass2::processReplacing(float **inputs, float **outputs, VstInt32 samp biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZHighpass2::processDoubleReplacing(double **inputs, double **outputs, VstIn } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZLowpass/ZLowpass.h b/plugins/WinVST/ZLowpass/ZLowpass.h index d32901e01..3939e781b 100644 --- a/plugins/WinVST/ZLowpass/ZLowpass.h +++ b/plugins/WinVST/ZLowpass/ZLowpass.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZLowpass/ZLowpassProc.cpp b/plugins/WinVST/ZLowpass/ZLowpassProc.cpp index 728f25dde..c5df9e840 100644 --- a/plugins/WinVST/ZLowpass/ZLowpassProc.cpp +++ b/plugins/WinVST/ZLowpass/ZLowpassProc.cpp @@ -63,18 +63,18 @@ void ZLowpass::processReplacing(float **inputs, float **outputs, VstInt32 sample //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZLowpass::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZLowpass2/ZLowpass2.h b/plugins/WinVST/ZLowpass2/ZLowpass2.h index b093df0e7..1f51c3c2e 100644 --- a/plugins/WinVST/ZLowpass2/ZLowpass2.h +++ b/plugins/WinVST/ZLowpass2/ZLowpass2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp b/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp index 61bc55947..415ca5f47 100644 --- a/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp +++ b/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp @@ -62,16 +62,16 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZLowpass2::processReplacing(float **inputs, float **outputs, VstInt32 sampl biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZLowpass2::processDoubleReplacing(double **inputs, double **outputs, VstInt } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZNotch/ZNotch.h b/plugins/WinVST/ZNotch/ZNotch.h index 603ffa4ec..e493e40f6 100644 --- a/plugins/WinVST/ZNotch/ZNotch.h +++ b/plugins/WinVST/ZNotch/ZNotch.h @@ -55,14 +55,14 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double biquadA[15]; - long double biquadB[15]; - long double biquadC[15]; - long double biquadD[15]; - long double biquadE[15]; - long double biquadF[15]; - long double iirSampleAL; - long double iirSampleAR; + double biquadA[15]; + double biquadB[15]; + double biquadC[15]; + double biquadD[15]; + double biquadE[15]; + double biquadF[15]; + double iirSampleAL; + double iirSampleAR; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZNotch/ZNotchProc.cpp b/plugins/WinVST/ZNotch/ZNotchProc.cpp index a5eaba61e..37871fa0e 100644 --- a/plugins/WinVST/ZNotch/ZNotchProc.cpp +++ b/plugins/WinVST/ZNotch/ZNotchProc.cpp @@ -63,18 +63,18 @@ void ZNotch::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -256,18 +256,18 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //output as the control is turned up. Each one independently goes from 0-1 and stays at 1 //beyond that point: this is a way to progressively add a 'black box' sound processing //which lets you fall through to simpler processing at lower settings. - long double outSample = 0.0; + double outSample = 0.0; while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = drySampleL; - long double overallDrySampleR = drySampleR; + double inputSampleL = *in1; + double inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = drySampleL; + double overallDrySampleR = drySampleR; if (inTrim != 1.0) {inputSampleL *= inTrim; inputSampleR *= inTrim;} if (inputSampleL > 1.0) inputSampleL = 1.0; if (inputSampleL < -1.0) inputSampleL = -1.0; @@ -375,12 +375,12 @@ void ZNotch::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/ZNotch2/ZNotch2.h b/plugins/WinVST/ZNotch2/ZNotch2.h index 3dde478ea..f23bf7b0d 100644 --- a/plugins/WinVST/ZNotch2/ZNotch2.h +++ b/plugins/WinVST/ZNotch2/ZNotch2.h @@ -55,8 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double iirSampleAL; - long double iirSampleAR; + double iirSampleAL; + double iirSampleAR; enum { biq_freq, biq_reso, @@ -81,16 +81,16 @@ private: biq_sR2, biq_total }; //coefficient interpolating biquad filter, stereo - long double biquadA[biq_total]; - long double biquadB[biq_total]; - long double biquadC[biq_total]; - long double biquadD[biq_total]; - long double inTrimA; - long double inTrimB; - long double outTrimA; - long double outTrimB; - long double wetA; - long double wetB; + double biquadA[biq_total]; + double biquadB[biq_total]; + double biquadC[biq_total]; + double biquadD[biq_total]; + double inTrimA; + double inTrimB; + double outTrimA; + double outTrimB; + double wetA; + double wetB; enum { fix_freq, @@ -106,8 +106,8 @@ private: fix_sR2, fix_total }; //fixed frequency biquad filter for ultrasonics, stereo - long double fixA[fix_total]; - long double fixB[fix_total]; + double fixA[fix_total]; + double fixB[fix_total]; uint32_t fpdL; uint32_t fpdR; diff --git a/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp b/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp index 9e9443722..1e2f92745 100644 --- a/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp +++ b/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp @@ -62,16 +62,16 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -79,13 +79,13 @@ void ZNotch2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -278,16 +278,16 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - long double drySampleL = inputSampleL; - long double drySampleR = inputSampleR; - long double overallDrySampleL = inputSampleL; - long double overallDrySampleR = inputSampleR; + double drySampleL = inputSampleL; + double drySampleR = inputSampleR; + double overallDrySampleL = inputSampleL; + double overallDrySampleR = inputSampleR; - long double outSample = (long double)sampleFrames/inFramesToProcess; + double outSample = (double)sampleFrames/inFramesToProcess; biquadA[biq_a0] = (biquadA[biq_aA0]*outSample)+(biquadA[biq_aB0]*(1.0-outSample)); biquadA[biq_a1] = (biquadA[biq_aA1]*outSample)+(biquadA[biq_aB1]*(1.0-outSample)); biquadA[biq_a2] = (biquadA[biq_aA2]*outSample)+(biquadA[biq_aB2]*(1.0-outSample)); @@ -295,13 +295,13 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 biquadA[biq_b2] = (biquadA[biq_bA2]*outSample)+(biquadA[biq_bB2]*(1.0-outSample)); for (int x = 0; x < 7; x++) {biquadD[x] = biquadC[x] = biquadB[x] = biquadA[x];} //this is the interpolation code for the biquad - long double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); - long double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); - long double wet = (wetA*outSample)+(wetB*(1.0-outSample)); - long double aWet = 1.0; - long double bWet = 1.0; - long double cWet = 1.0; - long double dWet = wet*4.0; + double inTrim = (inTrimA*outSample)+(inTrimB*(1.0-outSample)); + double outTrim = (outTrimA*outSample)+(outTrimB*(1.0-outSample)); + double wet = (wetA*outSample)+(wetB*(1.0-outSample)); + double aWet = 1.0; + double bWet = 1.0; + double cWet = 1.0; + double dWet = wet*4.0; //four-stage wet/dry control using progressive stages that bypass when not engaged if (dWet < 1.0) {aWet = dWet; bWet = 0.0; cWet = 0.0; dWet = 0.0;} else if (dWet < 2.0) {bWet = dWet - 1.0; cWet = 0.0; dWet = 0.0;} @@ -421,12 +421,12 @@ void ZNotch2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/curve/curve.h b/plugins/WinVST/curve/curve.h index b1c313eec..4dd52f8e7 100755 --- a/plugins/WinVST/curve/curve.h +++ b/plugins/WinVST/curve/curve.h @@ -51,7 +51,7 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double gain; + double gain; uint32_t fpd; //default stuff }; diff --git a/plugins/WinVST/curve/curveProc.cpp b/plugins/WinVST/curve/curveProc.cpp index d7739b806..3a3f18b86 100755 --- a/plugins/WinVST/curve/curveProc.cpp +++ b/plugins/WinVST/curve/curveProc.cpp @@ -16,8 +16,8 @@ void curve::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; @@ -65,8 +65,8 @@ void curve::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; diff --git a/plugins/WinVST/uLawDecode/uLawDecode.cpp b/plugins/WinVST/uLawDecode/uLawDecode.cpp index 234bc6cff..e1dd5cc6e 100755 --- a/plugins/WinVST/uLawDecode/uLawDecode.cpp +++ b/plugins/WinVST/uLawDecode/uLawDecode.cpp @@ -14,8 +14,8 @@ uLawDecode::uLawDecode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/uLawDecode/uLawDecode.h b/plugins/WinVST/uLawDecode/uLawDecode.h index ec3f23285..fb74bcdba 100755 --- a/plugins/WinVST/uLawDecode/uLawDecode.h +++ b/plugins/WinVST/uLawDecode/uLawDecode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/uLawDecode/uLawDecodeProc.cpp b/plugins/WinVST/uLawDecode/uLawDecodeProc.cpp index 18356232c..0c0ee1f1f 100755 --- a/plugins/WinVST/uLawDecode/uLawDecodeProc.cpp +++ b/plugins/WinVST/uLawDecode/uLawDecodeProc.cpp @@ -24,8 +24,8 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawDecode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawDecode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/uLawEncode/uLawEncode.cpp b/plugins/WinVST/uLawEncode/uLawEncode.cpp index 0c062b676..e4f3de546 100755 --- a/plugins/WinVST/uLawEncode/uLawEncode.cpp +++ b/plugins/WinVST/uLawEncode/uLawEncode.cpp @@ -14,8 +14,8 @@ uLawEncode::uLawEncode(audioMasterCallback audioMaster) : { A = 1.0; B = 1.0; - fpNShapeL = 0.0; - fpNShapeR = 0.0; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/uLawEncode/uLawEncode.h b/plugins/WinVST/uLawEncode/uLawEncode.h index a8c6858f7..41d0d6008 100755 --- a/plugins/WinVST/uLawEncode/uLawEncode.h +++ b/plugins/WinVST/uLawEncode/uLawEncode.h @@ -53,8 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - long double fpNShapeL; - long double fpNShapeR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/uLawEncode/uLawEncodeProc.cpp b/plugins/WinVST/uLawEncode/uLawEncodeProc.cpp index c5dd74d76..7f0eb12cd 100755 --- a/plugins/WinVST/uLawEncode/uLawEncodeProc.cpp +++ b/plugins/WinVST/uLawEncode/uLawEncodeProc.cpp @@ -24,8 +24,8 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -88,14 +88,14 @@ void uLawEncode::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -124,8 +124,8 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn while (--sampleFrames >= 0) { - long double inputSampleL = *in1; - long double inputSampleR = *in2; + double inputSampleL = *in1; + double inputSampleR = *in2; static int noisesourceL = 0; static int noisesourceR = 850010; @@ -188,16 +188,14 @@ void uLawEncode::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = (inputSampleR * wet) + (drySampleR * dry); } - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR;